ibandit 0.4.0 → 0.4.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
  SHA1:
3
- metadata.gz: 386cd897ccb0d6fa59f8c7b6b4ca238dbf538713
4
- data.tar.gz: 2d23bf7a9bddbaf99152e1c0bef5619b3e0b81b3
3
+ metadata.gz: 13fadf39c8623f0ec3df9cef2b34e1b96b590f56
4
+ data.tar.gz: 64ebdb3aa4e4160fcc33ce1c0f52ab75b8c80865
5
5
  SHA512:
6
- metadata.gz: 0be4909e31e0db8f9d3fb691cb8f02704f84a0f9065b824ce145fff842ef72b4427facfc2e4e088ed0c02d165dbd9b133585a9c9dc6edc5ef2f1f85feafc678b
7
- data.tar.gz: 83b7e70b8b0c6fb74083285f871a7e2e2913992013fa0223a926606fd9647fddb81e7e3ba0d08178e846ff30049e5bf1d049507f6cc44f25c8e331e03420b0f5
6
+ metadata.gz: c6a1bff08fa9a2c135b7585154c9786a252d817c8f4d18659d0fc95165ad697938d34e5d70626d202064e941f1d16d844d1da2fe6074b4ad557002a751377d61
7
+ data.tar.gz: e77925edcff34a72037dd57deb84bc530ce11779a92ce8ce98d02b70ee2e197288a5b8d47b58b42c4e34e0930572b336f73099b7bf6852489aef81452414c52f
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 0.4.1 - April 28, 2015
2
+
3
+ - Add Spanish translation by [@alan](https://github.com/alan), [@sinjo](https://github.com/sinjo) and Jess Milligan
4
+
1
5
  ## 0.4.0 - April 24, 2015
2
6
 
3
7
  - Update length of national ID for Spain from 8 characters to 4, in line with
@@ -9,5 +9,3 @@ en:
9
9
  non_alphanumeric_characters: "Non-alphanumeric characters found: %{characters}"
10
10
  invalid_format: "Unexpected format for a %{country_code} IBAN."
11
11
  is_invalid: "is invalid"
12
-
13
-
@@ -0,0 +1,11 @@
1
+ es:
2
+ ibandit:
3
+ invalid_country_code: "'%{country_code}' no es un código de país ISO 3166-1 válido"
4
+ invalid_check_digits: "Los dígitos de control no han pasado la verificación de módulo. Se esperaba '%{expected_check_digits}', se ha recibido '%{check_digits}'."
5
+ invalid_length: "La longitud no corresponde a la especificación SWIFT (Se esperaba %{expected_length} símbolos, se ha recibido %{length})"
6
+ is_required: "es obligatorio"
7
+ wrong_length: "tiene la longitud equivocada (debería formarse de %{expected} símbolos)"
8
+ not_used_in_country: "esto no se utiliza en %{country_code}"
9
+ non_alphanumeric_characters: "Se han econtrado símbolos no alfanuméricos: %{characters}"
10
+ invalid_format: "Formato inesperado para un IBAN de %{country_code}."
11
+ is_invalid: "es inválido"
@@ -9,4 +9,3 @@ fr:
9
9
  non_alphanumeric_characters: "Caractères non alphanumériques présents : %{characters}"
10
10
  invalid_format: "Format inconnu pour l'IBAN %{country_code}."
11
11
  is_invalid: "est invalide"
12
-
@@ -9,5 +9,3 @@ pt:
9
9
  non_alphanumeric_characters: "Caracteres não alfanuméricos encontrados: %{characters}"
10
10
  invalid_format: "Formato errado para um IBAN %{country_code}."
11
11
  is_invalid: "é inválido"
12
-
13
-
data/ibandit.gemspec CHANGED
@@ -3,7 +3,7 @@ require File.expand_path('../lib/ibandit/version', __FILE__)
3
3
  Gem::Specification.new do |gem|
4
4
  gem.add_development_dependency 'rspec', '~> 3.1'
5
5
  gem.add_development_dependency 'rspec-its', '~> 1.1'
6
- gem.add_development_dependency 'rubocop', '~> 0.29.0'
6
+ gem.add_development_dependency 'rubocop', '~> 0.30.1'
7
7
  gem.add_development_dependency 'sax-machine', '~> 1.1'
8
8
  gem.add_development_dependency 'nokogiri', '~> 1.6'
9
9
 
@@ -1,3 +1,3 @@
1
1
  module Ibandit
2
- VERSION = '0.4.0'.freeze
2
+ VERSION = '0.4.1'.freeze
3
3
  end
@@ -199,6 +199,16 @@ describe Ibandit::IBAN do
199
199
  "recebidos '12'.")
200
200
  end
201
201
  end
202
+
203
+ context 'locale es', locale: :es do
204
+ it 'sets errors on the IBAN' do
205
+ iban.valid_check_digits?
206
+ expect(iban.errors).
207
+ to include(check_digits: 'Los dígitos de control no han pasado ' \
208
+ 'la verificación de módulo. Se ' \
209
+ "esperaba '82', se ha recibido '12'.")
210
+ end
211
+ end
202
212
  end
203
213
 
204
214
  context 'with invalid characters' do
@@ -270,6 +280,16 @@ describe Ibandit::IBAN do
270
280
  'SWIFT (esperados 22 caracteres, recebidos 20)')
271
281
  end
272
282
  end
283
+
284
+ context 'locale es', locale: :es do
285
+ it 'sets errors on the IBAN' do
286
+ iban.valid_length?
287
+ expect(iban.errors).
288
+ to include(length: 'La longitud no corresponde a la ' \
289
+ 'especificación SWIFT (Se esperaba 22 ' \
290
+ 'símbolos, se ha recibido 20)')
291
+ end
292
+ end
273
293
  end
274
294
 
275
295
  context 'with an invalid country_code' do
@@ -329,6 +349,15 @@ describe Ibandit::IBAN do
329
349
  'caracteres)')
330
350
  end
331
351
  end
352
+
353
+ context 'locale es', locale: :es do
354
+ it 'sets errors on the IBAN' do
355
+ iban.valid_bank_code_length?
356
+ expect(iban.errors).
357
+ to include(bank_code: 'tiene la longitud equivocada (debería ' \
358
+ 'formarse de 4 símbolos)')
359
+ end
360
+ end
332
361
  end
333
362
 
334
363
  context 'with an invalid country_code' do
@@ -388,6 +417,15 @@ describe Ibandit::IBAN do
388
417
  'caracteres)')
389
418
  end
390
419
  end
420
+
421
+ context 'locale es', locale: :es do
422
+ it 'sets errors on the IBAN' do
423
+ iban.valid_branch_code_length?
424
+ expect(iban.errors).
425
+ to include(branch_code: 'tiene la longitud equivocada (debería ' \
426
+ 'formarse de 6 símbolos)')
427
+ end
428
+ end
391
429
  end
392
430
 
393
431
  context 'without a branch code' do
@@ -421,6 +459,13 @@ describe Ibandit::IBAN do
421
459
  expect(iban.errors).to include(branch_code: 'é requerido')
422
460
  end
423
461
  end
462
+
463
+ context 'locale es', locale: :es do
464
+ it 'sets errors on the IBAN' do
465
+ iban.valid_branch_code_length?
466
+ expect(iban.errors).to include(branch_code: 'es obligatorio')
467
+ end
468
+ end
424
469
  end
425
470
 
426
471
  context 'with an invalid country_code' do
@@ -480,6 +525,15 @@ describe Ibandit::IBAN do
480
525
  'caracteres)')
481
526
  end
482
527
  end
528
+
529
+ context 'locale es', locale: :es do
530
+ it 'sets errors on the IBAN' do
531
+ iban.valid_account_number_length?
532
+ expect(iban.errors).
533
+ to include(account_number: 'tiene la longitud equivocada ' \
534
+ '(debería formarse de 8 símbolos)')
535
+ end
536
+ end
483
537
  end
484
538
 
485
539
  context 'with an invalid country_code' do
@@ -538,6 +592,15 @@ describe Ibandit::IBAN do
538
592
  'encontrados: -')
539
593
  end
540
594
  end
595
+
596
+ context 'locale es', locale: :es do
597
+ it 'sets errors on the IBAN' do
598
+ iban.valid_characters?
599
+ expect(iban.errors).
600
+ to include(characters: 'Se han econtrado símbolos no ' \
601
+ 'alfanuméricos: -')
602
+ end
603
+ end
541
604
  end
542
605
  end
543
606
 
@@ -584,6 +647,14 @@ describe Ibandit::IBAN do
584
647
  to include(format: 'Formato errado para um IBAN GB.')
585
648
  end
586
649
  end
650
+
651
+ context 'locale es', locale: :es do
652
+ it 'sets errors on the IBAN' do
653
+ iban.valid_format?
654
+ expect(iban.errors).
655
+ to include(format: 'Formato inesperado para un IBAN de GB.')
656
+ end
657
+ end
587
658
  end
588
659
 
589
660
  context 'with an invalid country_code' do
@@ -639,6 +710,13 @@ describe Ibandit::IBAN do
639
710
  expect(iban.errors).to include(bank_code: 'é inválido')
640
711
  end
641
712
  end
713
+
714
+ context 'locale es', locale: :es do
715
+ it 'sets errors on the IBAN' do
716
+ iban.valid_bank_code_format?
717
+ expect(iban.errors).to include(bank_code: 'es inválido')
718
+ end
719
+ end
642
720
  end
643
721
 
644
722
  context 'with an invalid country code' do
@@ -703,6 +781,13 @@ describe Ibandit::IBAN do
703
781
  expect(iban.errors).to include(branch_code: 'é inválido')
704
782
  end
705
783
  end
784
+
785
+ context 'locale es', locale: :es do
786
+ it 'sets errors on the IBAN' do
787
+ iban.valid_branch_code_format?
788
+ expect(iban.errors).to include(branch_code: 'es inválido')
789
+ end
790
+ end
706
791
  end
707
792
 
708
793
  context 'with an invalid country code' do
@@ -766,6 +851,13 @@ describe Ibandit::IBAN do
766
851
  expect(iban.errors).to include(account_number: 'é inválido')
767
852
  end
768
853
  end
854
+
855
+ context 'locale es', locale: :es do
856
+ it 'sets errors on the IBAN' do
857
+ iban.valid_account_number_format?
858
+ expect(iban.errors).to include(account_number: 'es inválido')
859
+ end
860
+ end
769
861
  end
770
862
 
771
863
  context 'with an invalid country code' do
@@ -827,6 +919,10 @@ describe Ibandit::IBAN do
827
919
  specify { expect(iban.errors).to include(bank_code: 'é inválido') }
828
920
  end
829
921
 
922
+ context 'locale es', locale: :es do
923
+ specify { expect(iban.errors).to include(bank_code: 'es inválido') }
924
+ end
925
+
830
926
  context 'when the bank code is not required' do
831
927
  let(:iban_code) { 'GB60BARC20000055779911' }
832
928
  before { Ibandit.bic_finder = double(call: 'BARCGB22XXX') }
@@ -857,6 +953,12 @@ describe Ibandit::IBAN do
857
953
  expect(iban.errors).to include(branch_code: 'é inválido')
858
954
  end
859
955
  end
956
+
957
+ context 'locale es', locale: :es do
958
+ specify do
959
+ expect(iban.errors).to include(branch_code: 'es inválido')
960
+ end
961
+ end
860
962
  end
861
963
  end
862
964
 
@@ -888,6 +990,12 @@ describe Ibandit::IBAN do
888
990
  expect(iban.errors).to include(account_number: 'é inválido')
889
991
  end
890
992
  end
993
+
994
+ context 'locale es', locale: :es do
995
+ specify do
996
+ expect(iban.errors).to include(account_number: 'es inválido')
997
+ end
998
+ end
891
999
  end
892
1000
  end
893
1001
  end
data/spec/spec_helper.rb CHANGED
@@ -26,3 +26,7 @@ end
26
26
  RSpec.shared_context 'locale pt', locale: :pt do
27
27
  around { |example| I18n.with_locale(:pt) { example.run } }
28
28
  end
29
+
30
+ RSpec.shared_context 'locale es', locale: :es do
31
+ around { |example| I18n.with_locale(:es) { example.run } }
32
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ibandit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Grey Baker
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-24 00:00:00.000000000 Z
11
+ date: 2015-04-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - ~>
46
46
  - !ruby/object:Gem::Version
47
- version: 0.29.0
47
+ version: 0.30.1
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
- version: 0.29.0
54
+ version: 0.30.1
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: sax-machine
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -116,6 +116,7 @@ files:
116
116
  - bin/build_structure_file.rb
117
117
  - config/locales/de.yml
118
118
  - config/locales/en.yml
119
+ - config/locales/es.yml
119
120
  - config/locales/fr.yml
120
121
  - config/locales/pt.yml
121
122
  - data/german_iban_rules.yml