diff options
author | Samuel Giddins <segiddins@segiddins.me> | 2016-01-14 16:24:15 -0600 |
---|---|---|
committer | Samuel Giddins <segiddins@segiddins.me> | 2016-01-31 22:21:13 -0600 |
commit | 24951a2b41f3cf933acae57203825e6a4ce6d99a (patch) | |
tree | 863b02511f7259314fb39ae3130f3c6ea28df19c | |
parent | e85b990916f16dd9a56dbafae6503f7a48d55131 (diff) | |
download | bundler-24951a2b41f3cf933acae57203825e6a4ce6d99a.tar.gz |
[RuboCop] Fix Performance/StartWith
-rw-r--r-- | .rubocop_todo.yml | 6 | ||||
-rw-r--r-- | lib/bundler/cli/config.rb | 4 |
2 files changed, 2 insertions, 8 deletions
diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index c2c9e322e9..57a7d2e4f1 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -93,12 +93,6 @@ Performance/RedundantMerge: - 'spec/support/helpers.rb' # Offense count: 1 -# Cop supports --auto-correct. -Performance/StartWith: - Exclude: - - 'lib/bundler/cli/config.rb' - -# Offense count: 1 Performance/TimesMap: Exclude: - 'lib/bundler/worker.rb' diff --git a/lib/bundler/cli/config.rb b/lib/bundler/cli/config.rb index 2dc628b2dc..ce1be5eb4f 100644 --- a/lib/bundler/cli/config.rb +++ b/lib/bundler/cli/config.rb @@ -9,7 +9,7 @@ module Bundler @thor = thor @name = peek = args.shift @scope = "global" - return unless peek && peek =~ /^\-\-/ + return unless peek && peek.start_with?("--") @name = args.shift @scope = $' end @@ -58,7 +58,7 @@ module Bundler def new_value pathname = Pathname.new(args.join(" ")) - if name.match(/\Alocal\./) && pathname.directory? + if name.start_with?("local.") && pathname.directory? pathname.expand_path.to_s else args.join(" ") |