diff options
author | Kyrylo Silin <silin@kyrylo.org> | 2019-03-02 02:00:34 +0200 |
---|---|---|
committer | Kyrylo Silin <silin@kyrylo.org> | 2019-03-02 11:03:54 +0200 |
commit | 8ea5b6e0aa3405ee157aa1c7756a5619324d1bfd (patch) | |
tree | 8157c1b12a530712c553e53da146096ca1355a70 /lib/pry/commands | |
parent | 501e949921bb7d06c9f7a5c193976dac92ec8164 (diff) | |
download | pry-8ea5b6e0aa3405ee157aa1c7756a5619324d1bfd.tar.gz |
rubocop: fix offences of the Style/FormatString cop
Diffstat (limited to 'lib/pry/commands')
-rw-r--r-- | lib/pry/commands/gem_stats.rb | 5 | ||||
-rw-r--r-- | lib/pry/commands/ls/local_vars.rb | 2 |
2 files changed, 4 insertions, 3 deletions
diff --git a/lib/pry/commands/gem_stats.rb b/lib/pry/commands/gem_stats.rb index 7d91be68..7dde0f6e 100644 --- a/lib/pry/commands/gem_stats.rb +++ b/lib/pry/commands/gem_stats.rb @@ -65,14 +65,15 @@ VVVVVVVVVVVVVVVVVVVVV #{red('Dependencies')} (development) %{ddependencies} FORMAT - format_str % { + format( + format_str, name: green(h.name), version: bold("v#{h.version}"), downloads: h.downloads, version_downloads: h.version_downloads, rdependencies: format_dependencies(h.dependencies.runtime), ddependencies: format_dependencies(h.dependencies.development) - } + ) end def format_dependencies(rdeps) diff --git a/lib/pry/commands/ls/local_vars.rb b/lib/pry/commands/ls/local_vars.rb index 9b1e14e0..5bdd66b1 100644 --- a/lib/pry/commands/ls/local_vars.rb +++ b/lib/pry/commands/ls/local_vars.rb @@ -31,7 +31,7 @@ class Pry colorized_lhs = color(:local_var, lhs) color_escape_padding = colorized_lhs.size - lhs.size pad = desired_width + color_escape_padding - "%-#{pad}s = %s" % [color(:local_var, colorized_lhs), rhs] + Kernel.format("%-#{pad}s = %s", color(:local_var, colorized_lhs), rhs) end end end |