ibanvalidator 0.1.2 → 0.1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: df9ef70e80f3f5a94807f4d814d037d416805bf2
4
- data.tar.gz: a7eebc7a2f2e702be45f1727ea43f61688da4078
3
+ metadata.gz: d5b2772a3fa9f13eaab3ed001c23139494403649
4
+ data.tar.gz: 58315bd4c85ffa6fa8f8e0f6d0f0655b30d0cedc
5
5
  SHA512:
6
- metadata.gz: 97a76394a50c53bed84c79ab7e8d44a8d94d5e71ed0bd62a21f893a0fa12b56daeb824e81f909ec8ceaef3028d0a9c260c17792c55bb58cb572d02ee2d1ce2d9
7
- data.tar.gz: 83da8bbef0b66c35f5c2cb32cff0418bc1f8f192065b907434b6db2c33d298708df6ad848aa640e33aa63b8caa2cb39b80e2c115de6d319269be58937b7d26ed
6
+ metadata.gz: a44ccca6b26456d2a872480723a9cc089c8c8e746dc522759f268ccffc8c0fd1587fc15f6ceb7c8754a59d4a0f3e3635176bffe91facdaea2b0e93bf40c533fb
7
+ data.tar.gz: 782d8ccbcc97d2b5d335edef8cd9ed8e1b1699ea9d6c3eb2ed16a86d151364c8e6ece62d056889bc31d6780bbe94536eabece0e993672ae252bd5601e989f0aa
data/README.md CHANGED
@@ -1,13 +1,12 @@
1
1
  # Ibanvalidator (under Construction)
2
2
 
3
- Ibanvalidator ist eine Ruby Library zum überüfen von IBANs. [Mehr Infos zur IBAN](https://de.wikipedia.org/wiki/IBAN)
3
+ Ibanvalidator ist eine Ruby/Rails Library zum überüfen von IBANs in > 60 Ländern. [Mehr Infos zur IBAN](https://de.wikipedia.org/wiki/IBAN)
4
4
 
5
5
  Es basiert auf der gem [iban-tools](http://github.com/iulianu/iban-tools) von [Iulianu](http://github.com/iulianu) die dann vom Team
6
6
  bei [AlphaSights](https://engineering.alphasights.com) weiterentwickelt wurde.
7
7
 
8
8
  Wir wollen diese gem weiterpflegen und zusätzliche Funktionen integrieren.
9
9
 
10
-
11
10
  ## Installation
12
11
 
13
12
  Add this line to your application's Gemfile:
@@ -42,7 +41,8 @@ Or install it yourself as:
42
41
 
43
42
 
44
43
  Ibanvalidator.rules, liefert alle IBAN Regeln
45
- Ibanvalidator.rule_countries, liefert ein Array mit allen Ländern für die eine Rule hinterlegt ist
44
+ **Ibanvalidator.rule_countries**, liefert ein Array mit allen Ländern für die eine Rule hinterlegt ist
45
+ => ["AD", "AE", "AL", "AT", "AZ", "BA", "BE", "BG", "BH", "BR", "CH", "CY", "CZ", "DE", "DK", "DO", "EE", "ES", "FI", "FO", "FR", "GB", "GE", "GI", "GL", "GR", "HR", "HU", "IE", "IL", "IS", "IT", "JO", "KW", "KZ", "LB", "LI", "LT", "LU", "LV", "MC", "MD", "ME", "MK", "MR", "MT", "MU", "NL", "NO", "PK", "PL", "PT", "PS", "QA", "RO", "RS", "SA", "SE", "SI", "SK", "SM", "TN", "TR", "UA", "VG"]
46
46
 
47
47
 
48
48
  ## Development
@@ -36,5 +36,6 @@ Gem::Specification.new do |spec|
36
36
 
37
37
  #for mattr_accessor
38
38
  spec.add_dependency "activesupport"
39
+
39
40
 
40
41
  end
@@ -100,8 +100,7 @@ module Ibanvalidator
100
100
  end
101
101
 
102
102
  def self.load_config(country_code)
103
- default_config = YAML.
104
- load_file(File.join(File.dirname(__FILE__), 'conversion_rules.yml'))
103
+ default_config = Ibanvalidator.default_conversions
105
104
  unless default_config.key?(country_code)
106
105
  raise ArgumentError, "Country code #{country_code} not availble"
107
106
  end
@@ -16,6 +16,9 @@
16
16
  #
17
17
  # If a field has more than one kind of character representation, an array can
18
18
  # be used (see MU)
19
+ # erweitert Olaf Kaderka
20
+ # https://bank.codes/iban/structure/ukraine/
21
+ # https://bank.codes/iban/structure/brazil/
19
22
  #
20
23
 
21
24
  'AD':
@@ -61,6 +64,11 @@
61
64
  'BH':
62
65
  bank_code: 4!a
63
66
  account_number: 14!c
67
+ # https://bank.codes/iban/structure/brazil/
68
+ 'BR':
69
+ bank_code: 8!n
70
+ branch_code: 5!c
71
+ account_number: 10!c
64
72
 
65
73
  'CH':
66
74
  bank_code: 5!n
@@ -320,6 +328,10 @@
320
328
  reserved: 1!c
321
329
  account_number: 16!c
322
330
 
331
+ 'UA':
332
+ bank_code: 6!n
333
+ account_number: 19!c
334
+
323
335
  'VG':
324
336
  bank_code: 4!c
325
337
  account_number: 16!n
@@ -1,3 +1,3 @@
1
1
  module Ibanvalidator
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
data/lib/ibanvalidator.rb CHANGED
@@ -1,14 +1,32 @@
1
1
  require 'active_support'
2
2
  require 'active_support/core_ext'
3
+ require 'yaml'
3
4
  require "ibanvalidator/version"
4
5
  require 'ibanvalidator/conversion.rb'
5
6
  require 'ibanvalidator/iban.rb'
6
7
  require 'ibanvalidator/iban_rules.rb'
8
+ require 'ibanvalidator/iban_rules.rb'
9
+
7
10
 
8
11
  module Ibanvalidator
9
12
  mattr_accessor :default_rules
10
13
  mattr_accessor :rule_countries
14
+ mattr_accessor :default_conversions
15
+ mattr_accessor :default_conversion_countries
16
+
17
+
11
18
  #falls noch nciht gesetzt zb in einem initializer.....
12
19
  Ibanvalidator.default_rules = (Ibanvalidator.default_rules || Ibanvalidator::IBANRules.defaults.rules)
13
20
  Ibanvalidator.rule_countries = (Ibanvalidator.rule_countries || Ibanvalidator.default_rules.keys)
21
+
22
+ #YAML.load_file(File.join(File.dirname(__FILE__), '/ibanvalidator', 'conversion_rules.yml'))
23
+ if Ibanvalidator.default_conversions
24
+ else
25
+ Ibanvalidator.default_conversions = YAML.load_file(File.join(File.dirname(__FILE__), '/ibanvalidator', 'conversion_rules.yml'))
26
+ end
27
+
28
+
29
+ Ibanvalidator.rule_countries = (Ibanvalidator.rule_countries || Ibanvalidator.default_rules.keys)
30
+ Ibanvalidator.default_conversion_countries = (Ibanvalidator.default_conversion_countries || Ibanvalidator.default_conversions.keys)
31
+
14
32
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ibanvalidator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Olaf Kaderka