slide_rule 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +2 -0
- data/config/rubocop/disabled.yml +4 -0
- data/lib/slide_rule/distance_calculator.rb +2 -2
- data/lib/slide_rule/distance_calculators/day_of_month.rb +1 -0
- data/lib/slide_rule/version.rb +1 -1
- data/spec/slide_rule/distance_calculator_spec.rb +5 -5
- metadata +18 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ad1a7e41a1a14345029655bb3ede3e7c274fc885
|
4
|
+
data.tar.gz: f164640543e98e706e5067abca94133350abe771
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 29f83acc7009c6473696870459120a1348074d960d7e053191153dd539c2d428545111a881f06838c84193765504b7855e79f8b703c45fb894fa1d65e4de260b
|
7
|
+
data.tar.gz: ae9223f7203d59dd3f8e511c06579c93c8c520b5c7f184bddb7ae4eb991e1f40d13c3e6c88d59b8ca45ae7f1eb7fe344064d0c1262c48e2553d2c7202ccbf82b
|
data/.rubocop.yml
CHANGED
@@ -85,10 +85,10 @@ module SlideRule
|
|
85
85
|
def get_calculator(calculator)
|
86
86
|
return calculator.new if calculator.is_a?(Class)
|
87
87
|
|
88
|
-
klass_name =
|
88
|
+
klass_name = calculator.to_s.split('_').collect(&:capitalize).join.to_s
|
89
89
|
klass = begin
|
90
90
|
::SlideRule::DistanceCalculators.const_get(klass_name)
|
91
|
-
rescue
|
91
|
+
rescue ::NameError
|
92
92
|
nil
|
93
93
|
end
|
94
94
|
|
data/lib/slide_rule/version.rb
CHANGED
@@ -75,23 +75,23 @@ describe ::SlideRule::DistanceCalculator do
|
|
75
75
|
::SlideRule::DistanceCalculator.new(
|
76
76
|
description: {
|
77
77
|
weight: 0.80,
|
78
|
-
|
78
|
+
calculator: :levenshtein
|
79
79
|
},
|
80
80
|
date: {
|
81
81
|
weight: 0.90,
|
82
|
-
|
82
|
+
calculator: :day_of_month
|
83
83
|
}
|
84
84
|
)
|
85
85
|
end
|
86
86
|
|
87
|
-
it 'returns true if there is a match' do
|
87
|
+
it 'returns true if there is a match' do
|
88
88
|
example_1 = ExampleTransaction.new(description: 'Wells Fargo Dealer SVC', date: '2015-06-17')
|
89
89
|
example_2 = ExampleTransaction.new(description: 'Wells Fargo Dealer SVC', date: '2015-06-17')
|
90
90
|
|
91
91
|
expect(calculator.is_match?(example_1, example_2, 0.2)).to be(true)
|
92
92
|
end
|
93
93
|
|
94
|
-
it 'returns false if there is a match' do
|
94
|
+
it 'returns false if there is a match' do
|
95
95
|
example_1 = ExampleTransaction.new(description: 'Wells Fargo Dealer SVC', date: '2015-06-17')
|
96
96
|
example_2 = ExampleTransaction.new(description: 'Taco Bell', date: '2015-06-17')
|
97
97
|
|
@@ -191,7 +191,7 @@ describe ::SlideRule::DistanceCalculator do
|
|
191
191
|
rules = {
|
192
192
|
description: {
|
193
193
|
weight: 1.0,
|
194
|
-
|
194
|
+
type: CustomCalc
|
195
195
|
},
|
196
196
|
name: {
|
197
197
|
weight: 1.0,
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: slide_rule
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- mattnichols
|
@@ -9,12 +9,12 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-01-
|
12
|
+
date: 2016-01-14 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - ~>
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '1.0'
|
20
20
|
name: vladlev
|
@@ -22,13 +22,13 @@ dependencies:
|
|
22
22
|
type: :runtime
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
|
-
- - ~>
|
25
|
+
- - "~>"
|
26
26
|
- !ruby/object:Gem::Version
|
27
27
|
version: '1.0'
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - ~>
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '10'
|
34
34
|
name: rake
|
@@ -36,13 +36,13 @@ dependencies:
|
|
36
36
|
type: :development
|
37
37
|
version_requirements: !ruby/object:Gem::Requirement
|
38
38
|
requirements:
|
39
|
-
- - ~>
|
39
|
+
- - "~>"
|
40
40
|
- !ruby/object:Gem::Version
|
41
41
|
version: '10'
|
42
42
|
- !ruby/object:Gem::Dependency
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - ~>
|
45
|
+
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '0'
|
48
48
|
name: pry
|
@@ -50,13 +50,13 @@ dependencies:
|
|
50
50
|
type: :development
|
51
51
|
version_requirements: !ruby/object:Gem::Requirement
|
52
52
|
requirements:
|
53
|
-
- - ~>
|
53
|
+
- - "~>"
|
54
54
|
- !ruby/object:Gem::Version
|
55
55
|
version: '0'
|
56
56
|
- !ruby/object:Gem::Dependency
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - ~>
|
59
|
+
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '3'
|
62
62
|
name: rspec
|
@@ -64,13 +64,13 @@ dependencies:
|
|
64
64
|
type: :development
|
65
65
|
version_requirements: !ruby/object:Gem::Requirement
|
66
66
|
requirements:
|
67
|
-
- - ~>
|
67
|
+
- - "~>"
|
68
68
|
- !ruby/object:Gem::Version
|
69
69
|
version: '3'
|
70
70
|
- !ruby/object:Gem::Dependency
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- - ~>
|
73
|
+
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: '0'
|
76
76
|
name: rubocop
|
@@ -78,7 +78,7 @@ dependencies:
|
|
78
78
|
type: :development
|
79
79
|
version_requirements: !ruby/object:Gem::Requirement
|
80
80
|
requirements:
|
81
|
-
- - ~>
|
81
|
+
- - "~>"
|
82
82
|
- !ruby/object:Gem::Version
|
83
83
|
version: '0'
|
84
84
|
description: Calculates the distance between 2 arbitrary objects using specified fields and algorithms.
|
@@ -88,14 +88,15 @@ executables: []
|
|
88
88
|
extensions: []
|
89
89
|
extra_rdoc_files: []
|
90
90
|
files:
|
91
|
-
- .gitignore
|
92
|
-
- .rubocop.yml
|
93
|
-
- .travis.yml
|
91
|
+
- ".gitignore"
|
92
|
+
- ".rubocop.yml"
|
93
|
+
- ".travis.yml"
|
94
94
|
- CODE_OF_CONDUCT.md
|
95
95
|
- Gemfile
|
96
96
|
- LICENSE
|
97
97
|
- README.md
|
98
98
|
- Rakefile
|
99
|
+
- config/rubocop/disabled.yml
|
99
100
|
- lib/slide_rule.rb
|
100
101
|
- lib/slide_rule/distance_calculator.rb
|
101
102
|
- lib/slide_rule/distance_calculators/day_of_month.rb
|
@@ -118,12 +119,12 @@ require_paths:
|
|
118
119
|
- lib
|
119
120
|
required_ruby_version: !ruby/object:Gem::Requirement
|
120
121
|
requirements:
|
121
|
-
- -
|
122
|
+
- - ">="
|
122
123
|
- !ruby/object:Gem::Version
|
123
124
|
version: '0'
|
124
125
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
125
126
|
requirements:
|
126
|
-
- -
|
127
|
+
- - ">="
|
127
128
|
- !ruby/object:Gem::Version
|
128
129
|
version: '0'
|
129
130
|
requirements: []
|