valvat 0.6.2 → 0.6.3
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 +4 -4
- data/.rbenv-version +1 -1
- data/.travis.yml +1 -0
- data/CHANGES.md +7 -1
- data/README.md +6 -1
- data/lib/valvat/locales/pt.yml +3 -3
- data/lib/valvat/version.rb +1 -1
- data/spec/valvat/checksum/pt_spec.rb +19 -3
- data/spec/valvat/lookup_spec.rb +1 -1
- metadata +17 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f260253d1cce6ddf66bb80cc487645085d248e85
|
4
|
+
data.tar.gz: c696cc28bb9bd7b77858debbde44fe27402c1698
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1f9851b11d179fa9f8f3e544e4916b1f1edfd377c38ccd1ef0f2d7f43a342a1f07619fdcc96e1224fac67faae15962f4af8bb70a4f3078e13e85ff3fc7c4e523
|
7
|
+
data.tar.gz: c66a83b5b8f1fc1e16756b5b3efcabfde63abe5104443020002f41a899dbf53a03264b6ff61ddf12aace468f70b204087668e80e4dadaf0b1eeecb1cb59c3999
|
data/.rbenv-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.
|
1
|
+
2.1.0
|
data/.travis.yml
CHANGED
data/CHANGES.md
CHANGED
@@ -1,6 +1,12 @@
|
|
1
1
|
### dev
|
2
2
|
|
3
|
-
[full changelog](http://github.com/yolk/valvat/compare/v0.6.
|
3
|
+
[full changelog](http://github.com/yolk/valvat/compare/v0.6.3...master)
|
4
|
+
|
5
|
+
### 0.6.3 / 2014-04-05
|
6
|
+
|
7
|
+
[full changelog](http://github.com/yolk/valvat/compare/v0.6.2...v0.6.3)
|
8
|
+
|
9
|
+
* Fixed portuguese translations (by [Davidslv](https://github.com/Davidslv))
|
4
10
|
|
5
11
|
### 0.6.2 / 2013-11-10
|
6
12
|
|
data/README.md
CHANGED
@@ -176,6 +176,10 @@ To normalize a vat number:
|
|
176
176
|
|
177
177
|
This basically just removes trailing spaces and ensures all chars are uppercase.
|
178
178
|
|
179
|
+
## Usage with IPv6
|
180
|
+
|
181
|
+
There seems to be a problem when using the VIES service over IPv6. Sadly this is nothing this gem can address. For details and proposed solutions have a look at [this question on StackOverflow](http://stackoverflow.com/questions/15616833/vies-vat-api-soap-error-ipv6). Thanks to George Palmer for bringing up this issue.
|
182
|
+
|
179
183
|
## Links
|
180
184
|
|
181
185
|
* [VIES web service](http://ec.europa.eu/taxation_customs/vies)
|
@@ -184,6 +188,7 @@ This basically just removes trailing spaces and ensures all chars are uppercase.
|
|
184
188
|
|
185
189
|
## Contributions by
|
186
190
|
|
191
|
+
* [Davidslv](https://github.com/Davidslv)
|
187
192
|
* [brianphillips](https://github.com/brianphillips)
|
188
193
|
* [wasi](https://github.com/wasi)
|
189
194
|
* [liggitt](https://github.com/liggitt)
|
@@ -199,6 +204,6 @@ This basically just removes trailing spaces and ensures all chars are uppercase.
|
|
199
204
|
|
200
205
|
## BlaBla
|
201
206
|
|
202
|
-
Copyright (c) 2011-
|
207
|
+
Copyright (c) 2011-2014 Yolk Sebastian Munz & Julia Soergel GbR
|
203
208
|
|
204
209
|
Beyond that, the implementation is licensed under the MIT License.
|
data/lib/valvat/locales/pt.yml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
pt:
|
2
2
|
errors:
|
3
3
|
messages:
|
4
|
-
invalid_vat:
|
4
|
+
invalid_vat: O NIF %{country_adjective} não é válido.
|
5
5
|
valvat:
|
6
6
|
country_adjectives:
|
7
7
|
eu: europeu
|
@@ -22,7 +22,7 @@ pt:
|
|
22
22
|
ie: irlandês
|
23
23
|
it: italiano
|
24
24
|
lt: lituano
|
25
|
-
lu:
|
25
|
+
lu: luxemburguês
|
26
26
|
lv: letão
|
27
27
|
mt: maltês
|
28
28
|
nl: holandês
|
@@ -31,4 +31,4 @@ pt:
|
|
31
31
|
ro: romeno
|
32
32
|
se: sueco
|
33
33
|
si: esloveno
|
34
|
-
sk: eslovaco
|
34
|
+
sk: eslovaco
|
data/lib/valvat/version.rb
CHANGED
@@ -1,15 +1,31 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe Valvat::Checksum::PT do
|
4
|
+
|
5
|
+
subject { Valvat::Checksum }
|
6
|
+
|
4
7
|
%w(PT136695973 PT501413197 PT503037753 PT500243590 PT500100144 PT502921838).each do |valid_vat|
|
5
8
|
it "returns true on valid vat #{valid_vat}" do
|
6
|
-
|
9
|
+
subject.validate(valid_vat).should be_true
|
7
10
|
end
|
8
11
|
|
9
12
|
invalid_vat = "#{valid_vat[0..-5]}#{valid_vat[-1]}#{valid_vat[-4]}#{valid_vat[-2]}#{valid_vat[-3]}"
|
10
13
|
|
11
14
|
it "returns false on invalid vat #{invalid_vat}" do
|
12
|
-
|
15
|
+
subject.validate(invalid_vat).should be_false
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
# Portuguese business VAT should start with the following numbers
|
20
|
+
# 1 or 2 (pessoa singular) - singular person
|
21
|
+
# 5 (pessoa colectiva) - collective person
|
22
|
+
# 6 (pessoa colectiva pública) - public collective person
|
23
|
+
# 8 (empresário em nome individual) - individual enterpreneur
|
24
|
+
# 9 (pessoa colectiva irregular ou número provisório) - provisional number
|
25
|
+
# http://www.nif.pt/nif-das-empresas/
|
26
|
+
%w(PT148166644 PT111623448 PT204874866 PT292261314 PT579104222 PT628910002 PT812627318 PT943935784).each do |number|
|
27
|
+
it "returns true on a valid number - #{number}" do
|
28
|
+
subject.validate(number).should be_true
|
13
29
|
end
|
14
30
|
end
|
15
|
-
end
|
31
|
+
end
|
data/spec/valvat/lookup_spec.rb
CHANGED
@@ -56,7 +56,7 @@ describe Valvat::Lookup do
|
|
56
56
|
:country_code=>"IE",
|
57
57
|
:vat_number=>"6388047V",
|
58
58
|
:name=>"GOOGLE IRELAND LIMITED",
|
59
|
-
:address=>"
|
59
|
+
:address=>"3RD FLOOR ,GORDON HOUSE ,BARROW STREET ,DUBLIN 4"
|
60
60
|
})
|
61
61
|
else
|
62
62
|
puts "Skipping IE vies lookup spec; result = #{result.inspect}"
|
metadata
CHANGED
@@ -1,69 +1,69 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: valvat
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sebastian Munz
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-04-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: savon
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: 2.3.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 2.3.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rspec
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: 2.4.0
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: 2.4.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: activemodel
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '3.0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '3.0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: fakeweb
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: 1.3.0
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: 1.3.0
|
69
69
|
description: Validates european vat numbers. Standalone or as a ActiveModel validator.
|
@@ -73,10 +73,10 @@ executables: []
|
|
73
73
|
extensions: []
|
74
74
|
extra_rdoc_files: []
|
75
75
|
files:
|
76
|
-
- .gitignore
|
77
|
-
- .rbenv-gemsets
|
78
|
-
- .rbenv-version
|
79
|
-
- .travis.yml
|
76
|
+
- ".gitignore"
|
77
|
+
- ".rbenv-gemsets"
|
78
|
+
- ".rbenv-version"
|
79
|
+
- ".travis.yml"
|
80
80
|
- CHANGES.md
|
81
81
|
- Gemfile
|
82
82
|
- Guardfile
|
@@ -154,17 +154,17 @@ require_paths:
|
|
154
154
|
- lib
|
155
155
|
required_ruby_version: !ruby/object:Gem::Requirement
|
156
156
|
requirements:
|
157
|
-
- -
|
157
|
+
- - ">="
|
158
158
|
- !ruby/object:Gem::Version
|
159
159
|
version: '0'
|
160
160
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
161
161
|
requirements:
|
162
|
-
- -
|
162
|
+
- - ">="
|
163
163
|
- !ruby/object:Gem::Version
|
164
164
|
version: '0'
|
165
165
|
requirements: []
|
166
166
|
rubyforge_project:
|
167
|
-
rubygems_version: 2.0
|
167
|
+
rubygems_version: 2.2.0
|
168
168
|
signing_key:
|
169
169
|
specification_version: 4
|
170
170
|
summary: Validates european vat numbers. Standalone or as a ActiveModel validator.
|