diff options
author | Kyrylo Silin <silin@kyrylo.org> | 2018-10-16 04:53:24 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-16 04:53:24 +0800 |
commit | e5d01bb4d38c043bc708e7757faf77fd457ed94b (patch) | |
tree | a0334fff05b4f8d018f9f8d4b258208ee98aac2d | |
parent | 3f24be54584a14440433dcafd23d2e244e84a7c2 (diff) | |
parent | dcb8c4615033454138eb0a69b2d33a7c84b1ce3d (diff) | |
download | pry-e5d01bb4d38c043bc708e7757faf77fd457ed94b.tar.gz |
Merge pull request #1808 from pry/rubocop-lint-string-conversion-in-interpolation
rubocop: fix offences of the Lint/StringConversionInInterpolation
-rw-r--r-- | .rubocop_todo.yml | 8 | ||||
-rw-r--r-- | lib/pry/command.rb | 2 | ||||
-rw-r--r-- | lib/pry/commands/watch_expression.rb | 2 | ||||
-rw-r--r-- | lib/pry/method/patcher.rb | 2 |
4 files changed, 3 insertions, 11 deletions
diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 9b9bb794..26fea174 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -636,14 +636,6 @@ Lint/ShadowedException: Exclude: - 'lib/pry/method.rb' -# Offense count: 4 -# Cop supports --auto-correct. -Lint/StringConversionInInterpolation: - Exclude: - - 'lib/pry/command.rb' - - 'lib/pry/commands/watch_expression.rb' - - 'lib/pry/method/patcher.rb' - # Offense count: 36 Lint/UnderscorePrefixedVariableName: Enabled: false diff --git a/lib/pry/command.rb b/lib/pry/command.rb index 6b0d9c13..5abd5555 100644 --- a/lib/pry/command.rb +++ b/lib/pry/command.rb @@ -212,7 +212,7 @@ class Pry $1.capitalize.gsub(/_/, " ") when %r{(pry-\w+)-([\d\.]+([\w\.]+)?)} name, version = $1, $2 - "#{name.to_s} (v#{version.to_s})" + "#{name} (v#{version})" when /pryrc/ "pryrc" else diff --git a/lib/pry/commands/watch_expression.rb b/lib/pry/commands/watch_expression.rb index 604164fc..bf165774 100644 --- a/lib/pry/commands/watch_expression.rb +++ b/lib/pry/commands/watch_expression.rb @@ -81,7 +81,7 @@ class Pry expressions.each do |expr| expr.eval! if expr.changed? - output.puts "#{blue "watch"}: #{expr.to_s}" + output.puts "#{blue "watch"}: #{expr}" end end end diff --git a/lib/pry/method/patcher.rb b/lib/pry/method/patcher.rb index 73ae263f..83360a5e 100644 --- a/lib/pry/method/patcher.rb +++ b/lib/pry/method/patcher.rb @@ -94,7 +94,7 @@ class Pry def wrap_for_owner(source) Pry.current[:pry_owner] = method.owner owner_source = definition_for_owner(source) - visibility_fix = "#{method.visibility.to_s} #{method.name.to_sym.inspect}" + visibility_fix = "#{method.visibility} #{method.name.to_sym.inspect}" "Pry.current[:pry_owner].class_eval do; #{owner_source}\n#{visibility_fix}\nend" end |