diff options
author | Andre Arko <andre@arko.net> | 2015-08-01 17:47:04 -0700 |
---|---|---|
committer | Andre Arko <andre@arko.net> | 2015-08-01 17:47:04 -0700 |
commit | 4fc884f04e2d7e7f98ab52620d8a259496cc92e1 (patch) | |
tree | 305f1a060c61a3538053783700862d094c9b035e | |
parent | a5fb3671252eb20c0e83d6fc25a1386daaf6ffbf (diff) | |
parent | 7f31d8635908e15b5a2abfce8fb9873c0c16695b (diff) | |
download | bundler-4fc884f04e2d7e7f98ab52620d8a259496cc92e1.tar.gz |
Merge pull request #3889 from esasse/rubocop-fix
Fix Style/WordArray
-rw-r--r-- | .rubocop_todo.yml | 6 | ||||
-rw-r--r-- | Rakefile | 4 | ||||
-rw-r--r-- | lib/bundler/dsl.rb | 2 | ||||
-rw-r--r-- | spec/bundler/dsl_spec.rb | 4 | ||||
-rw-r--r-- | spec/bundler/fetcher_spec.rb | 2 | ||||
-rw-r--r-- | spec/runtime/require_spec.rb | 4 | ||||
-rw-r--r-- | spec/runtime/setup_spec.rb | 2 | ||||
-rw-r--r-- | spec/support/artifice/endpoint_creds_diff_host.rb | 2 |
8 files changed, 10 insertions, 16 deletions
diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index aaa30dad84..89dfe6e09c 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -394,9 +394,3 @@ Style/WhileUntilDo: # Configuration parameters: MaxLineLength. Style/WhileUntilModifier: Enabled: false - -# Offense count: 9 -# Cop supports --auto-correct. -# Configuration parameters: WordRegex. -Style/WordArray: - MinSize: 3 @@ -156,14 +156,14 @@ begin end desc "Run the real-world spec suite (requires internet)" - task :realworld => ["set_realworld", "spec"] + task :realworld => %w[set_realworld spec] task :set_realworld do ENV["BUNDLER_REALWORLD_TESTS"] = "1" end desc "Run the spec suite with the sudo tests" - task :sudo => ["set_sudo", "spec", "clean_sudo"] + task :sudo => %w[set_sudo spec clean_sudo] task :set_sudo do ENV["BUNDLER_SUDO_TESTS"] = "1" diff --git a/lib/bundler/dsl.rb b/lib/bundler/dsl.rb index 03cec2d366..7d66b5e621 100644 --- a/lib/bundler/dsl.rb +++ b/lib/bundler/dsl.rb @@ -290,7 +290,7 @@ module Bundler opts["git"] = @git_sources[git_name].call(opts[git_name]) end - ["git", "path"].each do |type| + %w[git path].each do |type| if param = opts[type] if version.first && version.first =~ /^\s*=?\s*(\d[^\s]*)\s*$/ options = opts.merge("name" => name, "version" => $1) diff --git a/spec/bundler/dsl_spec.rb b/spec/bundler/dsl_spec.rb index 3e8587fe9c..169843bbe5 100644 --- a/spec/bundler/dsl_spec.rb +++ b/spec/bundler/dsl_spec.rb @@ -145,7 +145,7 @@ describe Bundler::Dsl do # end describe "#git" do it "from a single repo" do - rails_gems = ["railties", "action_pack", "active_model"] + rails_gems = %w[railties action_pack active_model] subject.git "https://github.com/rails/rails.git" do rails_gems.each {|rails_gem| subject.send :gem, rails_gem } end @@ -160,7 +160,7 @@ describe Bundler::Dsl do # end describe "#github" do it "from github" do - spree_gems = ["spree_core", "spree_api", "spree_backend"] + spree_gems = %w[spree_core spree_api spree_backend] subject.github "spree" do spree_gems.each {|spree_gem| subject.send :gem, spree_gem } end diff --git a/spec/bundler/fetcher_spec.rb b/spec/bundler/fetcher_spec.rb index 4e9a8d18e9..1637082886 100644 --- a/spec/bundler/fetcher_spec.rb +++ b/spec/bundler/fetcher_spec.rb @@ -10,7 +10,7 @@ describe Bundler::Fetcher do describe "#user_agent" do it "builds user_agent with current ruby version and Bundler settings" do - allow(Bundler.settings).to receive(:all).and_return(["foo", "bar"]) + allow(Bundler.settings).to receive(:all).and_return(%w[foo bar]) expect(fetcher.user_agent).to match(/bundler\/(\d.)/) expect(fetcher.user_agent).to match(/rubygems\/(\d.)/) expect(fetcher.user_agent).to match(/ruby\/(\d.)/) diff --git a/spec/runtime/require_spec.rb b/spec/runtime/require_spec.rb index cf75fe08d3..f68a95312c 100644 --- a/spec/runtime/require_spec.rb +++ b/spec/runtime/require_spec.rb @@ -39,7 +39,7 @@ describe "Bundler.require" do gemfile <<-G path "#{lib_path}" - gem "one", :group => :bar, :require => %w(baz qux) + gem "one", :group => :bar, :require => %w[baz qux] gem "two" gem "three", :group => :not gem "four", :require => false @@ -73,7 +73,7 @@ describe "Bundler.require" do # required in resolver order instead of gemfile order run("Bundler.require(:not)") - expect(out.split("\n").sort).to eq(["seven", "three"]) + expect(out.split("\n").sort).to eq(%w(seven three)) # test require: true run "Bundler.require(:require_true)" diff --git a/spec/runtime/setup_spec.rb b/spec/runtime/setup_spec.rb index 9dbd4ff86a..a123aff673 100644 --- a/spec/runtime/setup_spec.rb +++ b/spec/runtime/setup_spec.rb @@ -630,7 +630,7 @@ describe "Bundler.setup" do build_gem("requirepaths") do |s| s.write("lib/rq.rb", "puts 'yay'") s.write("src/rq.rb", "puts 'nooo'") - s.require_paths = ["lib", "src"] + s.require_paths = %w[lib src] end end diff --git a/spec/support/artifice/endpoint_creds_diff_host.rb b/spec/support/artifice/endpoint_creds_diff_host.rb index b97a19435d..a0f08a0efc 100644 --- a/spec/support/artifice/endpoint_creds_diff_host.rb +++ b/spec/support/artifice/endpoint_creds_diff_host.rb @@ -9,7 +9,7 @@ class EndpointCredsDiffHost < Endpoint end def authorized? - auth.provided? && auth.basic? && auth.credentials && auth.credentials == ["user", "pass"] + auth.provided? && auth.basic? && auth.credentials && auth.credentials == %w[user pass] end def protected! |