address_tokens 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/lib/address_tokens/version.rb +1 -1
- data/lib/finder.rb +7 -5
- metadata +2 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 57f40529898c8433cee9e911cc86a7577b0dadfc
|
4
|
+
data.tar.gz: 9fc8d116b1e30b27c4d72243f2e3c8cf4464c40c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 261b589522ce643951e95b46d7e631f91b97824b1b5a6d467cc19c43f3eedac627cf0ef384e2c0517208b55f3543d238703277defed1146ccdf8a3e2a7f16c3c
|
7
|
+
data.tar.gz: 9ca34c807a9cf969851676f0374f5c351abf9fc7c7eb692acfa2589226a0af1bda22113c40c6345efde261da6a6e909744f1f87e3b37d970dbc4ebf4f087c3e5
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/finder.rb
CHANGED
@@ -6,8 +6,7 @@ module AddressTokens
|
|
6
6
|
attr_accessor :states, :cities, :state_separator, :string
|
7
7
|
attr_reader :city_tokens
|
8
8
|
|
9
|
-
def initialize(str)
|
10
|
-
raise Exception, 'String is null or empty' if str.strip.size < 1
|
9
|
+
def initialize(str = nil)
|
11
10
|
@string, @states, @cities, = str, {}, {}
|
12
11
|
I18n.config.available_locales = :en
|
13
12
|
@state_separator = ','
|
@@ -18,10 +17,13 @@ module AddressTokens
|
|
18
17
|
end
|
19
18
|
|
20
19
|
def find(str = nil)
|
21
|
-
raise ArgumentError, 'No states found'
|
22
|
-
raise ArgumentError, 'No cities found'
|
20
|
+
raise ArgumentError, 'No states found' if @states.size == 0
|
21
|
+
raise ArgumentError, 'No cities found' if @cities.size == 0
|
23
22
|
transliterate_cities
|
24
|
-
|
23
|
+
|
24
|
+
what = str || @string
|
25
|
+
raise Exception, 'String is null or empty' if what.to_s.strip.size < 1
|
26
|
+
Matcher.new(self).match(what)
|
25
27
|
end
|
26
28
|
|
27
29
|
private
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: address_tokens
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eustaquio Rangel
|
@@ -131,7 +131,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
131
131
|
version: '0'
|
132
132
|
requirements: []
|
133
133
|
rubyforge_project:
|
134
|
-
rubygems_version: 2.
|
134
|
+
rubygems_version: 2.6.8
|
135
135
|
signing_key:
|
136
136
|
specification_version: 4
|
137
137
|
summary: Find address tokens on a string
|
metadata.gz.sig
CHANGED
Binary file
|