banktools-de 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +24 -1
- data/Rakefile +7 -0
- data/banktools-de.gemspec +1 -0
- data/data/blz_to_name.yml +4042 -0
- data/lib/bank_tools/de/blz.rb +13 -1
- data/lib/bank_tools/de/blz_downloader.rb +49 -0
- data/lib/bank_tools/de/version.rb +1 -1
- data/lib/bank_tools/de.rb +9 -1
- data/spec/account_spec.rb +1 -1
- data/spec/blz_spec.rb +11 -1
- metadata +17 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5453ad9542d81acd4a0653df094a95d8b2b3aeb0
|
4
|
+
data.tar.gz: 05623115c4c2e589c48878a538dcdbc81171dc0c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 36a975456c36e233e0a3d5e42ccdab38ba9c88e0b17bd915e97b982fe0e5bd477f6795ca3c4af8c8b1ca4d7209410ad3e16ab38fac483a1ab7e1666017ec2f5c
|
7
|
+
data.tar.gz: c86193338004fc5df9262877e71608356064704ccbc0b0ca49d79d49bb5440768dbe2cf27a01f7f1fa500bdfeff8d83412d66739febea51e25d7816d643d2093
|
data/README.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Ruby gem to validate, normalize/prettify and interpret German Bankleitzahl (BLZ) and bank account numbers.
|
4
4
|
|
5
|
-
When in doubt, this library aims to err on the side of allowing too much.
|
5
|
+
When in doubt, this library aims to err on the side of allowing too much. We've yet to find clear specs, so be aware that the current validation rules are *very* forgiving.
|
6
6
|
|
7
7
|
If we got anything wrong, please file an issue or contribute a fix yourself.
|
8
8
|
|
@@ -17,11 +17,13 @@ If we got anything wrong, please file an issue or contribute a fix yourself.
|
|
17
17
|
blz.normalize # => "100 700 24"
|
18
18
|
blz.valid? # => true
|
19
19
|
blz.errors # => []
|
20
|
+
blz.bank_name # => "Deutsche Bank PGK Berlin"
|
20
21
|
|
21
22
|
bad_blz = BankTools::DE::BLZ.new("1X")
|
22
23
|
bad_blz.normalize # => "1X"
|
23
24
|
bad_blz.valid? # => false
|
24
25
|
bad_blz.errors # => [ :too_short, :invalid_characters ]
|
26
|
+
blz.bank_name # => nil
|
25
27
|
|
26
28
|
# Account
|
27
29
|
|
@@ -42,6 +44,27 @@ If we got anything wrong, please file an issue or contribute a fix yourself.
|
|
42
44
|
# or: rake
|
43
45
|
|
44
46
|
|
47
|
+
## Update BLZ data
|
48
|
+
|
49
|
+
Bundesbank provide a mapping from BLZ to bank name that appears to be updated regularly:
|
50
|
+
|
51
|
+
<http://www.bundesbank.de/Redaktion/DE/Standardartikel/Kerngeschaeftsfelder/Unbarer_Zahlungsverkehr/bankleitzahlen_download.html>
|
52
|
+
|
53
|
+
As a gem maintainer, run
|
54
|
+
|
55
|
+
rake download URL="http://www.bundesbank.de/…/blz_2013_12_09_xls.xlsx?__blob=publicationFile"
|
56
|
+
|
57
|
+
providing a URL for the latest unpacked XLSX version of the data.
|
58
|
+
|
59
|
+
You can provide a local path if you want.
|
60
|
+
|
61
|
+
This will overwrite the local data file, which should ship with the gem.
|
62
|
+
|
63
|
+
Updates appear to ship for periods of 3 months, provided the month before a period starts. We've seen these periods:
|
64
|
+
* 2013-09-09 - 2013-12-08
|
65
|
+
* 2013-12-09 - 2014-03-02
|
66
|
+
|
67
|
+
|
45
68
|
## Installation
|
46
69
|
|
47
70
|
Add this line to your application's Gemfile:
|
data/Rakefile
CHANGED
@@ -1,6 +1,13 @@
|
|
1
1
|
require "bundler/gem_tasks"
|
2
2
|
require "rspec/core/rake_task"
|
3
|
+
require "bank_tools/de/blz_downloader"
|
3
4
|
|
4
5
|
RSpec::Core::RakeTask.new(:spec)
|
5
6
|
|
6
7
|
task :default => :spec
|
8
|
+
|
9
|
+
desc "Download BLZ data file"
|
10
|
+
task :download do
|
11
|
+
url = ENV["URL"]
|
12
|
+
BankTools::DE::BLZDownloader.new(url).run
|
13
|
+
end
|
data/banktools-de.gemspec
CHANGED