summaryrefslogtreecommitdiff
path: root/lib/abbrev.rb
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-05-18 21:19:18 +0000
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-05-18 21:19:18 +0000
commit7bbf2f308580f468802cd7d32c94fce1b9f1779e (patch)
tree0a680f59e70a78d60e776d7b763e618fb2fec624 /lib/abbrev.rb
parent34276148c4450faa77bb298cfbe005f7c263f802 (diff)
* lib: Convert tabs to spaces for ruby files per
http://redmine.ruby-lang.org/projects/ruby/wiki/DeveloperHowto#coding-style Patch by Steve Klabnik [Ruby 1.9 - Bug #4730] Patch by Jason Dew [Ruby 1.9 - Feature #4718] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31635 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/abbrev.rb')
-rw-r--r--lib/abbrev.rb22
1 files changed, 11 insertions, 11 deletions
diff --git a/lib/abbrev.rb b/lib/abbrev.rb
index 60dfd3a6d8..aa7e33a65d 100644
--- a/lib/abbrev.rb
+++ b/lib/abbrev.rb
@@ -45,24 +45,24 @@ module Abbrev
seen = Hash.new(0)
if pattern.is_a?(String)
- pattern = /^#{Regexp.quote(pattern)}/ # regard as a prefix
+ pattern = /^#{Regexp.quote(pattern)}/ # regard as a prefix
end
words.each do |word|
next if (abbrev = word).empty?
while (len = abbrev.rindex(/[\w\W]\z/)) > 0
- abbrev = word[0,len]
+ abbrev = word[0,len]
- next if pattern && pattern !~ abbrev
+ next if pattern && pattern !~ abbrev
- case seen[abbrev] += 1
- when 1
- table[abbrev] = word
- when 2
- table.delete(abbrev)
- else
- break
- end
+ case seen[abbrev] += 1
+ when 1
+ table[abbrev] = word
+ when 2
+ table.delete(abbrev)
+ else
+ break
+ end
end
end