valvat 0.8.2 → 0.9.0

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: 0e7d92a2e8474b0badde3dfda893183f6109eed0d27cd485f7d3f22dfcae5723
4
- data.tar.gz: f347f0ed55567d2b2c770f9eed233159baa5570bffa75eefbe341d75fa9d292b
3
+ metadata.gz: 7897eba1d19df7531d3d3e89774c20eb24cc3000b4b2a79c1c120984cbb0fd8b
4
+ data.tar.gz: f03e192010dc4189222da7bbf4a6327ca418a1d7603b5819ad9707b39bdf4675
5
5
  SHA512:
6
- metadata.gz: 3b195b61b4fbd02643bd219d7727932542ebc9f5b7e67bef71d31307575554f5dee7545e2cc983862959414c5b4237929f46e6989600439333e5082454af9e70
7
- data.tar.gz: abedae554dd4f8b8a6d113df09a5e95990e454a43aca4c2723e8a966e86041ac2cd66fea812b66d5e5c039f9540c78b36e2574f7a7f82b67b90f549835255514
6
+ metadata.gz: 75cdc4f8ef17c43c21c4893cfe6cec832b33e0743d7a14f9b57dec4629a7d37b54c3388b673d442c4fc47b9030665371111fff721f78f906d16a668f0f0d38c6
7
+ data.tar.gz: bb3c8ef8f9d0680536ee33709e6ecc5ea9c82db0a757d99eb516bda04c1a6bbf8853d177bcca6807c0affa2325a9b51be834b73467266847932f5723158a4b14
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
Binary file
data/CHANGES.md CHANGED
@@ -1,6 +1,16 @@
1
+
1
2
  ### dev
2
3
 
3
- [full changelog](http://github.com/yolk/valvat/compare/v0.8.2...master)
4
+ [full changelog](http://github.com/yolk/valvat/compare/v0.9.0...master)
5
+
6
+ ### 0.9.0 / 2020-02-28
7
+
8
+ [full changelog](http://github.com/yolk/valvat/compare/v0.8.2...v0.9.0)
9
+
10
+ * Validate new dutch 2020 vat identification number (by [yvonnenieuwerth](https://github.com/yvonnenieuwerth))
11
+ * Set the country adjectives to masculine in FR locales (by [bobmaerten](https://github.com/bobmaerten))
12
+ * Fix greek country adjectif in french (by [bobmaerten](https://github.com/bobmaerten))
13
+ *
4
14
 
5
15
  ### 0.8.2 / 2019-11-15
6
16
 
data/README.md CHANGED
@@ -22,7 +22,7 @@ Add it to your Gemfile:
22
22
 
23
23
  gem 'valvat'
24
24
 
25
- To save most of the used memory and load only the local verification functionality – and not the remote lookup with VIES – add it like this instead:
25
+ To use less memory (~3.5 mb vs. ~0.5 mb) and load only the local verification functionality – and not the remote lookup with VIES – add it like this instead:
26
26
 
27
27
  gem 'valvat', :require => 'valvat/local'
28
28
 
@@ -1,6 +1,11 @@
1
1
  class Valvat
2
2
  module Checksum
3
3
  class NL < Base
4
+ def validate
5
+ vat.to_s.gsub(/[A-Z]/) { |let| (let.ord - 55).to_s }.to_i % 97 == 1 ||
6
+ super
7
+ end
8
+
4
9
  def check_digit
5
10
  sum_figures_by do |fig, i|
6
11
  fig*(i+2)
@@ -5,29 +5,29 @@ fr:
5
5
  valvat:
6
6
  country_adjectives:
7
7
  eu: intracommunautaire
8
- at: autrichienne
8
+ at: autrichien
9
9
  be: belge
10
10
  bg: bulgare
11
11
  cy: chypriote
12
12
  cz: tchèque
13
- de: allemande
14
- dk: danoise
13
+ de: allemand
14
+ dk: danois
15
15
  ee: estonien
16
- es: espagnole
17
- fi: finlandaise
18
- fr: française
16
+ es: espagnol
17
+ fi: finlandais
18
+ fr: français
19
19
  gb: britannique
20
- gr: grèque
21
- ie: irlandaise
22
- it: italienne
23
- lt: lituanienne
24
- lu: luxembourgeoise
25
- lv: lettone
20
+ gr: grec
21
+ ie: irlandais
22
+ it: italien
23
+ lt: lituanien
24
+ lu: luxembourgeois
25
+ lv: letton
26
26
  mt: maltais
27
- nl: hollandaise
28
- pl: polonaise
29
- pt: portugaise
30
- ro: roumaine
31
- se: suédoise
27
+ nl: hollandais
28
+ pl: polonais
29
+ pt: portugais
30
+ ro: roumain
31
+ se: suédois
32
32
  si: slovène
33
33
  sk: slovaque
@@ -1,3 +1,3 @@
1
1
  class Valvat
2
- VERSION = "0.8.2"
2
+ VERSION = "0.9.0"
3
3
  end
@@ -1,12 +1,12 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe Valvat::Checksum::NL do
4
- %w(NL123456782B12 NL802549391B01 NL808661863B01 NL820893559B01).each do |valid_vat|
4
+ %w(NL123456782B12 NL802549391B01 NL808661863B01 NL820893559B01 NL000099998B57 NL123456789B13).each do |valid_vat|
5
5
  it "returns true on valid vat #{valid_vat}" do
6
6
  expect(Valvat::Checksum.validate(valid_vat)).to eql(true)
7
7
  end
8
8
 
9
- invalid_vat = "#{valid_vat[0..-5]}#{valid_vat[-2]}#{valid_vat[-3]}#{valid_vat[-4]}#{valid_vat[-1]}"
9
+ invalid_vat = "#{valid_vat[0..-5]}#{valid_vat[-2]}#{valid_vat[-3]}#{valid_vat[-4]}#{valid_vat[-1]}#{valid_vat[-2]}#{valid_vat[-3]}"
10
10
 
11
11
  it "returns false on invalid vat #{invalid_vat}" do
12
12
  expect(Valvat::Checksum.validate(invalid_vat)).to eql(false)
@@ -1,3 +1,4 @@
1
+ # encoding: utf-8
1
2
  require 'spec_helper'
2
3
 
3
4
  describe Valvat::Utils do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: valvat
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.2
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sebastian Munz
@@ -34,7 +34,7 @@ cert_chain:
34
34
  rAFNAD1QEGN6elQdy1MRuXwjcUhM8P8ofLDEaE225TSZvAI+XoCxW2PSsQj5cGER
35
35
  9vbf6JSKzQPa/HeBoU0s1Q==
36
36
  -----END CERTIFICATE-----
37
- date: 2019-11-15 00:00:00.000000000 Z
37
+ date: 2020-02-28 00:00:00.000000000 Z
38
38
  dependencies:
39
39
  - !ruby/object:Gem::Dependency
40
40
  name: savon
metadata.gz.sig CHANGED
Binary file