summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Koronen <koronen@kth.se>2015-08-08 17:19:33 +0200
committerVictor Koronen <koronen@kth.se>2015-08-14 12:29:44 +0200
commit6002eae5a0cc99035bc02356ec178568a7fe4a93 (patch)
treefea27cca1c433e17b00ac5357b866538a5665d46
parent05fb395a0f013076fb6e628cf3cdadbc4ef80fb5 (diff)
downloadbundler-6002eae5a0cc99035bc02356ec178568a7fe4a93.tar.gz
Fix Style/DeprecatedHashMethods
-rw-r--r--.rubocop_todo.yml5
-rw-r--r--lib/bundler.rb2
-rw-r--r--lib/bundler/cli/outdated.rb2
-rw-r--r--lib/bundler/dsl.rb2
4 files changed, 3 insertions, 8 deletions
diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml
index bf7b724814..74bafde3ac 100644
--- a/.rubocop_todo.yml
+++ b/.rubocop_todo.yml
@@ -129,11 +129,6 @@ Style/CommandLiteral:
Style/CommentAnnotation:
Enabled: false
-# Offense count: 3
-# Cop supports --auto-correct.
-Style/DeprecatedHashMethods:
- Enabled: false
-
# Offense count: 153
Style/Documentation:
Enabled: false
diff --git a/lib/bundler.rb b/lib/bundler.rb
index c6972ddfd8..9a46dede49 100644
--- a/lib/bundler.rb
+++ b/lib/bundler.rb
@@ -261,7 +261,7 @@ module Bundler
with_original_env do
ENV["MANPATH"] = ENV["BUNDLE_ORIG_MANPATH"]
ENV.delete_if {|k, _| k[0, 7] == "BUNDLE_" }
- if ENV.has_key? "RUBYOPT"
+ if ENV.key? "RUBYOPT"
ENV["RUBYOPT"] = ENV["RUBYOPT"].sub "-rbundler/setup", ""
ENV["RUBYOPT"] = ENV["RUBYOPT"].sub "-I#{File.expand_path("..", __FILE__)}", ""
end
diff --git a/lib/bundler/cli/outdated.rb b/lib/bundler/cli/outdated.rb
index 640e4f7ca7..4c777df6e6 100644
--- a/lib/bundler/cli/outdated.rb
+++ b/lib/bundler/cli/outdated.rb
@@ -32,7 +32,7 @@ module Bundler
out_count = 0
# Loop through the current specs
- gemfile_specs, dependency_specs = current_specs.partition {|spec| current_dependencies.has_key? spec.name }
+ gemfile_specs, dependency_specs = current_specs.partition {|spec| current_dependencies.key? spec.name }
[gemfile_specs.sort_by(&:name), dependency_specs.sort_by(&:name)].flatten.each do |current_spec|
next if !gems.empty? && !gems.include?(current_spec.name)
diff --git a/lib/bundler/dsl.rb b/lib/bundler/dsl.rb
index 5d7dfddf22..9df01fb905 100644
--- a/lib/bundler/dsl.rb
+++ b/lib/bundler/dsl.rb
@@ -280,7 +280,7 @@ module Bundler
end
# Save sources passed in a key
- if opts.has_key?("source")
+ if opts.key?("source")
source = normalize_source(opts["source"])
opts["source"] = @sources.add_rubygems_source("remotes" => source)
end