rubysl-abbrev 1.0.1 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 02a3bee1379681b0c89511e711375e82f2a83936
4
- data.tar.gz: acceaef513c3ff09ec2021881ca2a5c290dd1765
3
+ metadata.gz: a4e081d53efd8147b3ac2af9d865f692bfc7d86a
4
+ data.tar.gz: b1dbd05583d382564bf32f8f237d54c7999aae60
5
5
  SHA512:
6
- metadata.gz: 7f9f99ea62abc225cd3c226e0ec8e124d77de6bd1af42d5a5fde5df4561c72c22b1c2696c4ed3e4f203a83c9d2cfe029a0950663b38005978f04e7f5d4a31081
7
- data.tar.gz: 78d394fa7631fd8e3983af944e33ce71883b24f56d1f7d7a110071d86aa8935da800b3f67acb41afbe2d17a9bdf4b90d7d8ad166717d56449636e29fde41bec6
6
+ metadata.gz: 174cb0b14cc4fee25787c4d7f878dc4c206ef7a13a96529d500f9d70887cbc783b6c946463d217d1e113cd344561ef32686afccb0687c2cd960ae800de8c9a43
7
+ data.tar.gz: a05356117a5b408c7d312de7d83da3d93eed80aed0fc79e65bec3cbd0e578a050a44c7f08b797edde5684bc3151acdb8ae474a2652495494a76f1d149df1aac5
@@ -3,5 +3,5 @@ env:
3
3
  - RUBYLIB=lib
4
4
  script: bundle exec mspec
5
5
  rvm:
6
- - 1.8.7
7
- - rbx-nightly-18mode
6
+ - 1.9.3
7
+ - rbx-nightly-19mode
@@ -1,6 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
- =begin
3
- #
2
+ #--
4
3
  # Copyright (c) 2001,2003 Akinori MUSHA <knu@iDaemons.org>
5
4
  #
6
5
  # All rights reserved. You can redistribute and/or modify it under
@@ -8,8 +7,8 @@
8
7
  #
9
8
  # $Idaemons: /home/cvs/rb/abbrev.rb,v 1.2 2001/05/30 09:37:45 knu Exp $
10
9
  # $RoughId: abbrev.rb,v 1.4 2003/10/14 19:45:42 knu Exp $
11
- # $Id: abbrev.rb 11708 2007-02-12 23:01:19Z shyouhei $
12
- =end
10
+ # $Id: abbrev.rb 31635 2011-05-18 21:19:18Z drbrain $
11
+ #++
13
12
 
14
13
  # Calculate the set of unique abbreviations for a given set of strings.
15
14
  #
@@ -46,24 +45,24 @@ module Abbrev
46
45
  seen = Hash.new(0)
47
46
 
48
47
  if pattern.is_a?(String)
49
- pattern = /^#{Regexp.quote(pattern)}/ # regard as a prefix
48
+ pattern = /^#{Regexp.quote(pattern)}/ # regard as a prefix
50
49
  end
51
50
 
52
51
  words.each do |word|
53
52
  next if (abbrev = word).empty?
54
53
  while (len = abbrev.rindex(/[\w\W]\z/)) > 0
55
- abbrev = word[0,len]
54
+ abbrev = word[0,len]
56
55
 
57
- next if pattern && pattern !~ abbrev
56
+ next if pattern && pattern !~ abbrev
58
57
 
59
- case seen[abbrev] += 1
60
- when 1
61
- table[abbrev] = word
62
- when 2
63
- table.delete(abbrev)
64
- else
65
- break
66
- end
58
+ case seen[abbrev] += 1
59
+ when 1
60
+ table[abbrev] = word
61
+ when 2
62
+ table.delete(abbrev)
63
+ else
64
+ break
65
+ end
67
66
  end
68
67
  end
69
68
 
@@ -1,5 +1,5 @@
1
1
  module RubySL
2
2
  module Abbrev
3
- VERSION = "1.0.1"
3
+ VERSION = "2.0.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubysl-abbrev
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Shirai