summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSamuel E. Giddins <segiddins@segiddins.me>2015-08-07 23:29:21 -0700
committerSamuel E. Giddins <segiddins@segiddins.me>2015-08-07 23:29:21 -0700
commitb779901301730efd1fe3a30e3e2f1a00c8120c1a (patch)
treebe0902625af812bb292243baf28526e166f5bec6 /lib
parent83bdb7f7ddc95bed78c18320bd8baa2ba8f3972a (diff)
downloadbundler-b779901301730efd1fe3a30e3e2f1a00c8120c1a.tar.gz
[RuboCop] Update to 0.33.0
Diffstat (limited to 'lib')
-rw-r--r--lib/bundler.rb2
-rw-r--r--lib/bundler/cli.rb10
-rw-r--r--lib/bundler/cli/outdated.rb2
-rw-r--r--lib/bundler/definition.rb4
-rw-r--r--lib/bundler/dsl.rb2
-rw-r--r--lib/bundler/fetcher.rb2
-rw-r--r--lib/bundler/graph.rb2
-rw-r--r--lib/bundler/installer.rb2
-rw-r--r--lib/bundler/retry.rb6
-rw-r--r--lib/bundler/rubygems_integration.rb4
-rw-r--r--lib/bundler/runtime.rb6
-rw-r--r--lib/bundler/similarity_detector.rb2
-rw-r--r--lib/bundler/source/path.rb2
13 files changed, 23 insertions, 23 deletions
diff --git a/lib/bundler.rb b/lib/bundler.rb
index 5bb35f4d40..143d49e9cf 100644
--- a/lib/bundler.rb
+++ b/lib/bundler.rb
@@ -428,7 +428,7 @@ module Bundler
eval(contents, TOPLEVEL_BINDING, path.expand_path.to_s)
rescue ScriptError, StandardError => e
original_line = e.backtrace.find {|line| line.include?(path.to_s) }
- msg = "There was a #{e.class} while loading #{path.basename}: \n#{e.message}"
+ msg = "There was a #{e.class} while loading #{path.basename}: \n#{e.message}"
msg << " from\n #{original_line}" if original_line
msg << "\n"
diff --git a/lib/bundler/cli.rb b/lib/bundler/cli.rb
index e79cd5b145..c481ac7322 100644
--- a/lib/bundler/cli.rb
+++ b/lib/bundler/cli.rb
@@ -17,7 +17,7 @@ module Bundler
super
custom_gemfile = options[:gemfile] || Bundler.settings[:gemfile]
- ENV["BUNDLE_GEMFILE"] = File.expand_path(custom_gemfile) if custom_gemfile
+ ENV["BUNDLE_GEMFILE"] = File.expand_path(custom_gemfile) if custom_gemfile
Bundler.settings[:retry] = options[:retry] if options[:retry]
@@ -38,7 +38,7 @@ module Bundler
class_option "no-color", :type => :boolean, :desc => "Disable colorization in output"
class_option "retry", :type => :numeric, :aliases => "-r", :banner => "NUM",
:desc => "Specify the number of times you wish to attempt network commands"
- class_option "verbose", :type => :boolean, :desc => "Enable verbose output mode", :aliases => "-V"
+ class_option "verbose", :type => :boolean, :desc => "Enable verbose output mode", :aliases => "-V"
def help(cli = nil)
case cli
@@ -240,7 +240,7 @@ module Bundler
desc "cache [OPTIONS]", "Cache all the gems to vendor/cache", :hide => true
method_option "all", :type => :boolean, :banner => "Include all sources (including path and git)."
method_option "all-platforms", :type => :boolean, :banner => "Include gems for all platforms, not just the current one"
- method_option "no-prune", :type => :boolean, :banner => "Don't remove stale gems from the cache."
+ method_option "no-prune", :type => :boolean, :banner => "Don't remove stale gems from the cache."
def cache
require "bundler/cli/cache"
Cache.new(options).run
@@ -252,8 +252,8 @@ module Bundler
method_option "cache-path", :type => :string, :banner =>
"Specify a different cache path than the default (vendor/cache)."
method_option "gemfile", :type => :string, :banner => "Use the specified gemfile instead of Gemfile"
- method_option "no-install", :type => :boolean, :banner => "Don't actually install the gems, just package."
- method_option "no-prune", :type => :boolean, :banner => "Don't remove stale gems from the cache."
+ method_option "no-install", :type => :boolean, :banner => "Don't actually install the gems, just package."
+ method_option "no-prune", :type => :boolean, :banner => "Don't remove stale gems from the cache."
method_option "path", :type => :string, :banner =>
"Specify a different path than the system default ($BUNDLE_PATH or $GEM_HOME). Bundler will remember this value for future installs on this machine"
method_option "quiet", :type => :boolean, :banner => "Only output warnings and errors."
diff --git a/lib/bundler/cli/outdated.rb b/lib/bundler/cli/outdated.rb
index b80519fb1e..640e4f7ca7 100644
--- a/lib/bundler/cli/outdated.rb
+++ b/lib/bundler/cli/outdated.rb
@@ -39,7 +39,7 @@ module Bundler
dependency = current_dependencies[current_spec.name]
if options["strict"]
- active_spec = definition.specs.detect {|spec| spec.name == current_spec.name }
+ active_spec = definition.specs.detect {|spec| spec.name == current_spec.name }
else
active_spec = definition.index[current_spec.name].sort_by(&:version)
if !current_spec.version.prerelease? && !options[:pre] && active_spec.size > 1
diff --git a/lib/bundler/definition.rb b/lib/bundler/definition.rb
index f65587316a..4f68c2248e 100644
--- a/lib/bundler/definition.rb
+++ b/lib/bundler/definition.rb
@@ -61,7 +61,7 @@ module Bundler
if lockfile && File.exist?(lockfile)
@lockfile_contents = Bundler.read_file(lockfile)
locked = LockfileParser.new(@lockfile_contents)
- @platforms = locked.platforms
+ @platforms = locked.platforms
@locked_bundler_version = locked.bundler_version
if unlock != true
@@ -419,7 +419,7 @@ module Bundler
end
def pretty_dep(dep, source = false)
- msg = "#{dep.name}"
+ msg = "#{dep.name}"
msg << " (#{dep.requirement})" unless dep.requirement == Gem::Requirement.default
msg << " from the `#{dep.source}` source" if source && dep.source
msg
diff --git a/lib/bundler/dsl.rb b/lib/bundler/dsl.rb
index 7d66b5e621..5d7dfddf22 100644
--- a/lib/bundler/dsl.rb
+++ b/lib/bundler/dsl.rb
@@ -439,7 +439,7 @@ module Bundler
lines = contents.lines.to_a
indent = " # "
- indicator = indent.gsub("#", ">")
+ indicator = indent.tr('#', ">")
first_line = (line_numer.zero?)
last_line = (line_numer == (lines.count - 1))
diff --git a/lib/bundler/fetcher.rb b/lib/bundler/fetcher.rb
index 1ef8772150..829b709c38 100644
--- a/lib/bundler/fetcher.rb
+++ b/lib/bundler/fetcher.rb
@@ -58,7 +58,7 @@ module Bundler
attr_accessor :disable_endpoint, :api_timeout, :redirect_limit, :max_retries
end
- self.redirect_limit = Bundler.settings[:redirect] # How many redirects to allow in one request
+ self.redirect_limit = Bundler.settings[:redirect] # How many redirects to allow in one request
self.api_timeout = Bundler.settings[:timeout] # How long to wait for each API call
self.max_retries = Bundler.settings[:retry] # How many retries for the API call
diff --git a/lib/bundler/graph.rb b/lib/bundler/graph.rb
index 74a59c115b..66ea2d99a8 100644
--- a/lib/bundler/graph.rb
+++ b/lib/bundler/graph.rb
@@ -135,7 +135,7 @@ module Bundler
@groups.each do |group|
g.add_nodes(
group,
- { :style => "filled",
+ { :style => "filled",
:fillcolor => "#B9B9D5",
:shape => "box3d",
:fontsize => 16 }.merge(@node_options[group])
diff --git a/lib/bundler/installer.rb b/lib/bundler/installer.rb
index 2240c17f1a..e4a9a8c9fe 100644
--- a/lib/bundler/installer.rb
+++ b/lib/bundler/installer.rb
@@ -232,7 +232,7 @@ module Bundler
spec.require_paths.each do |path|
full_path = Pathname.new(path).absolute? ? path : File.join(spec.full_gem_path, path)
gem_path = Pathname.new(full_path).relative_path_from(Bundler.root.join(bundler_path))
- paths << gem_path.to_s.sub("#{Bundler.ruby_version.engine}/#{RbConfig::CONFIG["ruby_version"]}", '#{ruby_engine}/#{ruby_version}') # rubocop:disable Style/StringLiterals
+ paths << gem_path.to_s.sub("#{Bundler.ruby_version.engine}/#{RbConfig::CONFIG["ruby_version"]}", '#{ruby_engine}/#{ruby_version}')
end
end
diff --git a/lib/bundler/retry.rb b/lib/bundler/retry.rb
index 7f6da8a58e..85bff78807 100644
--- a/lib/bundler/retry.rb
+++ b/lib/bundler/retry.rb
@@ -15,10 +15,10 @@ module Bundler
end
def initialize(name, exceptions = nil, retries = self.class.default_retries)
- @name = name
- @retries = retries
+ @name = name
+ @retries = retries
@exceptions = Array(exceptions) || []
- @total_runs = @retries + 1 # will run once, then upto attempts.times
+ @total_runs = @retries + 1 # will run once, then upto attempts.times
end
def attempt(&block)
diff --git a/lib/bundler/rubygems_integration.rb b/lib/bundler/rubygems_integration.rb
index 5ce80d7a78..d8c3b8d048 100644
--- a/lib/bundler/rubygems_integration.rb
+++ b/lib/bundler/rubygems_integration.rb
@@ -278,7 +278,7 @@ module Bundler
dep = Gem::Dependency.new(dep, reqs)
end
- spec = specs.find {|s| s.name == dep.name }
+ spec = specs.find {|s| s.name == dep.name }
if spec.nil?
@@ -349,7 +349,7 @@ module Bundler
"to work around a system/bundle conflict."
end
else
- spec = specs.find {|s| s.name == name }
+ spec = specs.find {|s| s.name == name }
exec_name = spec.default_executable or raise Gem::Exception, "no default executable for #{spec.full_name}"
end
diff --git a/lib/bundler/runtime.rb b/lib/bundler/runtime.rb
index 497f3b77bc..28767af5e2 100644
--- a/lib/bundler/runtime.rb
+++ b/lib/bundler/runtime.rb
@@ -81,7 +81,7 @@ module Bundler
if dep.autorequire.nil? && dep.name.include?("-")
begin
- namespaced_file = dep.name.gsub("-", "/")
+ namespaced_file = dep.name.tr("-", "/")
Kernel.require namespaced_file
rescue LoadError => e
REQUIRE_ERRORS.find {|r| r =~ e.message }
@@ -225,7 +225,7 @@ module Bundler
private
def prune_gem_cache(resolve, cache_path)
- cached = Dir["#{cache_path}/*.gem"]
+ cached = Dir["#{cache_path}/*.gem"]
cached = cached.delete_if do |path|
spec = Bundler.rubygems.spec_from_gem path
@@ -246,7 +246,7 @@ module Bundler
end
def prune_git_and_path_cache(resolve, cache_path)
- cached = Dir["#{cache_path}/*/.bundlecache"]
+ cached = Dir["#{cache_path}/*/.bundlecache"]
cached = cached.delete_if do |path|
name = File.basename(File.dirname(path))
diff --git a/lib/bundler/similarity_detector.rb b/lib/bundler/similarity_detector.rb
index 0657192eda..de2de05992 100644
--- a/lib/bundler/similarity_detector.rb
+++ b/lib/bundler/similarity_detector.rb
@@ -31,7 +31,7 @@ module Bundler
# ins, del, sub are weighted costs
return nil if this.nil?
return nil if that.nil?
- dm = [] # distance matrix
+ dm = [] # distance matrix
# Initialize first row values
dm[0] = (0..this.length).collect {|i| i * ins }
diff --git a/lib/bundler/source/path.rb b/lib/bundler/source/path.rb
index b42d172cce..0c408b4bbf 100644
--- a/lib/bundler/source/path.rb
+++ b/lib/bundler/source/path.rb
@@ -147,7 +147,7 @@ module Bundler
s.platform = Gem::Platform::RUBY
s.summary = "Fake gemspec for #{@name}"
s.relative_loaded_from = "#{@name}.gemspec"
- s.authors = ["no one"]
+ s.authors = ["no one"]
if expanded_path.join("bin").exist?
executables = expanded_path.join("bin").children
executables.reject! {|p| File.directory?(p) }