diff --git a/lib/pry.rb b/lib/pry.rb index a3f4c06a..d257e775 100644 --- a/lib/pry.rb +++ b/lib/pry.rb @@ -8,7 +8,6 @@ class Pry DEFAULT_HOOKS = { :before_session => proc do |out, target| # ensure we're actually in a method - meth_name = target.eval('__method__') file = target.eval('__FILE__') # /unknown/ for rbx diff --git a/lib/pry/default_commands/input.rb b/lib/pry/default_commands/input.rb index a06443bd..4eac7a46 100644 --- a/lib/pry/default_commands/input.rb +++ b/lib/pry/default_commands/input.rb @@ -75,7 +75,7 @@ e.g amend-line puts 'hello again' # no line number modifies immediately preced output.puts "Invalid method name: #{meth_name}." next end - code, code_type = code_and_code_type_for(meth) + code, _ = code_and_code_type_for(meth) next if !code range = opts.l? ? one_index_range_or_number(opts[:l]) : (0..-1) diff --git a/lib/pry/default_commands/shell.rb b/lib/pry/default_commands/shell.rb index 60c2f05b..38ed2b4e 100644 --- a/lib/pry/default_commands/shell.rb +++ b/lib/pry/default_commands/shell.rb @@ -80,7 +80,7 @@ class Pry next end - contents, normalized_start_line, _ = read_between_the_lines(file_name, start_line, end_line) + contents, _, _ = read_between_the_lines(file_name, start_line, end_line) contents = syntax_highlight_by_file_type_or_specified(contents, file_name, opts[:type]) if opts.l? diff --git a/lib/pry/helpers/base_helpers.rb b/lib/pry/helpers/base_helpers.rb index 55dba6ff..e3a22639 100644 --- a/lib/pry/helpers/base_helpers.rb +++ b/lib/pry/helpers/base_helpers.rb @@ -73,7 +73,7 @@ class Pry end def highlight(string, regexp, highlight_color=:bright_yellow) - highlighted = string.gsub(regexp) { |match| "<#{highlight_color}>#{match}" } + string.gsub(regexp) { |match| "<#{highlight_color}>#{match}" } end # formatting diff --git a/lib/pry/helpers/command_helpers.rb b/lib/pry/helpers/command_helpers.rb index 55ec103a..d224ae79 100644 --- a/lib/pry/helpers/command_helpers.rb +++ b/lib/pry/helpers/command_helpers.rb @@ -290,7 +290,7 @@ class Pry def process_yardoc_tag(comment, tag) in_tag_block = nil - output = comment.lines.map do |v| + comment.lines.map do |v| if in_tag_block && v !~ /^\S/ Pry::Helpers::Text.strip_color Pry::Helpers::Text.strip_color(v) elsif in_tag_block