diff --git a/Gemfile b/Gemfile index 1f014f79..625c2592 100644 --- a/Gemfile +++ b/Gemfile @@ -10,5 +10,5 @@ gem "rubocop", "1.56.0" gem "rubocop-md", "1.2.0" gem "rubocop-minitest", "0.31.0" gem "rubocop-packaging", "0.5.2" -gem "rubocop-performance", "1.18.0" +gem "rubocop-performance", "1.19.0" gem "rubocop-rake", "0.6.0" diff --git a/lib/tomo/cli/usage.rb b/lib/tomo/cli/usage.rb index 1d31042d..c218b7ab 100644 --- a/lib/tomo/cli/usage.rb +++ b/lib/tomo/cli/usage.rb @@ -26,7 +26,7 @@ def to_s attr_reader :banner_proc, :options def options_help - width = options.map(&:first).map(&:length).max + width = options.map { |opt| opt.first.length }.max options.each_with_object([]) do |(spec, desc), help| help << "#{Colors.yellow(spec.ljust(width))} #{desc}" end.join("\n") diff --git a/lib/tomo/plugin/puma/tasks.rb b/lib/tomo/plugin/puma/tasks.rb index c5257cf7..2e22e913 100644 --- a/lib/tomo/plugin/puma/tasks.rb +++ b/lib/tomo/plugin/puma/tasks.rb @@ -81,7 +81,7 @@ def linger_must_be_enabled! def setup_directories files = [service.path, socket.path].compact - dirs = files.map(&:dirname).map(&:to_s) + dirs = files.map { |f| f.dirname.to_s } remote.mkdir_p dirs.uniq end diff --git a/lib/tomo/runtime/settings_interpolation.rb b/lib/tomo/runtime/settings_interpolation.rb index d6928f8a..5caff850 100644 --- a/lib/tomo/runtime/settings_interpolation.rb +++ b/lib/tomo/runtime/settings_interpolation.rb @@ -39,7 +39,7 @@ def symbolize(hash) end def dump_settings(hash) - key_len = hash.keys.map(&:to_s).map(&:length).max + key_len = hash.keys.map { |k| k.to_s.length }.max dump = "Settings: {\n" hash.to_a.sort_by(&:first).each do |key, value| justified_key = "#{key}:".ljust(key_len + 1) diff --git a/lib/tomo/shell_builder.rb b/lib/tomo/shell_builder.rb index df550e7b..e64be9ee 100644 --- a/lib/tomo/shell_builder.rb +++ b/lib/tomo/shell_builder.rb @@ -67,7 +67,7 @@ def command_to_string(*command) def shell_join(*command) return command.first.to_s if command.length == 1 - command.flatten.compact.map(&:to_s).map(&:shellescape).join(" ") + command.flatten.compact.map { |arg| arg.to_s.shellescape }.join(" ") end def cd_chdir