lite-address 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c29871c0adebc108e69481fd2029bbcb3d9176670e7b1d82d0cff2f83dc74a6e
4
- data.tar.gz: 3a93c78446f6d75d78a9a8ba7e1af9137dd569704ed5abf88606a21f1b60c87b
3
+ metadata.gz: 2a8abf901cfaea3220ceb8393d8e990cc2f3ebe7be8a22abb9f30e2689a5c0bf
4
+ data.tar.gz: '082132eaf65305e101ef1eb917e766f67ca4526de2c66a4e789a8ee320232ee5'
5
5
  SHA512:
6
- metadata.gz: 800cb307c14b5f64acffa705694ada48b2e6f7d9224a4d20c8db6486da02a7e20ce65225df6095d566adefec953143e9ffaa5be28a10cea5e3e854de0e4cb1d1
7
- data.tar.gz: 34c1856153094313069ab2b687dc867d8570330416fc1c3569febdc87d1f015ea94a09019bcea7083752ce561c91d5eb926f982633d885ab81b8e945242a8291
6
+ metadata.gz: 561caa7bd5d4e308af9e3793e05b1b8571e5767317f9bfe41be71f701c75f7475ad0a3bfe4b31c80926ad0c31734b14f0fc28f486aef7fc902660813159d50d9
7
+ data.tar.gz: 724b9f38b91866c9d6130912977f5c5741064db77baf2ceb2dd78b5f7fc3144c2d69bf42aacdd43a3d5990a462dc1612b87ffeb12074f22d76231d2bfa7626b5
data/CHANGELOG.md CHANGED
@@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [1.0.1] - 2021-09-09
10
+ ### Changed
11
+ - Remove snail dependency
12
+
9
13
  ## [1.0.0] - 2021-09-09
10
14
  ### Added
11
15
  - Initial project version
data/Gemfile.lock CHANGED
@@ -1,22 +1,14 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- lite-address (1.0.0)
4
+ lite-address (1.0.1)
5
5
  countries
6
- snail
7
6
 
8
7
  GEM
9
8
  remote: https://rubygems.org/
10
9
  specs:
11
- activesupport (6.1.4.1)
12
- concurrent-ruby (~> 1.0, >= 1.0.2)
13
- i18n (>= 1.6, < 2)
14
- minitest (>= 5.1)
15
- tzinfo (~> 2.0)
16
- zeitwerk (~> 2.3)
17
10
  ast (2.4.2)
18
11
  colorize (0.8.1)
19
- concurrent-ruby (1.1.9)
20
12
  countries (4.0.1)
21
13
  i18n_data (~> 0.13.0)
22
14
  sixarm_ruby_unaccent (~> 1.1)
@@ -24,10 +16,7 @@ GEM
24
16
  fasterer (0.9.0)
25
17
  colorize (~> 0.7)
26
18
  ruby_parser (>= 3.14.1)
27
- i18n (1.8.10)
28
- concurrent-ruby (~> 1.0)
29
19
  i18n_data (0.13.0)
30
- minitest (5.14.4)
31
20
  parallel (1.20.2)
32
21
  parser (3.0.2.0)
33
22
  ast (~> 2.4.1)
@@ -72,12 +61,7 @@ GEM
72
61
  sexp_processor (~> 4.15, >= 4.15.1)
73
62
  sexp_processor (4.15.3)
74
63
  sixarm_ruby_unaccent (1.2.0)
75
- snail (2.2.3)
76
- activesupport
77
- tzinfo (2.0.4)
78
- concurrent-ruby (~> 1.0)
79
64
  unicode-display_width (2.0.0)
80
- zeitwerk (2.4.2)
81
65
 
82
66
  PLATFORMS
83
67
  x86_64-darwin-20
@@ -1,7 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'snail' unless defined?(Snail)
4
-
5
3
  module Lite
6
4
  module Address
7
5
 
@@ -67,8 +65,10 @@ module Lite
67
65
  end
68
66
  end
69
67
 
70
- def to_snail(options = {})
71
- Snail.new(snail_params.merge(options)).to_s
68
+ def to_snail(prefixes: [], include_country: false)
69
+ prefixes.push(line1, line2)
70
+ prefixes.push(country_name) if include_country
71
+ prefixes.compact.join("\n")
72
72
  end
73
73
 
74
74
  def to_ukey
@@ -84,7 +84,7 @@ module Lite
84
84
 
85
85
  private
86
86
 
87
- # rubocop:disable Metrics/AbcSize, Naming/VariableNumber
87
+ # rubocop:disable Metrics/AbcSize
88
88
  def address_line1
89
89
  parts = []
90
90
  parts << number
@@ -98,16 +98,6 @@ module Lite
98
98
  parts
99
99
  end
100
100
 
101
- def snail_params
102
- {
103
- line_1: line1,
104
- city: city,
105
- region: state,
106
- postal_code: full_postal_code,
107
- country: country_code
108
- }
109
- end
110
-
111
101
  def intersection_line1
112
102
  parts = []
113
103
  parts << prefix
@@ -121,7 +111,7 @@ module Lite
121
111
  parts << suffix2
122
112
  parts
123
113
  end
124
- # rubocop:enable Metrics/AbcSize, Naming/VariableNumber
114
+ # rubocop:enable Metrics/AbcSize
125
115
 
126
116
  end
127
117
 
@@ -3,7 +3,7 @@
3
3
  module Lite
4
4
  module Address
5
5
 
6
- VERSION = '1.0.0'
6
+ VERSION = '1.0.1'
7
7
 
8
8
  end
9
9
  end
data/lite-address.gemspec CHANGED
@@ -38,7 +38,6 @@ Gem::Specification.new do |spec|
38
38
  spec.require_paths = %w[lib]
39
39
 
40
40
  spec.add_dependency 'countries'
41
- spec.add_dependency 'snail'
42
41
 
43
42
  spec.add_development_dependency 'bundler'
44
43
  spec.add_development_dependency 'fasterer'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lite-address
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juan Gomez
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-09-09 00:00:00.000000000 Z
11
+ date: 2021-09-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: countries
@@ -24,20 +24,6 @@ dependencies:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
- - !ruby/object:Gem::Dependency
28
- name: snail
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - ">="
32
- - !ruby/object:Gem::Version
33
- version: '0'
34
- type: :runtime
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - ">="
39
- - !ruby/object:Gem::Version
40
- version: '0'
41
27
  - !ruby/object:Gem::Dependency
42
28
  name: bundler
43
29
  requirement: !ruby/object:Gem::Requirement