diff options
-rw-r--r-- | .rubocop_todo.yml | 6 | ||||
-rw-r--r-- | lib/bundler/similarity_detector.rb | 6 | ||||
-rw-r--r-- | lib/bundler/source/git/git_proxy.rb | 4 |
3 files changed, 5 insertions, 11 deletions
diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index bb51e10b..f6407186 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -431,12 +431,6 @@ Style/SingleSpaceBeforeFirstArg: Style/SpaceAfterComma: Enabled: false -# Offense count: 7 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, SupportedStyles. -Style/SpaceAroundEqualsInParameterDefault: - Enabled: false - # Offense count: 55 # Cop supports --auto-correct. # Configuration parameters: MultiSpaceAllowedForOperators. diff --git a/lib/bundler/similarity_detector.rb b/lib/bundler/similarity_detector.rb index 32c3d7f7..d67bfbae 100644 --- a/lib/bundler/similarity_detector.rb +++ b/lib/bundler/similarity_detector.rb @@ -8,14 +8,14 @@ module Bundler end # return an array of words similar to 'word' from the corpus - def similar_words(word, limit=3) + 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) end # return the result of 'similar_words', concatenated into a list # (eg "a, b, or c") - def similar_word_list(word, limit=3) + def similar_word_list(word, limit = 3) words = similar_words(word,limit) if words.length==1 words[0] @@ -27,7 +27,7 @@ module Bundler protected # http://www.informit.com/articles/article.aspx?p=683059&seqNum=36 - def levenshtein_distance(this, that, ins=2, del=2, sub=1) + def levenshtein_distance(this, that, ins = 2, del = 2, sub = 1) # ins, del, sub are weighted costs return nil if this.nil? return nil if that.nil? diff --git a/lib/bundler/source/git/git_proxy.rb b/lib/bundler/source/git/git_proxy.rb index d406b11e..28c03f6e 100644 --- a/lib/bundler/source/git/git_proxy.rb +++ b/lib/bundler/source/git/git_proxy.rb @@ -77,7 +77,7 @@ module Bundler end end - def copy_to(destination, submodules=false) + def copy_to(destination, submodules = false) # method 1 unless File.exist?(destination.join(".git")) begin @@ -120,7 +120,7 @@ module Bundler end end - def git(command, check_errors=true) + def git(command, check_errors = true) raise GitNotAllowedError.new(command) unless allow? out = SharedHelpers.with_clean_git_env { %x{git #{command}} } raise GitCommandError.new(command, path) if check_errors && !$?.success? |