diff options
Diffstat (limited to 'lib/bundler')
-rw-r--r-- | lib/bundler/cli/install.rb | 2 | ||||
-rw-r--r-- | lib/bundler/definition.rb | 4 | ||||
-rw-r--r-- | lib/bundler/dsl.rb | 6 | ||||
-rw-r--r-- | lib/bundler/installer.rb | 2 | ||||
-rw-r--r-- | lib/bundler/installer/parallel_installer.rb | 2 | ||||
-rw-r--r-- | lib/bundler/ruby_version.rb | 6 | ||||
-rw-r--r-- | lib/bundler/similarity_detector.rb | 14 | ||||
-rw-r--r-- | lib/bundler/source/git.rb | 7 |
8 files changed, 19 insertions, 24 deletions
diff --git a/lib/bundler/cli/install.rb b/lib/bundler/cli/install.rb index f4b1880a..2245f958 100644 --- a/lib/bundler/cli/install.rb +++ b/lib/bundler/cli/install.rb @@ -85,7 +85,7 @@ module Bundler Bundler.settings[:path] = nil if options[:system] Bundler.settings[:path] = "vendor/bundle" if options[:deployment] Bundler.settings[:path] = options["path"] if options["path"] - Bundler.settings[:path] ||= "bundle" if options["standalone"] + Bundler.settings[:path] ||= "bundle" if options["standalone"] Bundler.settings[:bin] = options["binstubs"] if options["binstubs"] Bundler.settings[:bin] = nil if options["binstubs"] && options["binstubs"].empty? Bundler.settings[:shebang] = options["shebang"] if options["shebang"] diff --git a/lib/bundler/definition.rb b/lib/bundler/definition.rb index 37cc4d9d..7ebad15e 100644 --- a/lib/bundler/definition.rb +++ b/lib/bundler/definition.rb @@ -376,9 +376,9 @@ module Bundler end end - msg << "\n\nYou have added to the Gemfile:\n" << added.join("\n") if added.any? + msg << "\n\nYou have added to the Gemfile:\n" << added.join("\n") if added.any? msg << "\n\nYou have deleted from the Gemfile:\n" << deleted.join("\n") if deleted.any? - msg << "\n\nYou have changed in the Gemfile:\n" << changed.join("\n") if changed.any? + msg << "\n\nYou have changed in the Gemfile:\n" << changed.join("\n") if changed.any? msg << "\n" raise ProductionError, msg if added.any? || deleted.any? || changed.any? diff --git a/lib/bundler/dsl.rb b/lib/bundler/dsl.rb index 0d0255ac..7928dcaa 100644 --- a/lib/bundler/dsl.rb +++ b/lib/bundler/dsl.rb @@ -302,8 +302,8 @@ module Bundler end end - opts["source"] ||= @source - opts["env"] ||= @env + opts["source"] ||= @source + opts["env"] ||= @env opts["platforms"] = platforms.dup opts["group"] = groups opts["should_include"] = install_if @@ -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/installer.rb b/lib/bundler/installer.rb index 3295fc84..3c9e5477 100644 --- a/lib/bundler/installer.rb +++ b/lib/bundler/installer.rb @@ -176,7 +176,7 @@ module Bundler # installation is just SO MUCH FASTER. so we let people opt in. def install(options) force = options["force"] - jobs = [Bundler.settings[:jobs].to_i-1, 1].max + jobs = [Bundler.settings[:jobs].to_i - 1, 1].max if jobs > 1 && can_install_in_parallel? require "bundler/installer/parallel_installer" install_in_parallel jobs, options[:standalone], force diff --git a/lib/bundler/installer/parallel_installer.rb b/lib/bundler/installer/parallel_installer.rb index fdc1ece7..b962563a 100644 --- a/lib/bundler/installer/parallel_installer.rb +++ b/lib/bundler/installer/parallel_installer.rb @@ -55,7 +55,7 @@ class ParallelInstaller # Returns max number of threads machine can handle with a min of 1 def self.max_threads - [Bundler.settings[:jobs].to_i-1, 1].max + [Bundler.settings[:jobs].to_i - 1, 1].max end def initialize(installer, all_specs, size, standalone, force) diff --git a/lib/bundler/ruby_version.rb b/lib/bundler/ruby_version.rb index 64b2742d..138262e3 100644 --- a/lib/bundler/ruby_version.rb +++ b/lib/bundler/ruby_version.rb @@ -32,10 +32,10 @@ module Bundler end def ==(other) - version == other.version && - engine == other.engine && + version == other.version && + engine == other.engine && engine_version == other.engine_version && - patchlevel == other.patchlevel + patchlevel == other.patchlevel end # Returns a tuple of these things: diff --git a/lib/bundler/similarity_detector.rb b/lib/bundler/similarity_detector.rb index dc770c42..2b90b266 100644 --- a/lib/bundler/similarity_detector.rb +++ b/lib/bundler/similarity_detector.rb @@ -10,16 +10,16 @@ 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.select {|s| s.distance <= limit }.sort_by(&:distance).map(&:string) end # return the result of 'similar_words', concatenated into a list # (eg "a, b, or c") def similar_word_list(word, limit = 3) words = similar_words(word,limit) - if words.length==1 + if words.length == 1 words[0] - elsif words.length>1 + elsif words.length > 1 [words[0..-2].join(", "), words[-1]].join(" or ") end end @@ -47,10 +47,10 @@ module Bundler for j in 1..this.length # critical comparison dm[i][j] = [ - dm[i-1][j-1] + - (this[j-1] == that[i-1] ? 0 : sub), - dm[i][j-1] + ins, - dm[i-1][j] + del + dm[i - 1][j - 1] + + (this[j - 1] == that[i - 1] ? 0 : sub), + dm[i][j - 1] + ins, + dm[i - 1][j] + del ].min end end diff --git a/lib/bundler/source/git.rb b/lib/bundler/source/git.rb index 400b0a65..4fcbd890 100644 --- a/lib/bundler/source/git.rb +++ b/lib/bundler/source/git.rb @@ -50,12 +50,7 @@ module Bundler end def eql?(o) - o.is_a?(Git) && - uri == o.uri && - ref == o.ref && - branch == o.branch && - name == o.name && - version == o.version && + o.is_a?(Git) && uri == o.uri && ref == o.ref && branch == o.branch && name == o.name && version == o.version && submodules == o.submodules end |