Class: Bundler::Env

Inherits:
Object
  • Object
show all
Defined in:
lib/bundler/env.rb

Instance Method Summary (collapse)

Instance Method Details

- (Object) report



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/bundler/env.rb', line 8

def report
  out = "Bundler #{Bundler::VERSION}\n"

  out << "Ruby #{RUBY_VERSION} (#{RUBY_RELEASE_DATE}"
  out << " patchlevel #{RUBY_PATCHLEVEL}" if defined? RUBY_PATCHLEVEL
  out << ") [#{RUBY_PLATFORM}]\n"

  out << "Rubygems #{Gem::VERSION}\n"

  out << "rvm #{ENV['rvm_version']}\n" if ENV['rvm_version']

  out << "GEM_HOME #{ENV['GEM_HOME']}\n"

  out << "GEM_PATH #{ENV['GEM_PATH']}\n" unless ENV['GEM_PATH'] == ENV['GEM_HOME']

  %w(rubygems-bundler open_gem).each do |name|
    specs = Gem::Specification.find_all{|s| s.name == name }
    out << "#{name} (#{specs.map(&:version).join(',')})\n" unless specs.empty?
  end

  out << "\nBundler settings\n" unless Bundler.settings.all.empty?
  Bundler.settings.all.each do |setting|
    out << "  #{setting}\n"
    Bundler.settings.pretty_values_for(setting).each do |line|
      out << "    " << line << "\n"
    end
  end

  out << "\n\n" << "Gemfile\n"
  out << read_file("Gemfile") << "\n"

  out << "\n\n" << "Gemfile.lock\n"
  out << read_file("Gemfile.lock") << "\n"

  out
end

- (Object) write(io)



4
5
6
# File 'lib/bundler/env.rb', line 4

def write(io)
  io.write(report)
end