address_tokens 0.1.5 → 0.1.6

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
- SHA256:
3
- metadata.gz: 67224c3981213d1d9db250955d11fef6d4475fb7afbbe244119d661882d280b0
4
- data.tar.gz: 6f8967dacb29132f3b9a9ba0695bc4b7ade6238dc9fbf4a874b8dab3f11b8fc5
2
+ SHA1:
3
+ metadata.gz: 57f40529898c8433cee9e911cc86a7577b0dadfc
4
+ data.tar.gz: 9fc8d116b1e30b27c4d72243f2e3c8cf4464c40c
5
5
  SHA512:
6
- metadata.gz: 4743ced0df89e1012fc4b9b867d024a571e91fc74ab819dd7afcf38c500040cc4020b1fef981557629f59124ff7842c27aa8f966c815f909de43824c04ce82dc
7
- data.tar.gz: 5cbffaf74365ee4a78dd782c62b8457a9512bd16ffc4288d8f9e9eb5780c56064f09e8f23817a5d42981278b3033b28ede2e8cc4ff03a430e8594649920eb561
6
+ metadata.gz: 261b589522ce643951e95b46d7e631f91b97824b1b5a6d467cc19c43f3eedac627cf0ef384e2c0517208b55f3543d238703277defed1146ccdf8a3e2a7f16c3c
7
+ data.tar.gz: 9ca34c807a9cf969851676f0374f5c351abf9fc7c7eb692acfa2589226a0af1bda22113c40c6345efde261da6a6e909744f1f87e3b37d970dbc4ebf4f087c3e5
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -1,3 +1,3 @@
1
1
  module AddressTokens
2
- VERSION = '0.1.5'
2
+ VERSION = '0.1.6'
3
3
  end
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' if @states.size == 0
22
- raise ArgumentError, 'No cities found' if @cities.size == 0
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
- Matcher.new(self).match(str || @string)
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.5
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.7.3
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