diff options
author | Andre Arko <andre@arko.net> | 2014-11-30 01:01:12 -0800 |
---|---|---|
committer | Andre Arko <andre@arko.net> | 2014-11-30 22:32:10 -0800 |
commit | f99d098229ed2d0c7e994101a54087bb6e32c0fb (patch) | |
tree | a94879fd5554959bb1804e488199f04de24c4bf6 /lib/bundler/env.rb | |
parent | 552eb1bff3147a920a7d84b5857a8ba97e563f6b (diff) | |
download | bundler-f99d098229ed2d0c7e994101a54087bb6e32c0fb.tar.gz |
indent env for use in markdown
Diffstat (limited to 'lib/bundler/env.rb')
-rw-r--r-- | lib/bundler/env.rb | 37 |
1 files changed, 16 insertions, 21 deletions
diff --git a/lib/bundler/env.rb b/lib/bundler/env.rb index 93e8fbc9ef..16f8644fb6 100644 --- a/lib/bundler/env.rb +++ b/lib/bundler/env.rb @@ -5,43 +5,38 @@ module Bundler class Env def write(io) - io.write(report) + io.write report(:print_gemfile => true) end def report(options = {}) print_gemfile = options.delete(:print_gemfile) - out = "Bundler #{Bundler::VERSION}\n" - - out << "Rubygems #{Gem::VERSION}\n" - - out << "rvm #{ENV['rvm_version']}\n" if ENV['rvm_version'] - - out << "Git #{git_information}\n" - - out << "GEM_HOME #{ENV['GEM_HOME']}\n" - - out << "GEM_PATH #{ENV['GEM_PATH']}\n" unless ENV['GEM_PATH'] == ENV['GEM_HOME'] - + out = "Environment\n\n" + out << " Bundler #{Bundler::VERSION}\n" + out << " Rubygems #{Gem::VERSION}\n" + out << " GEM_HOME #{ENV['GEM_HOME']}\n" unless ENV['GEM_HOME'].nil? || ENV['GEM_HOME'].empty? + out << " GEM_PATH #{ENV['GEM_PATH']}\n" unless ENV['GEM_PATH'] == ENV['GEM_HOME'] + out << " RVM #{ENV['rvm_version']}\n" if ENV['rvm_version'] + out << " Git #{git_information}\n" %w(rubygems-bundler open_gem).each do |name| specs = Bundler.rubygems.find_name(name) - out << "#{name} (#{specs.map(&:version).join(',')})\n" unless specs.empty? + out << " #{name} (#{specs.map(&:version).join(',')})\n" unless specs.empty? end - out << "\nBundler settings\n" unless Bundler.settings.all.empty? + out << "\nBundler settings\n\n" unless Bundler.settings.all.empty? Bundler.settings.all.each do |setting| - out << " #{setting}\n" + out << " " << setting << "\n" Bundler.settings.pretty_values_for(setting).each do |line| - out << " " << line << "\n" + out << " " << line << "\n" end end if print_gemfile - out << "\n\n" << "Gemfile\n" - out << read_file("Gemfile") << "\n" + out << "\nGemfile\n\n" + out << " " << read_file("Gemfile").gsub(/\n/, "\n ") << "\n" - out << "\n\n" << "Gemfile.lock\n" - out << read_file("Gemfile.lock") << "\n" + out << "\n" << "Gemfile.lock\n\n" + out << " " << read_file("Gemfile.lock").gsub(/\n/, "\n ") << "\n" end out |