valvat 0.8.2 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/.github/workflows/ruby.yml +35 -0
- data/.gitignore +3 -1
- data/.rubocop.yml +15 -0
- data/CHANGES.md +45 -1
- data/Gemfile +4 -3
- data/Guardfile +6 -4
- data/README.md +99 -47
- data/Rakefile +3 -1
- data/certs/yolk.pem +21 -21
- data/gemfiles/activemodel-5 +4 -5
- data/gemfiles/activemodel-6 +7 -0
- data/gemfiles/standalone +3 -5
- data/lib/active_model/validations/valvat_validator.rb +70 -22
- data/lib/valvat.rb +7 -3
- data/lib/valvat/checksum.rb +14 -13
- data/lib/valvat/checksum/at.rb +3 -1
- data/lib/valvat/checksum/be.rb +3 -1
- data/lib/valvat/checksum/bg.rb +17 -17
- data/lib/valvat/checksum/cy.rb +2 -0
- data/lib/valvat/checksum/de.rb +5 -3
- data/lib/valvat/checksum/dk.rb +3 -1
- data/lib/valvat/checksum/ee.rb +2 -0
- data/lib/valvat/checksum/es.rb +14 -16
- data/lib/valvat/checksum/fi.rb +3 -1
- data/lib/valvat/checksum/fr.rb +4 -2
- data/lib/valvat/checksum/gb.rb +53 -21
- data/lib/valvat/checksum/gr.rb +4 -2
- data/lib/valvat/checksum/hr.rb +2 -0
- data/lib/valvat/checksum/hu.rb +2 -0
- data/lib/valvat/checksum/ie.rb +5 -6
- data/lib/valvat/checksum/it.rb +6 -4
- data/lib/valvat/checksum/lt.rb +2 -0
- data/lib/valvat/checksum/lu.rb +3 -1
- data/lib/valvat/checksum/mt.rb +2 -0
- data/lib/valvat/checksum/nl.rb +9 -2
- data/lib/valvat/checksum/pl.rb +3 -1
- data/lib/valvat/checksum/pt.rb +3 -1
- data/lib/valvat/checksum/ro.rb +2 -0
- data/lib/valvat/checksum/se.rb +5 -3
- data/lib/valvat/checksum/si.rb +4 -2
- data/lib/valvat/error.rb +31 -0
- data/lib/valvat/local.rb +8 -5
- data/lib/valvat/locales/de.yml +2 -1
- data/lib/valvat/locales/en.yml +2 -1
- data/lib/valvat/locales/es.yml +1 -0
- data/lib/valvat/locales/fr.yml +18 -17
- data/lib/valvat/locales/hu.yml +1 -0
- data/lib/valvat/locales/nl.yml +1 -0
- data/lib/valvat/locales/pl.yml +1 -0
- data/lib/valvat/locales/pt.yml +28 -28
- data/lib/valvat/lookup.rb +14 -45
- data/lib/valvat/lookup/fault.rb +31 -0
- data/lib/valvat/lookup/request.rb +37 -11
- data/lib/valvat/lookup/response.rb +37 -0
- data/lib/valvat/syntax.rb +31 -30
- data/lib/valvat/utils.rb +20 -9
- data/lib/valvat/version.rb +3 -1
- data/spec/active_model/validations/valvat_validator_spec.rb +132 -100
- data/spec/spec_helper.rb +8 -8
- data/spec/valvat/checksum/at_spec.rb +8 -6
- data/spec/valvat/checksum/be_spec.rb +8 -6
- data/spec/valvat/checksum/bg_spec.rb +9 -6
- data/spec/valvat/checksum/cy_spec.rb +5 -3
- data/spec/valvat/checksum/de_spec.rb +8 -6
- data/spec/valvat/checksum/dk_spec.rb +8 -6
- data/spec/valvat/checksum/ee_spec.rb +5 -3
- data/spec/valvat/checksum/es_spec.rb +9 -6
- data/spec/valvat/checksum/fi_spec.rb +8 -6
- data/spec/valvat/checksum/fr_spec.rb +8 -6
- data/spec/valvat/checksum/gb_spec.rb +9 -5
- data/spec/valvat/checksum/gr_spec.rb +8 -6
- data/spec/valvat/checksum/hr_spec.rb +5 -3
- data/spec/valvat/checksum/hu_spec.rb +5 -3
- data/spec/valvat/checksum/ie_spec.rb +13 -5
- data/spec/valvat/checksum/it_spec.rb +12 -10
- data/spec/valvat/checksum/lt_spec.rb +5 -3
- data/spec/valvat/checksum/lu_spec.rb +8 -6
- data/spec/valvat/checksum/mt_spec.rb +5 -3
- data/spec/valvat/checksum/nl_spec.rb +9 -7
- data/spec/valvat/checksum/pl_spec.rb +10 -8
- data/spec/valvat/checksum/pt_spec.rb +12 -13
- data/spec/valvat/checksum/ro_spec.rb +5 -3
- data/spec/valvat/checksum/se_spec.rb +10 -8
- data/spec/valvat/checksum/si_spec.rb +12 -10
- data/spec/valvat/checksum_spec.rb +12 -10
- data/spec/valvat/lookup/fault_spec.rb +34 -0
- data/spec/valvat/lookup/request_spec.rb +19 -0
- data/spec/valvat/lookup/response_spec.rb +29 -0
- data/spec/valvat/lookup_spec.rb +202 -84
- data/spec/valvat/syntax_spec.rb +59 -280
- data/spec/valvat/utils_spec.rb +76 -42
- data/spec/valvat_spec.rb +140 -152
- data/valvat.gemspec +18 -17
- metadata +61 -41
- metadata.gz.sig +0 -0
- data/.travis.yml +0 -33
- data/gemfiles/activemodel-3-2 +0 -8
- data/gemfiles/activemodel-4 +0 -8
- data/gemfiles/before-ruby21/activemodel-3-2 +0 -9
- data/gemfiles/before-ruby21/activemodel-4 +0 -9
- data/gemfiles/before-ruby21/standalone +0 -8
- data/lib/valvat/lookup/request_with_id.rb +0 -31
metadata
CHANGED
@@ -1,40 +1,40 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: valvat
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sebastian Munz
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain:
|
11
11
|
- |
|
12
12
|
-----BEGIN CERTIFICATE-----
|
13
13
|
MIIELDCCApSgAwIBAgIBATANBgkqhkiG9w0BAQsFADAgMR4wHAYDVQQDDBVzZWJh
|
14
|
-
|
14
|
+
c3RpYW4vREM9eW8vREM9bGswHhcNMjEwMTA2MTAzMDU3WhcNMjIwMTA2MTAzMDU3
|
15
15
|
WjAgMR4wHAYDVQQDDBVzZWJhc3RpYW4vREM9eW8vREM9bGswggGiMA0GCSqGSIb3
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24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UM+tPKnU8Ojq6r9j5b5XrbxG8YSpwahva3Vap
|
30
|
+
1g0+3KzuWPpFjFen1VbS/Sb1cyE5uQtUj7lVcdhF3EFvzXkUMUUtJ4xsk114znFO
|
31
|
+
986sKab5AjlJ7TnsmPphCv/UXans7rAVB2lnozlt/kw6dcct5JD4kz1tD6AmO5Qd
|
32
|
+
jWRuKNZs66GBglRvseKoypXz1XDCCu1m/uI1IGmKnq8Ry+IeRq9RnlvbfPvSxRIx
|
33
|
+
9aowoL79T9plhcEcEX/KYRp8ht1z+3Vyk2UVZP8Xl5x+K44co5xdhljYi1gtw0w8
|
34
|
+
KzzULF0bF9oNpXwBEamlH2myNb19u1W8ijobQ7Y19ca8UFHr5LI32ZW5Zlmep8je
|
35
|
+
vb+o07oLRx3t2T/EO4DZ1w==
|
36
36
|
-----END CERTIFICATE-----
|
37
|
-
date:
|
37
|
+
date: 2021-01-15 00:00:00.000000000 Z
|
38
38
|
dependencies:
|
39
39
|
- !ruby/object:Gem::Dependency
|
40
40
|
name: savon
|
@@ -51,31 +51,45 @@ dependencies:
|
|
51
51
|
- !ruby/object:Gem::Version
|
52
52
|
version: 2.3.0
|
53
53
|
- !ruby/object:Gem::Dependency
|
54
|
-
name:
|
54
|
+
name: activemodel
|
55
55
|
requirement: !ruby/object:Gem::Requirement
|
56
56
|
requirements:
|
57
|
-
- - "
|
57
|
+
- - ">="
|
58
58
|
- !ruby/object:Gem::Version
|
59
|
-
version: '
|
59
|
+
version: '5.0'
|
60
60
|
type: :development
|
61
61
|
prerelease: false
|
62
62
|
version_requirements: !ruby/object:Gem::Requirement
|
63
63
|
requirements:
|
64
|
-
- - "
|
64
|
+
- - ">="
|
65
65
|
- !ruby/object:Gem::Version
|
66
|
-
version: '
|
66
|
+
version: '5.0'
|
67
67
|
- !ruby/object:Gem::Dependency
|
68
|
-
name:
|
68
|
+
name: rake
|
69
69
|
requirement: !ruby/object:Gem::Requirement
|
70
70
|
requirements:
|
71
71
|
- - ">="
|
72
72
|
- !ruby/object:Gem::Version
|
73
|
-
version: '
|
73
|
+
version: '0'
|
74
74
|
type: :development
|
75
75
|
prerelease: false
|
76
76
|
version_requirements: !ruby/object:Gem::Requirement
|
77
77
|
requirements:
|
78
78
|
- - ">="
|
79
|
+
- !ruby/object:Gem::Version
|
80
|
+
version: '0'
|
81
|
+
- !ruby/object:Gem::Dependency
|
82
|
+
name: rspec
|
83
|
+
requirement: !ruby/object:Gem::Requirement
|
84
|
+
requirements:
|
85
|
+
- - "~>"
|
86
|
+
- !ruby/object:Gem::Version
|
87
|
+
version: '3.0'
|
88
|
+
type: :development
|
89
|
+
prerelease: false
|
90
|
+
version_requirements: !ruby/object:Gem::Requirement
|
91
|
+
requirements:
|
92
|
+
- - "~>"
|
79
93
|
- !ruby/object:Gem::Version
|
80
94
|
version: '3.0'
|
81
95
|
description: Validates european vat numbers. Standalone or as a ActiveModel validator.
|
@@ -86,8 +100,9 @@ extensions: []
|
|
86
100
|
extra_rdoc_files: []
|
87
101
|
files:
|
88
102
|
- ".editorconfig"
|
103
|
+
- ".github/workflows/ruby.yml"
|
89
104
|
- ".gitignore"
|
90
|
-
- ".
|
105
|
+
- ".rubocop.yml"
|
91
106
|
- CHANGES.md
|
92
107
|
- Gemfile
|
93
108
|
- Guardfile
|
@@ -95,12 +110,8 @@ files:
|
|
95
110
|
- README.md
|
96
111
|
- Rakefile
|
97
112
|
- certs/yolk.pem
|
98
|
-
- gemfiles/activemodel-3-2
|
99
|
-
- gemfiles/activemodel-4
|
100
113
|
- gemfiles/activemodel-5
|
101
|
-
- gemfiles/
|
102
|
-
- gemfiles/before-ruby21/activemodel-4
|
103
|
-
- gemfiles/before-ruby21/standalone
|
114
|
+
- gemfiles/activemodel-6
|
104
115
|
- gemfiles/standalone
|
105
116
|
- lib/active_model/validations/valvat_validator.rb
|
106
117
|
- lib/valvat.rb
|
@@ -130,6 +141,7 @@ files:
|
|
130
141
|
- lib/valvat/checksum/ro.rb
|
131
142
|
- lib/valvat/checksum/se.rb
|
132
143
|
- lib/valvat/checksum/si.rb
|
144
|
+
- lib/valvat/error.rb
|
133
145
|
- lib/valvat/local.rb
|
134
146
|
- lib/valvat/locales/bg.yml
|
135
147
|
- lib/valvat/locales/ca.yml
|
@@ -152,8 +164,9 @@ files:
|
|
152
164
|
- lib/valvat/locales/sv.yml
|
153
165
|
- lib/valvat/locales/tr.yml
|
154
166
|
- lib/valvat/lookup.rb
|
167
|
+
- lib/valvat/lookup/fault.rb
|
155
168
|
- lib/valvat/lookup/request.rb
|
156
|
-
- lib/valvat/lookup/
|
169
|
+
- lib/valvat/lookup/response.rb
|
157
170
|
- lib/valvat/syntax.rb
|
158
171
|
- lib/valvat/utils.rb
|
159
172
|
- lib/valvat/version.rb
|
@@ -185,6 +198,9 @@ files:
|
|
185
198
|
- spec/valvat/checksum/se_spec.rb
|
186
199
|
- spec/valvat/checksum/si_spec.rb
|
187
200
|
- spec/valvat/checksum_spec.rb
|
201
|
+
- spec/valvat/lookup/fault_spec.rb
|
202
|
+
- spec/valvat/lookup/request_spec.rb
|
203
|
+
- spec/valvat/lookup/response_spec.rb
|
188
204
|
- spec/valvat/lookup_spec.rb
|
189
205
|
- spec/valvat/syntax_spec.rb
|
190
206
|
- spec/valvat/utils_spec.rb
|
@@ -194,7 +210,7 @@ homepage: https://github.com/yolk/valvat
|
|
194
210
|
licenses:
|
195
211
|
- MIT
|
196
212
|
metadata: {}
|
197
|
-
post_install_message:
|
213
|
+
post_install_message:
|
198
214
|
rdoc_options: []
|
199
215
|
require_paths:
|
200
216
|
- lib
|
@@ -202,15 +218,16 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
202
218
|
requirements:
|
203
219
|
- - ">="
|
204
220
|
- !ruby/object:Gem::Version
|
205
|
-
version:
|
221
|
+
version: 2.5.0
|
206
222
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
207
223
|
requirements:
|
208
224
|
- - ">="
|
209
225
|
- !ruby/object:Gem::Version
|
210
226
|
version: '0'
|
211
227
|
requirements: []
|
212
|
-
|
213
|
-
|
228
|
+
rubyforge_project:
|
229
|
+
rubygems_version: 2.7.6.2
|
230
|
+
signing_key:
|
214
231
|
specification_version: 4
|
215
232
|
summary: Validates european vat numbers. Standalone or as a ActiveModel validator.
|
216
233
|
test_files:
|
@@ -242,6 +259,9 @@ test_files:
|
|
242
259
|
- spec/valvat/checksum/se_spec.rb
|
243
260
|
- spec/valvat/checksum/si_spec.rb
|
244
261
|
- spec/valvat/checksum_spec.rb
|
262
|
+
- spec/valvat/lookup/fault_spec.rb
|
263
|
+
- spec/valvat/lookup/request_spec.rb
|
264
|
+
- spec/valvat/lookup/response_spec.rb
|
245
265
|
- spec/valvat/lookup_spec.rb
|
246
266
|
- spec/valvat/syntax_spec.rb
|
247
267
|
- spec/valvat/utils_spec.rb
|
metadata.gz.sig
CHANGED
Binary file
|
data/.travis.yml
DELETED
@@ -1,33 +0,0 @@
|
|
1
|
-
language: ruby
|
2
|
-
rvm:
|
3
|
-
- 2.6
|
4
|
-
- 2.5
|
5
|
-
- 2.4
|
6
|
-
- 2.3
|
7
|
-
- 2.2
|
8
|
-
- 2.1
|
9
|
-
- jruby-19mode
|
10
|
-
gemfile:
|
11
|
-
- gemfiles/activemodel-5
|
12
|
-
- gemfiles/activemodel-4
|
13
|
-
- gemfiles/activemodel-3-2
|
14
|
-
- gemfiles/standalone
|
15
|
-
matrix:
|
16
|
-
exclude:
|
17
|
-
- rvm: 2.1
|
18
|
-
gemfile: gemfiles/activemodel-5
|
19
|
-
- rvm: jruby-19mode
|
20
|
-
gemfile: gemfiles/activemodel-5
|
21
|
-
include:
|
22
|
-
- rvm: 2.0
|
23
|
-
gemfile: gemfiles/before-ruby21/activemodel-4
|
24
|
-
- rvm: 2.0
|
25
|
-
gemfile: gemfiles/before-ruby21/activemodel-3-2
|
26
|
-
- rvm: 2.0
|
27
|
-
gemfile: gemfiles/before-ruby21/standalone
|
28
|
-
- rvm: 1.9.3
|
29
|
-
gemfile: gemfiles/before-ruby21/activemodel-4
|
30
|
-
- rvm: 1.9.3
|
31
|
-
gemfile: gemfiles/before-ruby21/activemodel-3-2
|
32
|
-
- rvm: 1.9.3
|
33
|
-
gemfile: gemfiles/before-ruby21/standalone
|
data/gemfiles/activemodel-3-2
DELETED
data/gemfiles/activemodel-4
DELETED
@@ -1,31 +0,0 @@
|
|
1
|
-
class Valvat
|
2
|
-
class Lookup
|
3
|
-
class RequestWithId < Request
|
4
|
-
def initialize(vat, requester_vat)
|
5
|
-
@vat = vat
|
6
|
-
@requester_vat = requester_vat
|
7
|
-
end
|
8
|
-
|
9
|
-
private
|
10
|
-
|
11
|
-
def body
|
12
|
-
super.merge(
|
13
|
-
:requester_country_code => @requester_vat.vat_country_code,
|
14
|
-
:requester_vat_number => @requester_vat.to_s_wo_country
|
15
|
-
)
|
16
|
-
end
|
17
|
-
|
18
|
-
def message_tag
|
19
|
-
:checkVatApprox
|
20
|
-
end
|
21
|
-
|
22
|
-
def action
|
23
|
-
:check_vat_approx
|
24
|
-
end
|
25
|
-
|
26
|
-
def response_key
|
27
|
-
:check_vat_approx_response
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|