fuzzy-string-match 0.9.5 → 0.9.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- NTMxMjIwZDNmNTg3MzVkNjIxNDEwMTQzOWQ4NzI5MTkyYWQzMWE4MQ==
5
- data.tar.gz: !binary |-
6
- NmE1NWJlYmI0ZTVlNTUzNjY4MzhhYTQ5Yzk5MDU1ZGJjODJmZTUwNw==
7
- !binary "U0hBNTEy":
8
- metadata.gz: !binary |-
9
- NzVlODllOTIzYzU0NWU5MjIxNTVhOGFjMWViNjZlN2NmMjM5MmU1MjM4ODli
10
- ZTRmZDY4NDkyYzc3ZjJiZTlmNzQ2MWFkZGE1ZDMyZTIxMTNlNzg1NDc1ZWI3
11
- ZDM5OGNhZmYyYjc2YmRlZTU0NDEzNWZlZWMyYmQ4M2E0MjcxZGQ=
12
- data.tar.gz: !binary |-
13
- ZTA4MzVmZWJjMGM3YjZkOGY2OGFjNmI1YjFkM2Y5MmYwZGFhOTIyOWVlMGNi
14
- NWJkYzhmZjc5YTZlNmYyMGJjNGVmZjBiNDc3ZGQwMGFiM2JkNDZmNWJlNGRk
15
- YzE1NmI3MGEzODBlNWQyZWIxYmJiZTA3YzUxOTJjNTNmNDRiY2I=
2
+ SHA1:
3
+ metadata.gz: b354a1f27f7029336168498837d8437b0affd8bc
4
+ data.tar.gz: b925921e5ef9e99fc21e72d256411769406de2ec
5
+ SHA512:
6
+ metadata.gz: 4d926213cf459a40ce0f0c2eeaab879f6f962816486719e1a29f6b06ef03c32a5f47e788a4fc0f1f0e2ff6a13e45b090ed1ddface8aa988d04dce7e1a92380cb
7
+ data.tar.gz: 593964ef2f4c325214ebc49c1f3db29667dbce5ec50d05dad2071f24e45f65a83cc753720372f3c0c495839bd7c90816daec803cdd2ace062866154f514b8d62
data/README.md CHANGED
@@ -17,10 +17,6 @@
17
17
 
18
18
  gem install fuzzy-string-match
19
19
 
20
- ## Installing (pure ruby version)
21
-
22
- gem install fuzzy-string-match_pure
23
-
24
20
  ## Features
25
21
  * Calculate Jaro-Winkler distance of two strings.
26
22
  * Pure ruby version can handle both ASCII and UTF8 strings. (and slow)
@@ -80,7 +76,7 @@
80
76
 
81
77
  ### for CRuby
82
78
  - RubyInline
83
- - Ruby 1.9.1 or higher
79
+ - Ruby 1.9.2 or higher ( includes RubyInstaller.org's CRuby on Windows )
84
80
 
85
81
  ### for JRuby
86
82
  - JRuby 1.6.6 or higher
@@ -95,4 +91,48 @@
95
91
  - <http://github.com/naoya/perl-text-jarowinkler>
96
92
 
97
93
  ## License
94
+
98
95
  - Apache 2.0 LICENSE
96
+
97
+ ## ChangeLog
98
+
99
+ ### 0.9.6 / Dec 21, 2013
100
+
101
+ * New feature: fuzzy-string-match falls back into pure ruby mode when c-compile fails.
102
+ * fuzzy-string-match_pure is obsolute gem
103
+
104
+ ### 0.9.5 / Mar 26, 2013
105
+
106
+ * Fixed: 'jarowinkler.rb:42: warning: implicit conversion shortens 64-bit value into a 32-bit value' on MacOS X 64bit env.
107
+
108
+ ### 0.9.4 / July 10, 2012
109
+
110
+ * Fixed: undefined method getDistance' error.
111
+
112
+ ### 0.9.3 / Feb 27, 2012
113
+
114
+ * Changed gem dependency of `rspec'.
115
+ gemspec.dependency( "rspec" ) to gemspec.development_dependency( "rspec" )
116
+
117
+ ### 0.9.2 / Feb 17, 2012
118
+
119
+ * Supported JRuby platform
120
+ * Divided into two gems.
121
+
122
+ 1. fuzzy-string-match ... native (RubyInline) version.
123
+ 2. fuzzy-string-match_pure ... pure ruby version
124
+
125
+ * Divided rspec files into several files.
126
+
127
+ * Supported testable gem
128
+ Please install rubygems-test and "gem test".
129
+
130
+ ### 0.9.1 / Jul 30, 2011
131
+
132
+ * Changed gcc compiler's option for RubyInline.
133
+
134
+ * Stoped to use obsolute method of RSpec.
135
+
136
+ ### 0.9.0 / Oct 12, 2010
137
+
138
+ * First release.
data/Rakefile CHANGED
@@ -3,7 +3,7 @@
3
3
  # Release Engineering
4
4
  # 1. edit the VERSION.yml file
5
5
  # 2. rake test
6
- # 3. rake gemspec && rake build
6
+ # 3. rake gemspec && gem build fuzzy-string-match.gemspec
7
7
  # to generate fuzzy-string-match-x.x.x.gem
8
8
  # 4. install fuzzy-string-match-x.x.x.gem to clean environment and test
9
9
  # 5. rake release
@@ -17,33 +17,12 @@ require 'rake'
17
17
  begin
18
18
  require 'jeweler2'
19
19
 
20
- Jeweler::Tasks.new do |gemspec|
21
- gemspec.name = "fuzzy-string-match_pure"
22
- gemspec.summary = "fuzzy string matching library (Pure ruby version)"
23
- gemspec.description = "calculate Jaro Winkler distance."
24
- gemspec.email = "kiyoka@sumibi.org"
25
- gemspec.homepage = "http://github.com/kiyoka/fuzzy-string-match"
26
- gemspec.authors = ["Kiyoka Nishiyama"]
27
- gemspec.files = FileList['.gemtest',
28
- 'Rakefile',
29
- 'VERSION.yml',
30
- 'lib/fuzzystringmatch/pure/jarowinkler.rb',
31
- 'lib/fuzzystringmatch/pure.rb',
32
- 'lib/fuzzystringmatch.rb',
33
- 'lib/*.rb',
34
- 'test/basic_pure_spec.rb',
35
- 'test/mutibyte_spec.rb',
36
- 'LICENSE.txt',
37
- 'README.md'].to_a
38
- gemspec.add_development_dependency( "rspec" )
39
- gemspec.required_ruby_version = '>= 1.9.1'
40
- end
41
-
42
20
  Jeweler::Tasks.new do |gemspec|
43
21
  gemspec.name = "fuzzy-string-match"
44
22
  gemspec.summary = "fuzzy string matching library"
45
23
  gemspec.description = "calculate Jaro Winkler distance."
46
24
  gemspec.email = "kiyoka@sumibi.org"
25
+ gemspec.license = 'Apache-2.0'
47
26
  gemspec.homepage = "http://github.com/kiyoka/fuzzy-string-match"
48
27
  gemspec.authors = ["Kiyoka Nishiyama"]
49
28
  gemspec.files = FileList['.gemtest',
@@ -71,12 +50,18 @@ end
71
50
  task :default => [:test] do
72
51
  end
73
52
 
74
- task :test do
53
+ task :test => [:fallback_test] do
75
54
  sh "ruby -I ./lib `which rspec` -b ./test/basic_native_spec.rb" if File.exist?( "./test/basic_native_spec.rb" )
76
55
  sh "ruby -I ./lib `which rspec` -b ./test/basic_pure_spec.rb"
77
56
  sh "ruby -I ./lib `which rspec` -b ./test/mutibyte_spec.rb"
78
57
  end
79
58
 
59
+ task :fallback_test => [:clean_dot_rubyinline] do
60
+ sh "/bin/mkdir -p /tmp/fake_gcc/"
61
+ sh "/bin/cp ./fake_gcc /tmp/fake_gcc/gcc"
62
+ sh "export PATH=\"/tmp/fake_gcc:${PATH}\" ; rspec -I ./lib ./test/fallback_pure_spec.rb"
63
+ end
64
+
80
65
  task :test_dev do
81
66
  sh "ruby -I ./lib `which rspec` -b ./test/verify_with_amatch_spec.rb"
82
67
  end
@@ -85,3 +70,6 @@ task :bench do
85
70
  sh "ruby ./benchmark/vs_amatch.rb"
86
71
  end
87
72
 
73
+ task :clean_dot_rubyinline do
74
+ sh "/bin/rm -rf ~/.ruby_inline"
75
+ end
data/VERSION.yml CHANGED
@@ -1,5 +1,5 @@
1
1
  ---
2
2
  :major: 0
3
3
  :minor: 9
4
- :patch: 5
4
+ :patch: 6
5
5
 
@@ -16,14 +16,6 @@
16
16
  # limitations under the License.
17
17
  #
18
18
  require 'fuzzystringmatch/pure'
19
- begin
20
- if RUBY_PLATFORM == "java"
21
- STDERR.puts "fuzzy-string-match Warning: native version is disabled on java platform. falled back to pure ruby version..."
22
- else
23
- require 'fuzzystringmatch/inline'
24
- end
25
- rescue LoadError
26
- end
27
19
 
28
20
  module FuzzyStringMatch
29
21
  class JaroWinkler
@@ -31,18 +23,27 @@ module FuzzyStringMatch
31
23
  case type
32
24
  when :pure
33
25
  FuzzyStringMatch::JaroWinklerPure.new
26
+
34
27
  when :native
35
- begin
36
- FuzzyStringMatch::JaroWinklerInline.new
37
- rescue NameError
38
- STDERR.puts "fuzzy-string-match Warning: native version is disabled. falled back to pure ruby version..."
28
+ if RUBY_PLATFORM == "java"
29
+ STDERR.puts "fuzzy-string-match Warning: native version is disabled on java platform. falled back to pure ruby version..."
39
30
  FuzzyStringMatch::JaroWinklerPure.new
31
+ else
32
+ begin
33
+ require 'fuzzystringmatch/inline'
34
+ begin
35
+ FuzzyStringMatch::JaroWinklerInline.new
36
+ rescue NameError
37
+ STDERR.puts "fuzzy-string-match Warning: native version is disabled. falled back to pure ruby version..."
38
+ FuzzyStringMatch::JaroWinklerPure.new
39
+ end
40
+ rescue CompilationError
41
+ STDERR.puts "fuzzy-string-match Warning: fallback into pure version, because compile failed."
42
+ FuzzyStringMatch::JaroWinklerPure.new
43
+ end
40
44
  end
41
45
  end
42
- end
43
- def create( type = :pure ) # this is obsolute
44
- STDERR.puts "fuzzy-string-match Warning: FuzzyStringMatch.new.create() is obsolute, please use FuzzyStringMatch.create() ..."
45
- FuzzyStringMatch::JaroWinkler.create( type )
46
+
46
47
  end
47
48
  end
48
49
  end
@@ -51,12 +51,8 @@ describe FuzzyStringMatch, "when some string distances (Native) are" do
51
51
  end
52
52
  end
53
53
 
54
- describe FuzzyStringMatch, "when older factory method was called, (Pure) are" do
55
- before do
56
- @jarow = FuzzyStringMatch::JaroWinkler.new.create
57
- end
54
+ describe FuzzyStringMatch, "when older factory method was called, (Native) are" do
58
55
  it "should" do
59
- @jarow.getDistance( "henka", "henkan" ).should be_within(0.0001).of(0.9722)
60
- @jarow.pure?( ).should be_true
56
+ lambda { FuzzyStringMatch::JaroWinkler.new.create( :native ) }.should raise_error(NoMethodError)
61
57
  end
62
58
  end
@@ -51,12 +51,9 @@ describe FuzzyStringMatch, "when some string distances (Pure) are" do
51
51
  end
52
52
  end
53
53
 
54
- describe FuzzyStringMatch, "when older factory method was called, (Pure) are" do
55
- before do
56
- @jarow = FuzzyStringMatch::JaroWinkler.new.create
57
- end
54
+ describe FuzzyStringMatch, "when older factory method was called, (Native) are" do
58
55
  it "should" do
59
- @jarow.getDistance( "henka", "henkan" ).should be_within(0.0001).of(0.9722)
60
- @jarow.pure?( ).should be_true
56
+ lambda { FuzzyStringMatch::JaroWinkler.new.create( :pure ) }.should raise_error(NoMethodError)
61
57
  end
62
58
  end
59
+
metadata CHANGED
@@ -1,69 +1,69 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fuzzy-string-match
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.5
4
+ version: 0.9.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kiyoka Nishiyama
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-03-26 00:00:00.000000000 Z
11
+ date: 2013-12-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ! '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ! '>='
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: RubyInline
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ! '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: 3.8.6
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ! '>='
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: 3.8.6
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ! '>='
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ! '>='
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: RubyInline
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ! '>='
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
61
  version: 3.8.6
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ! '>='
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: 3.8.6
69
69
  description: calculate Jaro Winkler distance.
@@ -74,7 +74,7 @@ extra_rdoc_files:
74
74
  - LICENSE.txt
75
75
  - README.md
76
76
  files:
77
- - .gemtest
77
+ - ".gemtest"
78
78
  - LICENSE.txt
79
79
  - README.md
80
80
  - Rakefile
@@ -88,7 +88,8 @@ files:
88
88
  - test/basic_pure_spec.rb
89
89
  - test/mutibyte_spec.rb
90
90
  homepage: http://github.com/kiyoka/fuzzy-string-match
91
- licenses: []
91
+ licenses:
92
+ - Apache-2.0
92
93
  metadata: {}
93
94
  post_install_message:
94
95
  rdoc_options: []
@@ -96,17 +97,17 @@ require_paths:
96
97
  - lib
97
98
  required_ruby_version: !ruby/object:Gem::Requirement
98
99
  requirements:
99
- - - ! '>='
100
+ - - ">="
100
101
  - !ruby/object:Gem::Version
101
102
  version: 1.9.1
102
103
  required_rubygems_version: !ruby/object:Gem::Requirement
103
104
  requirements:
104
- - - ! '>='
105
+ - - ">="
105
106
  - !ruby/object:Gem::Version
106
107
  version: '0'
107
108
  requirements: []
108
109
  rubyforge_project:
109
- rubygems_version: 2.0.3
110
+ rubygems_version: 2.0.14
110
111
  signing_key:
111
112
  specification_version: 4
112
113
  summary: fuzzy string matching library