lib/nanoc/cli/error_handler.rb in nanoc-4.1.1 vs lib/nanoc/cli/error_handler.rb in nanoc-4.1.2

- old
+ new

@@ -136,11 +136,10 @@ write_compilation_stack(stream, error, verbose: true) write_stack_trace(stream, error, verbose: true) write_version_information(stream, verbose: true) write_system_information(stream, verbose: true) write_installed_gems(stream, verbose: true) - write_environment(stream, verbose: true) write_gemfile_lock(stream, verbose: true) write_load_paths(stream, verbose: true) end protected @@ -206,11 +205,11 @@ 'redcarpet' => 'redcarpet', 'redcloth' => 'RedCloth', 'rubypants' => 'rubypants', 'sass' => 'sass', 'w3c_validators' => 'w3c_validators', - } + }.freeze # Attempts to find a resolution for the given error, or nil if no # resolution can be automatically obtained. # # @param [Error] error The error to find a resolution for @@ -224,11 +223,11 @@ return nil if matches.nil? gem_name = GEM_NAMES[matches[2]] # Build message if gem_name - if self.using_bundler? + if using_bundler? 'Make sure the gem is added to Gemfile and run `bundle install`.' else "Install the '#{gem_name}' gem using `gem install #{gem_name}`." end end @@ -260,11 +259,11 @@ def write_error_message(stream, error, verbose: false) write_section_header(stream, 'Message', verbose: verbose) stream.puts "#{error.class}: #{error.message}" resolution = resolution_for(error) - stream.puts "#{resolution}" if resolution + stream.puts resolution.to_s if resolution end def write_compilation_stack(stream, _error, verbose: false) write_section_header(stream, 'Compilation stack', verbose: verbose) @@ -315,16 +314,9 @@ def write_installed_gems(stream, verbose: false) write_section_header(stream, 'Installed gems', verbose: verbose) gems_and_versions.each do |g| stream.puts " #{g.first} #{g.last.join(', ')}" - end - end - - def write_environment(stream, verbose: false) - write_section_header(stream, 'Environment', verbose: verbose) - ENV.sort.each do |e| - stream.puts "#{e.first} => #{e.last.inspect}" end end def write_gemfile_lock(stream, verbose: false) if File.exist?('Gemfile.lock')