Sha256: f8399c31592dec2ea38d26177a796af44c21e5cc50308ebb764e580c7756283d

Contents?: true

Size: 1.39 KB

Versions: 53

Compression:

Stored size: 1.39 KB

Contents

module Bundler
  class Env

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

    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

  private

    def read_file(filename)
      File.read(filename).strip
    rescue Errno::ENOENT
      "<No #{filename} found>"
    rescue => e
      "#{e.class}: #{e.message}"
    end

  end
end

Version data entries

53 entries across 53 versions & 2 rubygems

Version Path
bundler-1.7.15 lib/bundler/env.rb
bundler-1.7.14 lib/bundler/env.rb
bundler-1.7.13 lib/bundler/env.rb
bundler-1.7.12 lib/bundler/env.rb
bundler-1.7.11 lib/bundler/env.rb
bundler-1.7.10 lib/bundler/env.rb
bundler-1.7.9 lib/bundler/env.rb
bundler-1.7.8 lib/bundler/env.rb
bundler-1.7.7 lib/bundler/env.rb
bundler-1.7.6 lib/bundler/env.rb
bundler-1.6.9 lib/bundler/env.rb
bundler-1.7.5 lib/bundler/env.rb
bundler-1.6.8 lib/bundler/env.rb
bundler-1.7.4 lib/bundler/env.rb
bundler-1.6.7 lib/bundler/env.rb
bundler-1.7.3 lib/bundler/env.rb
bundler-1.6.6 lib/bundler/env.rb
bundler-1.7.2 lib/bundler/env.rb
bundler-1.7.1 lib/bundler/env.rb
bundler-1.7.1.pre.3 lib/bundler/env.rb