summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSHIBATA Hiroshi <hsbt@ruby-lang.org>2018-10-17 16:01:39 +0900
committerSHIBATA Hiroshi <hsbt@ruby-lang.org>2018-10-20 20:01:01 +0900
commit6d2c0d2a199564a75612eb492adec5e27eaa923d (patch)
tree34f0489741d1d8b3d4164a1ebdf7f2a64984b99f
parent96f24244c7bad1b78fdf60edcad7f9a092dea6fa (diff)
downloadbundler-6d2c0d2a199564a75612eb492adec5e27eaa923d.tar.gz
rubocop -a
-rw-r--r--lib/bundler/shared_helpers.rb6
-rw-r--r--spec/bundler/cli_spec.rb2
-rw-r--r--spec/bundler/ssl_certs/certificate_manager_spec.rb5
-rw-r--r--spec/spec_helper.rb12
-rw-r--r--spec/support/helpers.rb2
-rw-r--r--spec/support/path.rb3
6 files changed, 14 insertions, 16 deletions
diff --git a/lib/bundler/shared_helpers.rb b/lib/bundler/shared_helpers.rb
index 9d5684aeaf..e09e5e8b74 100644
--- a/lib/bundler/shared_helpers.rb
+++ b/lib/bundler/shared_helpers.rb
@@ -275,11 +275,11 @@ module Bundler
until !File.directory?(current) || current == previous
if ENV["BUNDLE_SPEC_RUN"]
# avoid stepping above the tmp directory when testing
- if !!(ENV["BUNDLE_RUBY"] && ENV["BUNDLE_GEM"])
+ gemspec = if ENV["BUNDLE_RUBY"] && ENV["BUNDLE_GEM"]
# for Ruby Core
- gemspec = "lib/bundler.gemspec"
+ "lib/bundler.gemspec"
else
- gemspec = "bundler.gemspec"
+ "bundler.gemspec"
end
# avoid stepping above the tmp directory when testing
diff --git a/spec/bundler/cli_spec.rb b/spec/bundler/cli_spec.rb
index c82383cabf..c82d46587e 100644
--- a/spec/bundler/cli_spec.rb
+++ b/spec/bundler/cli_spec.rb
@@ -15,7 +15,7 @@ RSpec.describe "bundle executable" do
it "looks for a binary and executes it if it's named bundler-<task>" do
File.open(tmp("bundler-testtasks"), "w", 0o755) do |f|
- ruby = ENV['BUNDLE_RUBY'] || "/usr/bin/env ruby"
+ ruby = ENV["BUNDLE_RUBY"] || "/usr/bin/env ruby"
f.puts "#!#{ruby}\nputs 'Hello, world'\n"
end
diff --git a/spec/bundler/ssl_certs/certificate_manager_spec.rb b/spec/bundler/ssl_certs/certificate_manager_spec.rb
index d1ec08bdc4..4250bfc497 100644
--- a/spec/bundler/ssl_certs/certificate_manager_spec.rb
+++ b/spec/bundler/ssl_certs/certificate_manager_spec.rb
@@ -12,18 +12,17 @@ RSpec.describe Bundler::SSLCerts::CertificateManager do
# Pretend bundler root is rubygems root
before do
# Backing up rubygems ceriticates
- FileUtils.mv(rubygems_certs_dir, rubygems_certs_dir + ".back") if !!(ENV["BUNDLE_RUBY"] && ENV["BUNDLE_GEM"])
+ FileUtils.mv(rubygems_certs_dir, rubygems_certs_dir + ".back") if ENV["BUNDLE_RUBY"] && ENV["BUNDLE_GEM"]
FileUtils.mkdir_p(rubygems_certs_dir)
FileUtils.touch(stub_cert)
end
after do
- rubygems_dir = File.join(root.to_s, "lib", "rubygems")
FileUtils.rm_rf(rubygems_certs_dir)
# Restore rubygems certificates
- FileUtils.mv(rubygems_certs_dir + ".back", rubygems_certs_dir) if !!(ENV["BUNDLE_RUBY"] && ENV["BUNDLE_GEM"])
+ FileUtils.mv(rubygems_certs_dir + ".back", rubygems_certs_dir) if ENV["BUNDLE_RUBY"] && ENV["BUNDLE_GEM"]
end
describe "#update_from" do
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index 45a3bcbf89..711bf576a9 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -53,7 +53,7 @@ ENV["THOR_COLUMNS"] = "10000"
Spec::CodeClimate.setup
module Gem
- def self.ruby= ruby
+ def self.ruby=(ruby)
@ruby = ruby
end
end
@@ -99,7 +99,7 @@ RSpec.configure do |config|
config.filter_run_excluding :git => LessThanProc.with(git_version)
config.filter_run_excluding :rubygems_master => (ENV["RGV"] != "master")
config.filter_run_excluding :bundler => LessThanProc.with(Bundler::VERSION.split(".")[0, 2].join("."))
- config.filter_run_excluding :ruby_repo => !!(ENV["BUNDLE_RUBY"] && ENV["BUNDLE_GEM"])
+ config.filter_run_excluding :ruby_repo => (ENV["BUNDLE_RUBY"] && ENV["BUNDLE_GEM"])
config.filter_run_when_matching :focus unless ENV["CI"]
@@ -115,9 +115,9 @@ RSpec.configure do |config|
end
config.before :suite do
- if ENV['BUNDLE_RUBY']
+ if ENV["BUNDLE_RUBY"]
@orig_ruby = Gem.ruby
- Gem.ruby = ENV['BUNDLE_RUBY']
+ Gem.ruby = ENV["BUNDLE_RUBY"]
end
end
@@ -147,8 +147,6 @@ RSpec.configure do |config|
end
config.after :suite do
- if ENV['BUNDLE_RUBY']
- Gem.ruby = @orig_ruby
- end
+ Gem.ruby = @orig_ruby if ENV["BUNDLE_RUBY"]
end
end
diff --git a/spec/support/helpers.rb b/spec/support/helpers.rb
index e5ff90785e..e3b57c1a31 100644
--- a/spec/support/helpers.rb
+++ b/spec/support/helpers.rb
@@ -212,7 +212,7 @@ module Spec
args = args.gsub(/(?=")/, "\\")
args = %("#{args}")
end
- gem = ENV['BUNDLE_GEM'] || "#{Gem.ruby} -rrubygems -S gem --backtrace"
+ gem = ENV["BUNDLE_GEM"] || "#{Gem.ruby} -rrubygems -S gem --backtrace"
sys_exec("#{gem} #{command} #{args}")
end
bang :gem_command
diff --git a/spec/support/path.rb b/spec/support/path.rb
index d57a2282f0..1a3444f365 100644
--- a/spec/support/path.rb
+++ b/spec/support/path.rb
@@ -112,7 +112,8 @@ module Spec
extend self
- private
+ private
+
def for_ruby_core?
# avoid to wornings
@for_ruby_core ||= nil