aboutsummaryrefslogtreecommitdiffstats
path: root/lib/bundler
diff options
context:
space:
mode:
Diffstat (limited to 'lib/bundler')
-rw-r--r--lib/bundler/cli.rb2
-rw-r--r--lib/bundler/cli/binstubs.rb2
-rw-r--r--lib/bundler/cli/common.rb2
-rw-r--r--lib/bundler/cli/gem.rb2
-rw-r--r--lib/bundler/cli/inject.rb2
-rw-r--r--lib/bundler/cli/open.rb2
-rw-r--r--lib/bundler/definition.rb2
-rw-r--r--lib/bundler/dsl.rb4
-rw-r--r--lib/bundler/fetcher.rb2
-rw-r--r--lib/bundler/gem_helper.rb2
-rw-r--r--lib/bundler/index.rb6
-rw-r--r--lib/bundler/installer.rb2
-rw-r--r--lib/bundler/retry.rb2
-rw-r--r--lib/bundler/rubygems_ext.rb2
-rw-r--r--lib/bundler/rubygems_integration.rb4
-rw-r--r--lib/bundler/similarity_detector.rb4
-rw-r--r--lib/bundler/source/git.rb2
-rw-r--r--lib/bundler/source/path.rb4
-rw-r--r--lib/bundler/source/rubygems.rb2
19 files changed, 25 insertions, 25 deletions
diff --git a/lib/bundler/cli.rb b/lib/bundler/cli.rb
index bbc0fac6..82359eb6 100644
--- a/lib/bundler/cli.rb
+++ b/lib/bundler/cli.rb
@@ -348,7 +348,7 @@ module Bundler
method_option :bin, :type => :boolean, :default => false, :aliases => "-b", :desc => "Generate a binary for your library."
method_option :coc, :type => :boolean, :desc => "Generate a code of conduct file. Set a default with `bundle config gem.coc true`."
method_option :edit, :type => :string, :aliases => "-e", :required => false, :banner => "EDITOR",
- :lazy_default => [ENV["BUNDLER_EDITOR"], ENV["VISUAL"], ENV["EDITOR"]].find{|e| !e.nil? && !e.empty? },
+ :lazy_default => [ENV["BUNDLER_EDITOR"], ENV["VISUAL"], ENV["EDITOR"]].find {|e| !e.nil? && !e.empty? },
:desc => "Open generated gemspec in the specified editor (defaults to $EDITOR or $BUNDLER_EDITOR)"
method_option :ext, :type => :boolean, :default => false, :desc => "Generate the boilerplate for C extension code"
method_option :mit, :type => :boolean, :desc => "Generate an MIT license file"
diff --git a/lib/bundler/cli/binstubs.rb b/lib/bundler/cli/binstubs.rb
index 7c67b7d7..cf9ce02c 100644
--- a/lib/bundler/cli/binstubs.rb
+++ b/lib/bundler/cli/binstubs.rb
@@ -20,7 +20,7 @@ module Bundler
end
gems.each do |gem_name|
- spec = installer.specs.find{|s| s.name == gem_name }
+ 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)
diff --git a/lib/bundler/cli/common.rb b/lib/bundler/cli/common.rb
index 40d52932..53b30d20 100644
--- a/lib/bundler/cli/common.rb
+++ b/lib/bundler/cli/common.rb
@@ -3,7 +3,7 @@ module Bundler
def self.without_groups_message
groups = Bundler.settings.without
group_list = [groups[0...-1].join(", "), groups[-1..-1]].
- reject{|s| s.to_s.empty? }.join(" and ")
+ reject {|s| s.to_s.empty? }.join(" and ")
group_str = (groups.size == 1) ? "group" : "groups"
"Gems in the #{group_str} #{group_list} were not installed."
end
diff --git a/lib/bundler/cli/gem.rb b/lib/bundler/cli/gem.rb
index 79183970..383602d6 100644
--- a/lib/bundler/cli/gem.rb
+++ b/lib/bundler/cli/gem.rb
@@ -20,7 +20,7 @@ module Bundler
underscored_name = name.tr("-", "_")
namespaced_path = name.tr("-", "/")
- constant_name = name.gsub(/-[_-]*(?![_-]|$)/){ "::" }.gsub(/([_-]+|(::)|^)(.|$)/){ $2.to_s + $3.upcase }
+ constant_name = name.gsub(/-[_-]*(?![_-]|$)/) { "::" }.gsub(/([_-]+|(::)|^)(.|$)/) { $2.to_s + $3.upcase }
constant_array = constant_name.split("::")
test_task = options[:test] == "minitest" ? "test" : "spec"
diff --git a/lib/bundler/cli/inject.rb b/lib/bundler/cli/inject.rb
index 2f797be7..a17bce03 100644
--- a/lib/bundler/cli/inject.rb
+++ b/lib/bundler/cli/inject.rb
@@ -23,7 +23,7 @@ module Bundler
if added.any?
Bundler.ui.confirm "Added to Gemfile:"
- Bundler.ui.confirm added.map{|g| " #{g}" }.join("\n")
+ Bundler.ui.confirm added.map {|g| " #{g}" }.join("\n")
else
Bundler.ui.confirm "All injected gems were already present in the Gemfile"
end
diff --git a/lib/bundler/cli/open.rb b/lib/bundler/cli/open.rb
index b6bfda4d..0bf42038 100644
--- a/lib/bundler/cli/open.rb
+++ b/lib/bundler/cli/open.rb
@@ -10,7 +10,7 @@ module Bundler
end
def run
- editor = [ENV["BUNDLER_EDITOR"], ENV["VISUAL"], ENV["EDITOR"]].find{|e| !e.nil? && !e.empty? }
+ editor = [ENV["BUNDLER_EDITOR"], ENV["VISUAL"], ENV["EDITOR"]].find {|e| !e.nil? && !e.empty? }
return Bundler.ui.info("To open a bundled gem, set $EDITOR or $BUNDLER_EDITOR") unless editor
path = Bundler::CLI::Common.select_spec(name, :regex_match).full_gem_path
Dir.chdir(path) do
diff --git a/lib/bundler/definition.rb b/lib/bundler/definition.rb
index 47e4cdce..37cc4d9d 100644
--- a/lib/bundler/definition.rb
+++ b/lib/bundler/definition.rb
@@ -265,7 +265,7 @@ module Bundler
return
end
- File.open(file, "wb"){|f| f.puts(contents) }
+ File.open(file, "wb") {|f| f.puts(contents) }
rescue Errno::EACCES
raise PermissionError.new(file)
end
diff --git a/lib/bundler/dsl.rb b/lib/bundler/dsl.rb
index 01b3c213..0d0255ac 100644
--- a/lib/bundler/dsl.rb
+++ b/lib/bundler/dsl.rb
@@ -216,7 +216,7 @@ module Bundler
"git://github.com/#{repo_name}.git"
end
- git_source(:gist){|repo_name| "https://gist.github.com/#{repo_name}.git" }
+ git_source(:gist) {|repo_name| "https://gist.github.com/#{repo_name}.git" }
git_source(:bitbucket) do |repo_name|
user_name, repo_name = repo_name.split "/"
@@ -321,7 +321,7 @@ module Bundler
def validate_keys(command, opts, valid_keys)
invalid_keys = opts.keys - valid_keys
if invalid_keys.any?
- message = "You passed #{invalid_keys.map{|k| ":"+k }.join(", ")} "
+ message = "You passed #{invalid_keys.map {|k| ":"+k }.join(", ")} "
message << if invalid_keys.size > 1
"as options for #{command}, but they are invalid."
else
diff --git a/lib/bundler/fetcher.rb b/lib/bundler/fetcher.rb
index 120f2a27..7391c288 100644
--- a/lib/bundler/fetcher.rb
+++ b/lib/bundler/fetcher.rb
@@ -192,7 +192,7 @@ module Bundler
"CI_NAME" => ENV["CI_NAME"],
"CI" => "ci"
}
- env_cis.find_all{|env, ci| ENV[env] }.map{|env, ci| ci }
+ env_cis.find_all {|env, ci| ENV[env] }.map {|env, ci| ci }
end
def connection
diff --git a/lib/bundler/gem_helper.rb b/lib/bundler/gem_helper.rb
index b7bd92e6..b7b9b7b2 100644
--- a/lib/bundler/gem_helper.rb
+++ b/lib/bundler/gem_helper.rb
@@ -100,7 +100,7 @@ module Bundler
end
def built_gem_path
- Dir[File.join(base, "#{name}-*.gem")].sort_by{|f| File.mtime(f) }.last
+ Dir[File.join(base, "#{name}-*.gem")].sort_by {|f| File.mtime(f) }.last
end
def git_push(remote = "")
diff --git a/lib/bundler/index.rb b/lib/bundler/index.rb
index 9385ff12..ad36b756 100644
--- a/lib/bundler/index.rb
+++ b/lib/bundler/index.rb
@@ -98,13 +98,13 @@ module Bundler
# returns a list of the dependencies
def unmet_dependency_names
names = dependency_names
- names.delete_if{|n| n == "bundler" }
- names.select{|n| search(n).empty? }
+ names.delete_if {|n| n == "bundler" }
+ names.select {|n| search(n).empty? }
end
def dependency_names
names = []
- each{|s| names.push(*s.dependencies.map(&:name)) }
+ each {|s| names.push(*s.dependencies.map(&:name)) }
names.uniq
end
diff --git a/lib/bundler/installer.rb b/lib/bundler/installer.rb
index 29d41bad..3295fc84 100644
--- a/lib/bundler/installer.rb
+++ b/lib/bundler/installer.rb
@@ -125,7 +125,7 @@ module Bundler
if options.any?
Bundler.ui.warn "#{spec.name} has no executables, but you may want " +
"one from a gem it depends on."
- options.each{|name,bins| Bundler.ui.warn " #{name} has: #{bins.join(", ")}" }
+ options.each {|name,bins| Bundler.ui.warn " #{name} has: #{bins.join(", ")}" }
else
Bundler.ui.warn "There are no executables for the gem #{spec.name}."
end
diff --git a/lib/bundler/retry.rb b/lib/bundler/retry.rb
index 25141f52..c0563e34 100644
--- a/lib/bundler/retry.rb
+++ b/lib/bundler/retry.rb
@@ -44,7 +44,7 @@ module Bundler
def fail(e)
@failed = true
- raise e if last_attempt? || @exceptions.any?{|k| e.is_a?(k) }
+ raise e if last_attempt? || @exceptions.any? {|k| e.is_a?(k) }
return true unless name
Bundler.ui.warn "Retrying#{" #{name}" if name} due to error (#{current_run.next}/#{total_runs}): #{e.class} #{e.message}"
end
diff --git a/lib/bundler/rubygems_ext.rb b/lib/bundler/rubygems_ext.rb
index 6d5d3890..b7cf99c0 100644
--- a/lib/bundler/rubygems_ext.rb
+++ b/lib/bundler/rubygems_ext.rb
@@ -122,7 +122,7 @@ module Gem
def to_lock
out = " #{name}"
unless requirement == Gem::Requirement.default
- reqs = requirement.requirements.map{|o,v| "#{o} #{v}" }.sort.reverse
+ reqs = requirement.requirements.map {|o,v| "#{o} #{v}" }.sort.reverse
out << " (#{reqs.join(", ")})"
end
out
diff --git a/lib/bundler/rubygems_integration.rb b/lib/bundler/rubygems_integration.rb
index 69b421d4..efd00a49 100644
--- a/lib/bundler/rubygems_integration.rb
+++ b/lib/bundler/rubygems_integration.rb
@@ -111,7 +111,7 @@ module Bundler
end
def gem_cache
- gem_path.map{|p| File.expand_path("cache", p) }
+ gem_path.map {|p| File.expand_path("cache", p) }
end
def spec_cache_dirs
@@ -155,7 +155,7 @@ module Bundler
loaded_gem_paths.flatten
else
$LOAD_PATH.select do |p|
- Bundler.rubygems.gem_path.any?{|gp| p =~ /^#{Regexp.escape(gp)}/ }
+ Bundler.rubygems.gem_path.any? {|gp| p =~ /^#{Regexp.escape(gp)}/ }
end
end
end
diff --git a/lib/bundler/similarity_detector.rb b/lib/bundler/similarity_detector.rb
index c4caab71..dc770c42 100644
--- a/lib/bundler/similarity_detector.rb
+++ b/lib/bundler/similarity_detector.rb
@@ -9,8 +9,8 @@ module Bundler
# return an array of words similar to 'word' from the corpus
def similar_words(word, limit = 3)
- words_by_similarity = @corpus.map{|w| SimilarityScore.new(w, levenshtein_distance(word, w)) }
- words_by_similarity.select{|s| s.distance<=limit }.sort_by(&:distance).map(&:string)
+ words_by_similarity = @corpus.map {|w| SimilarityScore.new(w, levenshtein_distance(word, w)) }
+ words_by_similarity.select {|s| s.distance<=limit }.sort_by(&:distance).map(&:string)
end
# return the result of 'similar_words', concatenated into a list
diff --git a/lib/bundler/source/git.rb b/lib/bundler/source/git.rb
index 992a908c..400b0a65 100644
--- a/lib/bundler/source/git.rb
+++ b/lib/bundler/source/git.rb
@@ -17,7 +17,7 @@ module Bundler
@allow_remote = false
# Stringify options that could be set as symbols
- %w(ref branch tag revision).each{|k| options[k] = options[k].to_s if options[k] }
+ %w(ref branch tag revision).each {|k| options[k] = options[k].to_s if options[k] }
@uri = options["uri"] || ""
@branch = options["branch"]
diff --git a/lib/bundler/source/path.rb b/lib/bundler/source/path.rb
index 9ec140f3..57f8bc01 100644
--- a/lib/bundler/source/path.rb
+++ b/lib/bundler/source/path.rb
@@ -150,8 +150,8 @@ module Bundler
s.authors = ["no one"]
if expanded_path.join("bin").exist?
executables = expanded_path.join("bin").children
- executables.reject!{|p| File.directory?(p) }
- s.executables = executables.map{|c| c.basename.to_s }
+ executables.reject! {|p| File.directory?(p) }
+ s.executables = executables.map {|c| c.basename.to_s }
end
end
end
diff --git a/lib/bundler/source/rubygems.rb b/lib/bundler/source/rubygems.rb
index aec68776..9bd908fb 100644
--- a/lib/bundler/source/rubygems.rb
+++ b/lib/bundler/source/rubygems.rb
@@ -22,7 +22,7 @@ module Bundler
@allow_cached = false
@caches = [Bundler.app_cache, *Bundler.rubygems.gem_cache]
- Array(options["remotes"] || []).reverse_each{|r| add_remote(r) }
+ Array(options["remotes"] || []).reverse_each {|r| add_remote(r) }
end
def remote!