aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErick Sasse <esasse@gmail.com>2015-07-28 20:48:28 -0300
committerErick Sasse <esasse@gmail.com>2015-07-28 20:48:28 -0300
commit8583433bc21a94849ece2008fff345b6b883f590 (patch)
tree26d45c87f20b9e1c3b6258121124cf3a33da2d65
parent58b6757f601b3660ca6258b5afca0798ff1f7aea (diff)
downloadbundler-8583433bc21a94849ece2008fff345b6b883f590.tar.gz
Fix Style/WordArray
-rw-r--r--.rubocop_todo.yml6
-rw-r--r--Rakefile4
-rw-r--r--lib/bundler/dsl.rb2
-rw-r--r--spec/bundler/dsl_spec.rb4
-rw-r--r--spec/bundler/fetcher_spec.rb2
-rw-r--r--spec/runtime/require_spec.rb2
-rw-r--r--spec/runtime/setup_spec.rb2
-rw-r--r--spec/support/artifice/endpoint_creds_diff_host.rb2
8 files changed, 9 insertions, 15 deletions
diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml
index aaa30dad..89dfe6e0 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
diff --git a/Rakefile b/Rakefile
index b7898f95..d5f3bbda 100644
--- a/Rakefile
+++ b/Rakefile
@@ -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 03cec2d3..b618eae5 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 3e8587fe..97fd5993 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 4e9a8d18..bb0bf9d6 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 cf75fe08..e07d1bf2 100644
--- a/spec/runtime/require_spec.rb
+++ b/spec/runtime/require_spec.rb
@@ -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 9dbd4ff8..e017edb1 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 b97a1943..0c10242d 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!