aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuel Giddins <segiddins@segiddins.me>2016-07-14 22:20:40 -0500
committerSamuel Giddins <segiddins@segiddins.me>2016-07-20 09:35:41 -0500
commitc476ee2672b506f7f8909cd44ba4111da4c2b5c2 (patch)
treebe3480874093648d116e71976ef869bbebe63112
parentaf80780f713f8f798d67d1511c2817871c60f125 (diff)
downloadbundler-c476ee2672b506f7f8909cd44ba4111da4c2b5c2.tar.gz
[RuboCop] Update to 0.41.2
-rw-r--r--.rubocop_todo.yml37
-rw-r--r--Rakefile4
-rwxr-xr-xbin/rubocop2
-rw-r--r--lib/bundler/cli.rb6
-rw-r--r--lib/bundler/cli/binstubs.rb3
-rw-r--r--lib/bundler/cli/gem.rb2
-rw-r--r--lib/bundler/dsl.rb2
-rw-r--r--lib/bundler/gem_helper.rb2
-rw-r--r--lib/bundler/gem_version_promoter.rb9
-rw-r--r--lib/bundler/installer.rb4
-rw-r--r--lib/bundler/settings.rb7
-rw-r--r--lib/bundler/source/git/git_proxy.rb2
-rw-r--r--spec/bundler/bundler_spec.rb2
-rw-r--r--spec/bundler/cli_spec.rb2
-rw-r--r--spec/bundler/endpoint_specification_spec.rb6
-rw-r--r--spec/bundler/fetcher/dependency_spec.rb9
-rw-r--r--spec/bundler/gem_version_promoter_spec.rb30
-rw-r--r--spec/bundler/settings_spec.rb3
-rw-r--r--spec/bundler/shared_helpers_spec.rb15
-rw-r--r--spec/bundler/uri_credentials_filter_spec.rb3
-rw-r--r--spec/commands/binstubs_spec.rb2
-rw-r--r--spec/commands/clean_spec.rb4
-rw-r--r--spec/commands/exec_spec.rb6
-rw-r--r--spec/commands/help_spec.rb2
-rw-r--r--spec/commands/install_spec.rb2
-rw-r--r--spec/install/gems/compact_index_spec.rb3
-rw-r--r--spec/install/gems/dependency_api_spec.rb6
-rw-r--r--spec/other/major_deprecation_spec.rb3
-rw-r--r--spec/support/helpers.rb8
29 files changed, 107 insertions, 79 deletions
diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml
index 686c1898..4761c787 100644
--- a/.rubocop_todo.yml
+++ b/.rubocop_todo.yml
@@ -1,6 +1,6 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
-# on 2016-03-29 17:34:30 -0500 using RuboCop version 0.39.0.
+# on 2016-07-14 22:16:31 -0500 using RuboCop version 0.41.2.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
@@ -52,21 +52,17 @@ Lint/UselessAssignment:
- 'lib/bundler/index.rb'
- 'lib/bundler/installer.rb'
-# Offense count: 1331
+# Offense count: 1629
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes.
# URISchemes: http, https
Metrics/LineLength:
Max: 207
-# Offense count: 2
+# Offense count: 3
# Configuration parameters: CountKeywordArgs.
Metrics/ParameterLists:
Max: 6
-# Offense count: 55
-Metrics/PerceivedComplexity:
- Max: 51
-
# Offense count: 6
# Cop supports --auto-correct.
Performance/RedundantBlockCall:
@@ -104,7 +100,7 @@ Style/CaseEquality:
- 'lib/bundler/match_platform.rb'
- 'lib/bundler/rubygems_ext.rb'
-# Offense count: 22
+# Offense count: 23
# Configuration parameters: EnforcedStyle, SupportedStyles.
# SupportedStyles: nested, compact
Style/ClassAndModuleChildren:
@@ -127,7 +123,7 @@ Style/ConditionalAssignment:
- 'lib/bundler/source/git.rb'
- 'lib/bundler/source/rubygems.rb'
-# Offense count: 119
+# Offense count: 138
Style/Documentation:
Enabled: false
@@ -164,32 +160,38 @@ Style/IndentArray:
EnforcedStyle: consistent
# Offense count: 2
+# Configuration parameters: EnforcedStyle, SupportedStyles.
+# SupportedStyles: module_function, extend_self
Style/ModuleFunction:
Exclude:
- 'lib/bundler/shared_helpers.rb'
- 'spec/support/path.rb'
-# Offense count: 1
+# Offense count: 3
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles, IndentationWidth.
-# SupportedStyles: aligned, indented
+# SupportedStyles: aligned, indented, indented_relative_to_receiver
Style/MultilineMethodCallIndentation:
- Enabled: false
+ Exclude:
+ - 'lib/bundler/cli/common.rb'
+ - 'spec/bundler/plugin/source_list_spec.rb'
-# Offense count: 4
+# Offense count: 3
+# Cop supports --auto-correct.
Style/NestedParenthesizedCalls:
Exclude:
- 'lib/bundler/resolver.rb'
- 'spec/commands/lock_spec.rb'
- 'spec/runtime/setup_spec.rb'
-# Offense count: 8
+# Offense count: 9
# Configuration parameters: NamePrefix, NamePrefixBlacklist, NameWhitelist.
# NamePrefix: is_, has_, have_
# NamePrefixBlacklist: is_, has_, have_
# NameWhitelist: is_a?
Style/PredicateName:
Exclude:
+ - 'spec/**/*'
- 'lib/bundler/definition.rb'
- 'lib/bundler/installer/parallel_installer.rb'
- 'lib/bundler/settings.rb'
@@ -198,6 +200,7 @@ Style/PredicateName:
- 'lib/bundler/source/path.rb'
# Offense count: 25
+# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles.
# SupportedStyles: compact, exploded
Style/RaiseArgs:
@@ -217,7 +220,7 @@ Style/SpaceAroundOperators:
Exclude:
- 'lib/bundler/retry.rb'
-# Offense count: 11
+# Offense count: 10
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyleForMultiline, SupportedStyles.
# SupportedStyles: comma, consistent_comma, no_comma
@@ -231,14 +234,12 @@ Style/TrailingCommaInLiteral:
- 'lib/bundler/ruby_version.rb'
- 'lib/bundler/similarity_detector.rb'
- 'spec/support/artifice/endpoint.rb'
- - 'spec/support/rubygems_ext.rb'
-# Offense count: 19
+# Offense count: 18
# Cop supports --auto-correct.
Style/UnneededInterpolation:
Exclude:
- 'lib/bundler/cli/config.rb'
- - 'lib/bundler/definition.rb'
- 'lib/bundler/env.rb'
- 'spec/bundler/shared_helpers_spec.rb'
- 'spec/cache/git_spec.rb'
diff --git a/Rakefile b/Rakefile
index 10914534..b47adc61 100644
--- a/Rakefile
+++ b/Rakefile
@@ -39,7 +39,7 @@ namespace :spec do
deps = Hash[BUNDLER_SPEC.development_dependencies.map do |d|
[d.name, d.requirement.to_s]
end]
- deps["rubocop"] ||= "= 0.39.0" if RUBY_VERSION >= "1.9.3" # can't go in the gemspec because of the ruby version requirement
+ deps["rubocop"] ||= "= 0.41.2" if RUBY_VERSION >= "1.9.3" # can't go in the gemspec because of the ruby version requirement
# JRuby can't build ronn or rdiscount, so we skip that
if defined?(RUBY_ENGINE) && RUBY_ENGINE == "jruby"
@@ -93,7 +93,7 @@ begin
if RUBY_VERSION >= "1.9.3"
# can't go in the gemspec because of the ruby version requirement
- gem "rubocop", "= 0.39.0"
+ gem "rubocop", "= 0.41.2"
require "rubocop/rake_task"
RuboCop::RakeTask.new
end
diff --git a/bin/rubocop b/bin/rubocop
index 9e0e1488..820e0f31 100755
--- a/bin/rubocop
+++ b/bin/rubocop
@@ -10,7 +10,7 @@ bundler_spec.dependencies.each do |dep|
gem dep.name, dep.requirement.to_s
end
-gem "rubocop", "= 0.39.0"
+gem "rubocop", "= 0.41.2"
Gem.finish_resolve if Gem.respond_to?(:finish_resolve)
diff --git a/lib/bundler/cli.rb b/lib/bundler/cli.rb
index fce7380b..30a306ec 100644
--- a/lib/bundler/cli.rb
+++ b/lib/bundler/cli.rb
@@ -43,7 +43,8 @@ module Bundler
Bundler.ui.warn(
"The RUBYGEMS_GEMDEPS environment variable is set. This enables RubyGems' " \
"experimental Gemfile mode, which may conflict with Bundler and cause unexpected errors. " \
- "To remove this warning, unset RUBYGEMS_GEMDEPS.", :wrap => true)
+ "To remove this warning, unset RUBYGEMS_GEMDEPS.", :wrap => true
+ )
end
end
@@ -72,7 +73,8 @@ module Bundler
bundle-package
bundle-update
bundle-platform
- gemfile.5)
+ gemfile.5
+ )
if manpages.include?(command)
root = File.expand_path("../man", __FILE__)
diff --git a/lib/bundler/cli/binstubs.rb b/lib/bundler/cli/binstubs.rb
index e8982e90..971d8075 100644
--- a/lib/bundler/cli/binstubs.rb
+++ b/lib/bundler/cli/binstubs.rb
@@ -24,7 +24,8 @@ module Bundler
spec = installer.specs.find {|s| s.name == gem_name }
unless spec
raise GemNotFound, Bundler::CLI::Common.gem_not_found_message(
- gem_name, Bundler.definition.specs)
+ gem_name, Bundler.definition.specs
+ )
end
if spec.name == "bundler"
diff --git a/lib/bundler/cli/gem.rb b/lib/bundler/cli/gem.rb
index 72a1880c..27f4262e 100644
--- a/lib/bundler/cli/gem.rb
+++ b/lib/bundler/cli/gem.rb
@@ -126,7 +126,7 @@ module Bundler
executables.each do |file|
path = target.join(file)
- executable = (path.stat.mode | 0111)
+ executable = (path.stat.mode | 0o111)
path.chmod(executable)
end
diff --git a/lib/bundler/dsl.rb b/lib/bundler/dsl.rb
index 58ff752f..e29924f1 100644
--- a/lib/bundler/dsl.rb
+++ b/lib/bundler/dsl.rb
@@ -522,7 +522,7 @@ The :#{name} git source is deprecated, and will be removed in Bundler 2.0. Add t
lines = contents.lines.to_a
indent = " # "
- indicator = indent.tr('#', ">")
+ indicator = indent.tr("#", ">")
first_line = (line_numer.zero?)
last_line = (line_numer == (lines.count - 1))
diff --git a/lib/bundler/gem_helper.rb b/lib/bundler/gem_helper.rb
index a38136c3..be544b4e 100644
--- a/lib/bundler/gem_helper.rb
+++ b/lib/bundler/gem_helper.rb
@@ -182,7 +182,7 @@ module Bundler
end
def gem_push?
- ! %w(n no nil false off 0).include?(ENV["gem_push"].to_s.downcase)
+ !%w(n no nil false off 0).include?(ENV["gem_push"].to_s.downcase)
end
end
end
diff --git a/lib/bundler/gem_version_promoter.rb b/lib/bundler/gem_version_promoter.rb
index c2e75adb..d60d823d 100644
--- a/lib/bundler/gem_version_promoter.rb
+++ b/lib/bundler/gem_version_promoter.rb
@@ -120,14 +120,13 @@ module Bundler
result = spec_groups.sort do |a, b|
@a_ver = a.version
@b_ver = b.version
- case
- when major?
+ if major?
@a_ver <=> @b_ver
- when either_version_older_than_locked
+ elsif either_version_older_than_locked
@a_ver <=> @b_ver
- when segments_do_not_match(:major)
+ elsif segments_do_not_match(:major)
@b_ver <=> @a_ver
- when !minor? && segments_do_not_match(:minor)
+ elsif !minor? && segments_do_not_match(:minor)
@b_ver <=> @a_ver
else
@a_ver <=> @b_ver
diff --git a/lib/bundler/installer.rb b/lib/bundler/installer.rb
index c19b2edb..3d51505b 100644
--- a/lib/bundler/installer.rb
+++ b/lib/bundler/installer.rb
@@ -108,7 +108,7 @@ module Bundler
next
end
- File.open(binstub_path, "w", 0777 & ~File.umask) do |f|
+ File.open(binstub_path, "w", 0o777 & ~File.umask) do |f|
f.puts ERB.new(template, nil, "-").result(binding)
end
end
@@ -138,7 +138,7 @@ module Bundler
spec.executables.each do |executable|
next if executable == "bundle"
executable_path = executable_path = Pathname(spec.full_gem_path).join(spec.bindir, executable).relative_path_from(bin_path)
- File.open "#{bin_path}/#{executable}", "w", 0755 do |f|
+ File.open "#{bin_path}/#{executable}", "w", 0o755 do |f|
f.puts ERB.new(template, nil, "-").result(binding)
end
end
diff --git a/lib/bundler/settings.rb b/lib/bundler/settings.rb
index ff0b1460..d24b66f3 100644
--- a/lib/bundler/settings.rb
+++ b/lib/bundler/settings.rb
@@ -44,12 +44,11 @@ module Bundler
key = key_for(name)
value = (@local_config[key] || ENV[key] || @global_config[key] || DEFAULT_CONFIG[name])
- case
- when value.nil?
+ if value.nil?
nil
- when is_bool(name) || value == "false"
+ elsif is_bool(name) || value == "false"
to_bool(value)
- when is_num(name)
+ elsif is_num(name)
value.to_i
else
value
diff --git a/lib/bundler/source/git/git_proxy.rb b/lib/bundler/source/git/git_proxy.rb
index 84d7fee6..d953cd0a 100644
--- a/lib/bundler/source/git/git_proxy.rb
+++ b/lib/bundler/source/git/git_proxy.rb
@@ -110,7 +110,7 @@ module Bundler
FileUtils.rm_rf(p)
end
git_retry %(clone --no-checkout --quiet "#{path}" "#{destination}")
- File.chmod(((File.stat(destination).mode | 0777) & ~File.umask), destination)
+ File.chmod(((File.stat(destination).mode | 0o777) & ~File.umask), destination)
rescue Errno::EEXIST => e
file_path = e.message[%r{.*?(/.*)}, 1]
raise GitError, "Bundler could not install a gem because it needs to " \
diff --git a/spec/bundler/bundler_spec.rb b/spec/bundler/bundler_spec.rb
index 34f559e7..8708dc7c 100644
--- a/spec/bundler/bundler_spec.rb
+++ b/spec/bundler/bundler_spec.rb
@@ -106,7 +106,7 @@ describe Bundler do
describe "#which" do
let(:executable) { "executable" }
- let(:path) { %w(/a /b c ../d "/e") }
+ let(:path) { %w(/a /b c ../d /e) }
let(:expected) { "executable" }
before do
diff --git a/spec/bundler/cli_spec.rb b/spec/bundler/cli_spec.rb
index 2237ee97..e0490248 100644
--- a/spec/bundler/cli_spec.rb
+++ b/spec/bundler/cli_spec.rb
@@ -14,7 +14,7 @@ describe "bundle executable" do
end
it "looks for a binary and executes it if it's named bundler-<task>" do
- File.open(tmp("bundler-testtasks"), "w", 0755) do |f|
+ File.open(tmp("bundler-testtasks"), "w", 0o755) do |f|
f.puts "#!/usr/bin/env ruby\nputs 'Hello, world'\n"
end
diff --git a/spec/bundler/endpoint_specification_spec.rb b/spec/bundler/endpoint_specification_spec.rb
index cdf81cd0..6718b249 100644
--- a/spec/bundler/endpoint_specification_spec.rb
+++ b/spec/bundler/endpoint_specification_spec.rb
@@ -29,7 +29,8 @@ describe Bundler::EndpointSpecification do
it "should raise the original error" do
expect { subject.send(:build_dependency, name, [requirement1, requirement2]) }.to raise_error(
- ArgumentError, "Some error occurred")
+ ArgumentError, "Some error occurred"
+ )
end
end
@@ -44,7 +45,8 @@ describe Bundler::EndpointSpecification do
it "should raise a Bundler::GemspecError with invalid gemspec message" do
expect { subject.send(:build_dependency, name, [requirement1, requirement2]) }.to raise_error(
- Bundler::GemspecError, /Unfortunately, the gem foo \(1\.0\.0\) has an invalid gemspec/)
+ Bundler::GemspecError, /Unfortunately, the gem foo \(1\.0\.0\) has an invalid gemspec/
+ )
end
end
end
diff --git a/spec/bundler/fetcher/dependency_spec.rb b/spec/bundler/fetcher/dependency_spec.rb
index b11bcdcd..bf7749d0 100644
--- a/spec/bundler/fetcher/dependency_spec.rb
+++ b/spec/bundler/fetcher/dependency_spec.rb
@@ -201,7 +201,8 @@ describe Bundler::Fetcher::Dependency do
it "should log the query list at debug level" do
expect(Bundler).to receive_message_chain(:ui, :debug).with(
- "Query Gemcutter Dependency Endpoint API: foo,bar,bundler,rubocop")
+ "Query Gemcutter Dependency Endpoint API: foo,bar,bundler,rubocop"
+ )
subject.dependency_specs(gem_names)
end
@@ -267,7 +268,8 @@ describe Bundler::Fetcher::Dependency do
it "should return an api calling uri with the gems in the query" do
expect(subject.dependency_api_uri(gem_names).to_s).to eq(
- "http://gem-api.com/api/v1/dependencies?gems=foo%2Cbar%2Cbundler%2Crubocop")
+ "http://gem-api.com/api/v1/dependencies?gems=foo%2Cbar%2Cbundler%2Crubocop"
+ )
end
end
@@ -278,7 +280,8 @@ describe Bundler::Fetcher::Dependency do
it "should return an api calling uri with no query" do
expect(subject.dependency_api_uri(gem_names).to_s).to eq(
- "http://gem-api.com/api/v1/dependencies")
+ "http://gem-api.com/api/v1/dependencies"
+ )
end
end
end
diff --git a/spec/bundler/gem_version_promoter_spec.rb b/spec/bundler/gem_version_promoter_spec.rb
index 5cbc74bc..9e5a7bb5 100644
--- a/spec/bundler/gem_version_promoter_spec.rb
+++ b/spec/bundler/gem_version_promoter_spec.rb
@@ -45,7 +45,8 @@ describe Bundler::GemVersionPromoter do
keep_locked(:level => :patch)
res = @gvp.filter_dep_specs(
build_spec_group("foo", %w(1.7.8 1.7.9 1.8.0)),
- build_spec("foo", "1.7.8").first)
+ build_spec("foo", "1.7.8").first
+ )
expect(versions(res)).to eq %w(1.7.9 1.7.8)
end
@@ -53,7 +54,8 @@ describe Bundler::GemVersionPromoter do
unlocking(:level => :patch)
res = @gvp.filter_dep_specs(
build_spec_group("foo", %w(1.7.8 1.7.9 1.8.0)),
- build_spec("foo", "1.7.8").first)
+ build_spec("foo", "1.7.8").first
+ )
expect(versions(res)).to eq %w(1.7.8 1.7.9)
end
@@ -61,7 +63,8 @@ describe Bundler::GemVersionPromoter do
unlocking(:level => :patch)
res = @gvp.filter_dep_specs(
build_spec_group("foo", %w(1.7.9 1.8.0 2.0.0)),
- build_spec("foo", "1.7.9").first)
+ build_spec("foo", "1.7.9").first
+ )
expect(versions(res)).to eq %w(1.7.9)
end
end
@@ -71,7 +74,8 @@ describe Bundler::GemVersionPromoter do
unlocking(:level => :minor)
res = @gvp.filter_dep_specs(
build_spec_group("foo", %w(0.2.0 0.3.0 0.3.1 0.9.0 1.0.0 2.0.0 2.0.1)),
- build_spec("foo", "0.2.0").first)
+ build_spec("foo", "0.2.0").first
+ )
expect(versions(res)).to eq %w(0.2.0 0.3.0 0.3.1 0.9.0)
end
@@ -79,7 +83,8 @@ describe Bundler::GemVersionPromoter do
keep_locked(:level => :minor)
res = @gvp.filter_dep_specs(
build_spec_group("foo", %w(0.2.0 0.3.0 0.3.1 0.9.0 1.0.0 2.0.0 2.0.1)),
- build_spec("foo", "0.2.0").first)
+ build_spec("foo", "0.2.0").first
+ )
expect(versions(res)).to eq %w(0.3.0 0.3.1 0.9.0 0.2.0)
end
end
@@ -89,7 +94,8 @@ describe Bundler::GemVersionPromoter do
keep_locked(:level => :patch)
res = @gvp.sort_dep_specs(
build_spec_group("foo", %w(1.5.4 1.6.5 1.7.6 1.7.7 1.7.8 1.7.9 1.8.0 1.8.1 2.0.0 2.0.1)),
- build_spec("foo", "1.7.7").first)
+ build_spec("foo", "1.7.7").first
+ )
expect(versions(res)).to eq %w(1.5.4 1.6.5 1.7.6 2.0.0 2.0.1 1.8.0 1.8.1 1.7.8 1.7.9 1.7.7)
end
@@ -97,7 +103,8 @@ describe Bundler::GemVersionPromoter do
unlocking(:level => :patch)
res = @gvp.sort_dep_specs(
build_spec_group("foo", %w(1.7.7 1.7.8 1.7.9 1.8.0)),
- build_spec("foo", "1.7.8").first)
+ build_spec("foo", "1.7.8").first
+ )
expect(versions(res)).to eq %w(1.7.7 1.8.0 1.7.8 1.7.9)
end
@@ -105,7 +112,8 @@ describe Bundler::GemVersionPromoter do
unlocking(:level => :patch)
res = @gvp.sort_dep_specs(
build_spec_group("foo", %w(1.7.7 1.7.8 1.7.9 1.7.15 1.8.0)),
- build_spec("foo", "1.7.8").first)
+ build_spec("foo", "1.7.8").first
+ )
expect(versions(res)).to eq %w(1.7.7 1.8.0 1.7.8 1.7.9 1.7.15)
end
@@ -113,7 +121,8 @@ describe Bundler::GemVersionPromoter do
unlocking(:level => :patch)
res = @gvp.sort_dep_specs(
build_spec_group("foo", %w(1.7.9 1.8.0 2.0.0)),
- build_spec("foo", "1.7.9").first)
+ build_spec("foo", "1.7.9").first
+ )
expect(versions(res)).to eq %w(2.0.0 1.8.0 1.7.9)
end
end
@@ -123,7 +132,8 @@ describe Bundler::GemVersionPromoter do
unlocking(:level => :minor)
res = @gvp.sort_dep_specs(
build_spec_group("foo", %w(0.2.0 0.3.0 0.3.1 0.9.0 1.0.0 2.0.0 2.0.1)),
- build_spec("foo", "0.2.0").first)
+ build_spec("foo", "0.2.0").first
+ )
expect(versions(res)).to eq %w(2.0.0 2.0.1 1.0.0 0.2.0 0.3.0 0.3.1 0.9.0)
end
end
diff --git a/spec/bundler/settings_spec.rb b/spec/bundler/settings_spec.rb
index a4ac02c0..0f7d2a01 100644
--- a/spec/bundler/settings_spec.rb
+++ b/spec/bundler/settings_spec.rb
@@ -204,7 +204,8 @@ that would suck --ehhh=oh geez it looks like i might have broken bundler somehow
it "reads older keys without trailing slashes" do
settings["mirror.https://rubygems.org"] = "http://rubygems-mirror.org"
expect(settings.mirror_for("https://rubygems.org/")).to eq(
- URI("http://rubygems-mirror.org/"))
+ URI("http://rubygems-mirror.org/")
+ )
end
end
diff --git a/spec/bundler/shared_helpers_spec.rb b/spec/bundler/shared_helpers_spec.rb
index 2ad0c98d..f617d5cf 100644
--- a/spec/bundler/shared_helpers_spec.rb
+++ b/spec/bundler/shared_helpers_spec.rb
@@ -27,7 +27,8 @@ describe Bundler::SharedHelpers do
it "raises a GemfileNotFound error" do
expect { subject.default_gemfile }.to raise_error(
- Bundler::GemfileNotFound, "Could not locate Gemfile")
+ Bundler::GemfileNotFound, "Could not locate Gemfile"
+ )
end
end
end
@@ -348,7 +349,8 @@ describe Bundler::SharedHelpers do
it "raises a PermissionError" do
expect { subject.filesystem_access("/path", &file_op_block) }.to raise_error(
- Bundler::PermissionError)
+ Bundler::PermissionError
+ )
end
end
@@ -357,7 +359,8 @@ describe Bundler::SharedHelpers do
it "raises a TemporaryResourceError" do
expect { subject.filesystem_access("/path", &file_op_block) }.to raise_error(
- Bundler::TemporaryResourceError)
+ Bundler::TemporaryResourceError
+ )
end
end
@@ -366,7 +369,8 @@ describe Bundler::SharedHelpers do
it "raises a VirtualProtocolError" do
expect { subject.filesystem_access("/path", &file_op_block) }.to raise_error(
- Bundler::VirtualProtocolError)
+ Bundler::VirtualProtocolError
+ )
end
end
@@ -375,7 +379,8 @@ describe Bundler::SharedHelpers do
it "raises a OperationNotSupportedError" do
expect { subject.filesystem_access("/path", &file_op_block) }.to raise_error(
- Bundler::OperationNotSupportedError)
+ Bundler::OperationNotSupportedError
+ )
end
end
end
diff --git a/spec/bundler/uri_credentials_filter_spec.rb b/spec/bundler/uri_credentials_filter_spec.rb
index b890c0ce..70f71cec 100644
--- a/spec/bundler/uri_credentials_filter_spec.rb
+++ b/spec/bundler/uri_credentials_filter_spec.rb
@@ -98,7 +98,8 @@ describe Bundler::URICredentialsFilter do
it "returns the string without the sensitive credentials" do
expect(subject.credential_filtered_string(str_to_filter, uri)).to eq(
- "This is a git message containing a uri https://x-oauth-basic@github.com/company/private-repo!")
+ "This is a git message containing a uri https://x-oauth-basic@github.com/company/private-repo!"
+ )
end
end
diff --git a/spec/commands/binstubs_spec.rb b/spec/commands/binstubs_spec.rb
index c400d7ec..e739f942 100644
--- a/spec/commands/binstubs_spec.rb
+++ b/spec/commands/binstubs_spec.rb
@@ -93,7 +93,7 @@ describe "bundle binstubs <gem>" do
end
it "sets correct permissions for binstubs" do
- with_umask(0002) do
+ with_umask(0o002) do
install_gemfile <<-G
source "file://#{gem_repo1}"
gem "rack"
diff --git a/spec/commands/clean_spec.rb b/spec/commands/clean_spec.rb
index 67d70b51..72d422c3 100644
--- a/spec/commands/clean_spec.rb
+++ b/spec/commands/clean_spec.rb
@@ -460,7 +460,7 @@ describe "bundle clean" do
describe "when missing permissions" do
after do
- FileUtils.chmod(0755, default_bundle_path("cache"))
+ FileUtils.chmod(0o755, default_bundle_path("cache"))
end
it "returns a helpful error message" do
gemfile <<-G
@@ -479,7 +479,7 @@ describe "bundle clean" do
bundle :install
system_cache_path = default_bundle_path("cache")
- FileUtils.chmod(0500, system_cache_path)
+ FileUtils.chmod(0o500, system_cache_path)
bundle :clean, :force => true
diff --git a/spec/commands/exec_spec.rb b/spec/commands/exec_spec.rb
index cf10521f..5e16eea8 100644
--- a/spec/commands/exec_spec.rb
+++ b/spec/commands/exec_spec.rb
@@ -102,7 +102,7 @@ describe "bundle exec" do
f.puts "#!/bin/sh"
f.puts "echo foobar"
end
- File.chmod(0744, "--verbose")
+ File.chmod(0o744, "--verbose")
with_path_as(".") do
bundle "exec -- --verbose"
end
@@ -232,7 +232,7 @@ describe "bundle exec" do
#!/usr/bin/env ruby
puts "args: #{ARGV.inspect}"
RUBY
- bundled_app("print_args").chmod(0755)
+ bundled_app("print_args").chmod(0o755)
end
it "shows executable's man page when --help is after the executable" do
@@ -466,7 +466,7 @@ describe "bundle exec" do
before do
path.open("w") {|f| f << executable }
- path.chmod(0755)
+ path.chmod(0o755)
install_gemfile <<-G
gem "rack"
diff --git a/spec/commands/help_spec.rb b/spec/commands/help_spec.rb
index 4e35ba3e..ef928080 100644
--- a/spec/commands/help_spec.rb
+++ b/spec/commands/help_spec.rb
@@ -39,7 +39,7 @@ describe "bundle help" do
end
it "looks for a binary and executes it with --help option if it's named bundler-<task>" do
- File.open(tmp("bundler-testtasks"), "w", 0755) do |f|
+ File.open(tmp("bundler-testtasks"), "w", 0o755) do |f|
f.puts "#!/usr/bin/env ruby\nputs ARGV.join(' ')\n"
end
diff --git a/spec/commands/install_spec.rb b/spec/commands/install_spec.rb
index 524071d9..ea2c3c00 100644
--- a/spec/commands/install_spec.rb
+++ b/spec/commands/install_spec.rb
@@ -462,7 +462,7 @@ describe "bundle install with gem sources" do
end
it "should display a proper message to explain the problem" do
- FileUtils.chmod(0500, bundled_app("vendor"))
+ FileUtils.chmod(0o500, bundled_app("vendor"))
bundle :install, :path => "vendor"
expect(out).to include(bundled_app("vendor").to_s)
diff --git a/spec/install/gems/compact_index_spec.rb b/spec/install/gems/compact_index_spec.rb
index e96936f0..22557156 100644
--- a/spec/install/gems/compact_index_spec.rb
+++ b/spec/install/gems/compact_index_spec.rb
@@ -40,7 +40,8 @@ describe "compact index api" do
"activerecord 2.3.2",
"actionmailer 2.3.2",
"activeresource 2.3.2",
- "activesupport 2.3.2")
+ "activesupport 2.3.2"
+ )
end
it "should handle multiple gem dependencies on the same gem" do
diff --git a/spec/install/gems/dependency_api_spec.rb b/spec/install/gems/dependency_api_spec.rb
index 70190dd0..837a1f87 100644
--- a/spec/install/gems/dependency_api_spec.rb
+++ b/spec/install/gems/dependency_api_spec.rb
@@ -40,7 +40,8 @@ describe "gemcutter's dependency API" do
"activerecord 2.3.2",
"actionmailer 2.3.2",
"activeresource 2.3.2",
- "activesupport 2.3.2")
+ "activesupport 2.3.2"
+ )
end
it "should handle multiple gem dependencies on the same gem" do
@@ -150,7 +151,8 @@ describe "gemcutter's dependency API" do
"activesupport 2.3.2",
"thin 1.0.0",
"rack 1.0.0",
- "rails 2.3.2")
+ "rails 2.3.2"
+ )
end
it "falls back when Gemcutter API doesn't return proper Marshal format" do
diff --git a/spec/other/major_deprecation_spec.rb b/spec/other/major_deprecation_spec.rb
index c2d1cdbe..e706d710 100644
--- a/spec/other/major_deprecation_spec.rb
+++ b/spec/other/major_deprecation_spec.rb
@@ -107,7 +107,8 @@ describe "major deprecations" do
G
expect(warnings).to have_major_deprecation a_string_including(
- "flags passed to commands will no longer be automatically remembered.")
+ "flags passed to commands will no longer be automatically remembered."
+ )
end
end
end
diff --git a/spec/support/helpers.rb b/spec/support/helpers.rb
index 2c3a8f72..a6093859 100644
--- a/spec/support/helpers.rb
+++ b/spec/support/helpers.rb
@@ -264,7 +264,7 @@ module Spec
def break_git!
FileUtils.mkdir_p(tmp("broken_path"))
- File.open(tmp("broken_path/git"), "w", 0755) do |f|
+ File.open(tmp("broken_path/git"), "w", 0o755) do |f|
f.puts "#!/usr/bin/env ruby\nSTDERR.puts 'This is not the git you are looking for'\nexit 1"
end
@@ -273,7 +273,7 @@ module Spec
def with_fake_man
FileUtils.mkdir_p(tmp("fake_man"))
- File.open(tmp("fake_man/man"), "w", 0755) do |f|
+ File.open(tmp("fake_man/man"), "w", 0o755) do |f|
f.puts "#!/usr/bin/env ruby\nputs ARGV.inspect\n"
end
with_path_added(tmp("fake_man")) { yield }
@@ -411,10 +411,10 @@ module Spec
end
end
- Dir[pattern].each(&chmod[0555, 0444])
+ Dir[pattern].each(&chmod[0o555, 0o444])
yield
ensure
- Dir[pattern].each(&chmod[0755, 0644])
+ Dir[pattern].each(&chmod[0o755, 0o644])
end
def process_file(pathname)