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 +4 -4
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +1 -17
- data/lib/lite/address/format.rb +6 -16
- data/lib/lite/address/version.rb +1 -1
- data/lite-address.gemspec +0 -1
- metadata +2 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2a8abf901cfaea3220ceb8393d8e990cc2f3ebe7be8a22abb9f30e2689a5c0bf
|
4
|
+
data.tar.gz: '082132eaf65305e101ef1eb917e766f67ca4526de2c66a4e789a8ee320232ee5'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 561caa7bd5d4e308af9e3793e05b1b8571e5767317f9bfe41be71f701c75f7475ad0a3bfe4b31c80926ad0c31734b14f0fc28f486aef7fc902660813159d50d9
|
7
|
+
data.tar.gz: 724b9f38b91866c9d6130912977f5c5741064db77baf2ceb2dd78b5f7fc3144c2d69bf42aacdd43a3d5990a462dc1612b87ffeb12074f22d76231d2bfa7626b5
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,22 +1,14 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
lite-address (1.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
|
data/lib/lite/address/format.rb
CHANGED
@@ -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(
|
71
|
-
|
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
|
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
|
114
|
+
# rubocop:enable Metrics/AbcSize
|
125
115
|
|
126
116
|
end
|
127
117
|
|
data/lib/lite/address/version.rb
CHANGED
data/lite-address.gemspec
CHANGED
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.
|
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-
|
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
|