lib/nanoc/cli/error_handler.rb in nanoc-3.7.3 vs lib/nanoc/cli/error_handler.rb in nanoc-3.7.4

- old
+ new

@@ -48,11 +48,11 @@ # called directly; use {Nanoc::CLI::ErrorHandler.handle_while} instead. # # @return [void] # # @api private - def handle_while(&block) + def handle_while(&_block) # Set exit handler %w( INT TERM ).each do |signal| Signal.trap(signal) do puts exit!(0) @@ -155,11 +155,11 @@ write_environment(stream, :verbose => true) write_gemfile_lock(stream, :verbose => true) write_load_paths(stream, :verbose => true) end - protected + protected # @return [Boolean] true if debug output is enabled, false if not # # @see Nanoc::CLI.debug? def debug? @@ -182,11 +182,11 @@ end # @return [Hash<String, Array>] A hash containing the gem names as keys and gem versions as value def gems_and_versions gems = {} - Gem::Specification.find_all.sort_by { |s| [ s.name, s.version ] }.each do |spec| + Gem::Specification.find_all.sort_by { |s| [s.name, s.version] }.each do |spec| gems[spec.name] ||= [] gems[spec.name] << spec.version.to_s end gems end @@ -246,15 +246,15 @@ "Install the '#{gem_name}' gem using `gem install #{gem_name}`." end end when RuntimeError if error.message =~ /^can't modify frozen/ - "You attempted to modify immutable data. Some data, such as " \ - "item/layout attributes and raw item/layout content, can not " \ - "be modified once compilation has started. (This was " \ - "unintentionally possible in 3.1.x and before, but has been " \ - "disabled in 3.2.x in order to allow compiler optimisations.)" + 'You attempted to modify immutable data. Some data, such as ' \ + 'item/layout attributes and raw item/layout content, can not ' \ + 'be modified once compilation has started. (This was ' \ + 'unintentionally possible in 3.1.x and before, but has been ' \ + 'disabled in 3.2.x in order to allow compiler optimisations.)' end end end def using_bundler? @@ -277,11 +277,11 @@ stream.puts "#{error.class}: #{error.message}" resolution = resolution_for(error) stream.puts "#{resolution}" if resolution end - def write_compilation_stack(stream, error, params = {}) + def write_compilation_stack(stream, _error, params = {}) write_section_header(stream, 'Compilation stack', params) if stack.empty? stream.puts ' (empty)' else @@ -307,10 +307,10 @@ if !is_verbose && error.backtrace.size > count stream.puts " ... #{error.backtrace.size - count} more lines omitted. See full crash log for details." end end - def write_issue_link(stream, params = {}) + def write_issue_link(stream, _params = {}) stream.puts stream.puts 'If you believe this is a bug in nanoc, please do report it at' stream.puts '-> https://github.com/nanoc/nanoc/issues/new <-' stream.puts stream.puts 'A detailed crash log has been written to ./crash.log.'