diff options
author | Erick Sasse <esasse@gmail.com> | 2015-07-20 23:07:49 -0300 |
---|---|---|
committer | Erick Sasse <esasse@gmail.com> | 2015-07-20 23:07:49 -0300 |
commit | df8ca477b7e8cc0da29ea241a50f5551855b9e70 (patch) | |
tree | 8a6430699a8c8124c91f9e9735e6d6f005b08a1f | |
parent | e41b513444bb599a3b691f0fa10adff4a2ac199f (diff) | |
download | bundler-df8ca477b7e8cc0da29ea241a50f5551855b9e70.tar.gz |
Fix Lint/UnusedBlockArgument
-rw-r--r-- | .rubocop_todo.yml | 5 | ||||
-rw-r--r-- | Rakefile | 4 | ||||
-rw-r--r-- | lib/bundler/fetcher.rb | 2 | ||||
-rw-r--r-- | lib/bundler/gem_helper.rb | 4 | ||||
-rw-r--r-- | lib/bundler/lockfile_parser.rb | 2 | ||||
-rw-r--r-- | lib/bundler/resolver.rb | 2 | ||||
-rw-r--r-- | lib/bundler/rubygems_integration.rb | 4 | ||||
-rw-r--r-- | lib/bundler/source/git/git_proxy.rb | 4 | ||||
-rw-r--r-- | spec/commands/check_spec.rb | 2 | ||||
-rw-r--r-- | spec/support/helpers.rb | 2 |
10 files changed, 13 insertions, 18 deletions
diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 7617717b22..fc68e3065f 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -25,11 +25,6 @@ Lint/NonLocalExitFromIterator: Lint/RescueException: Enabled: false -# Offense count: 15 -# Cop supports --auto-correct. -Lint/UnusedBlockArgument: - Enabled: false - # Offense count: 38 # Cop supports --auto-correct. Lint/UnusedMethodArgument: @@ -47,7 +47,7 @@ namespace :molinillo do rm_r files end - task :update, [:tag] => [] do |t, args| + task :update, [:tag] => [] do |_, args| tag = args[:tag] Dir.chdir "lib/bundler/vendor" do rm_rf "molinillo" @@ -72,7 +72,7 @@ namespace :thor do rm_r files end - task :update, [:tag] => [] do |t, args| + task :update, [:tag] => [] do |_, args| tag = args[:tag] Dir.chdir "lib/bundler/vendor" do rm_rf "thor" diff --git a/lib/bundler/fetcher.rb b/lib/bundler/fetcher.rb index 4540d3e7e1..1ef8772150 100644 --- a/lib/bundler/fetcher.rb +++ b/lib/bundler/fetcher.rb @@ -192,7 +192,7 @@ module Bundler "CI_NAME" => ENV["CI_NAME"], "CI" => "ci" } - env_cis.find_all {|env, ci| ENV[env] }.map {|env, ci| ci } + env_cis.find_all {|env, _| ENV[env] }.map {|_, ci| ci } end def connection diff --git a/lib/bundler/gem_helper.rb b/lib/bundler/gem_helper.rb index b7b9b7b203..28df1493a4 100644 --- a/lib/bundler/gem_helper.rb +++ b/lib/bundler/gem_helper.rb @@ -59,7 +59,7 @@ module Bundler guard_clean end - task "release:source_control_push", [:remote] do |t, args| + task "release:source_control_push", [:remote] do |_, args| tag_version { git_push(args[:remote]) } unless already_tagged? end @@ -72,7 +72,7 @@ module Bundler def build_gem file_name = nil - sh("gem build -V '#{spec_path}'") { |out, code| + sh("gem build -V '#{spec_path}'") { file_name = File.basename(built_gem_path) FileUtils.mkdir_p(File.join(base, "pkg")) FileUtils.mv(built_gem_path, "pkg") diff --git a/lib/bundler/lockfile_parser.rb b/lib/bundler/lockfile_parser.rb index f0d591a4d7..e44f9420da 100644 --- a/lib/bundler/lockfile_parser.rb +++ b/lib/bundler/lockfile_parser.rb @@ -143,7 +143,7 @@ module Bundler dep = Bundler::Dependency.new(name, version) if pinned && dep.name != "bundler" - spec = @specs.find {|k, v| v.name == dep.name } + spec = @specs.find {|_, v| v.name == dep.name } dep.source = spec.last.source if spec # Path sources need to know what the default name / version diff --git a/lib/bundler/resolver.rb b/lib/bundler/resolver.rb index 6e04326a9f..14a33f5e46 100644 --- a/lib/bundler/resolver.rb +++ b/lib/bundler/resolver.rb @@ -143,7 +143,7 @@ module Bundler end def platforms_for_dependency_named(dependency) - __dependencies.select {|p, deps| deps.map(&:name).include? dependency }.keys + __dependencies.select {|_, deps| deps.map(&:name).include? dependency }.keys end private diff --git a/lib/bundler/rubygems_integration.rb b/lib/bundler/rubygems_integration.rb index efd00a49b5..3d9ee2986e 100644 --- a/lib/bundler/rubygems_integration.rb +++ b/lib/bundler/rubygems_integration.rb @@ -151,7 +151,7 @@ module Bundler # RubyGems 2.2+ can put binary extension into dedicated folders, # therefore use RubyGems facilities to obtain their load paths. if Gem::Specification.method_defined? :full_require_paths - loaded_gem_paths = Gem.loaded_specs.map {|n, s| s.full_require_paths } + loaded_gem_paths = Gem.loaded_specs.map {|_, s| s.full_require_paths } loaded_gem_paths.flatten else $LOAD_PATH.select do |p| @@ -391,7 +391,7 @@ module Bundler # This backport fixes the marshaling of @segments. def backport_yaml_initialize - redefine_method(Gem::Version, :yaml_initialize) do |tag, map| + redefine_method(Gem::Version, :yaml_initialize) do |_, map| @version = map["version"] @segments = nil @hash = nil diff --git a/lib/bundler/source/git/git_proxy.rb b/lib/bundler/source/git/git_proxy.rb index f044721576..cc78e8c367 100644 --- a/lib/bundler/source/git/git_proxy.rb +++ b/lib/bundler/source/git/git_proxy.rb @@ -140,11 +140,11 @@ module Bundler if Bundler::WINDOWS # Windows quoting requires double quotes only, with double quotes # inside the string escaped by being doubled. - '"' + uri.gsub('"') {|s| '""' } + '"' + '"' + uri.gsub('"') { '""' } + '"' else # Bash requires single quoted strings, with the single quotes escaped # by ending the string, escaping the quote, and restarting the string. - "'" + uri.gsub("'") {|s| "'\\''" } + "'" + "'" + uri.gsub("'") { "'\\''" } + "'" end end diff --git a/spec/commands/check_spec.rb b/spec/commands/check_spec.rb index 1bd697f8aa..eb74bd809a 100644 --- a/spec/commands/check_spec.rb +++ b/spec/commands/check_spec.rb @@ -207,7 +207,7 @@ describe "bundle check" do simulate_new_machine bundle "check" last_out = out - 3.times do |i| + 3.times do bundle :check expect(out).to eq(last_out) expect(err).to be_empty diff --git a/spec/support/helpers.rb b/spec/support/helpers.rb index 23823b4bbf..58121f403a 100644 --- a/spec/support/helpers.rb +++ b/spec/support/helpers.rb @@ -365,7 +365,7 @@ module Spec ENV[k] = v end block.call if block_given? - env_hash.each do |k, v| + env_hash.each do |k, _| ENV[k] = current_values[k] end end |