blz 0.1.4.20140608 → 0.1.4.20140907

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: 1743881e0d56c5da414578edeb9f5dc41308f430
4
- data.tar.gz: 2df61bad20fbcfa492755c8194b054ebfd1787e4
3
+ metadata.gz: 050b4b8dd5ab87a324b645090384b26d2a91a51d
4
+ data.tar.gz: 77afb27c12ed63290b1955da78a03dfc4aeb530c
5
5
  SHA512:
6
- metadata.gz: 2f7db7fc7e4c834f6be8cd68d53f90011eec1ea0defc715947714e60ef611064fdce7f6586454fe94be29c77a0672a2857e4d2ded2a87bd788e10dad6f366c6a
7
- data.tar.gz: 8e5612eebd675283dd92de4c151c69f748b953f2a7b6615785e3114426797afb80e985ada9fc2a2b20cbf52764b5882d76e20def46c26c3c6675d31e8ca0adc3
6
+ metadata.gz: 5b1106e5ffc748d5656b84913d183413746566bbbc356f00902ae4d56d9672da8f653ebe75ef8114951d46a53a1c8f1cba186ac894cbc9a0bfbafd33c53c0858
7
+ data.tar.gz: aa1eba1a4ad9ab6328bd87d9a3bf88d1a28860ecfe17f01bb5e3061980d59d52ab46e5b7a8797691643b12da66f147ffe697be58966f3cc0478641e84b53b0bf
data/CHANGELOG.md CHANGED
@@ -1,4 +1,9 @@
1
- # 0.1.4.20140608, unreleased
1
+ # 0.1.4.20140907, released 2014-06-26
2
+
3
+ * BLZ data file for cycle 2014-06-09 to 2014-09-07 added
4
+ * generalized finder for `BLZ::DATA_FILE`
5
+
6
+ # 0.1.4.20140608, released 2014-02-13
2
7
 
3
8
  * BLZ data file for cycle 2014-03-03 to 2014-06-08 added
4
9
  * compressed data files for smaller gem size
data/blz.gemspec CHANGED
@@ -4,7 +4,7 @@ extra_rdoc_files = ['CHANGELOG.md', 'LICENSE', 'README.md']
4
4
 
5
5
  Gem::Specification.new do |s|
6
6
  s.name = 'blz'
7
- s.version = '0.1.4.20140608'
7
+ s.version = '0.1.4.20140907'
8
8
  s.platform = Gem::Platform::RUBY
9
9
  s.summary = "BLZ (Bankleitzahlen) for Ruby"
10
10
 
@@ -19,6 +19,7 @@ EOF
19
19
  s.author = 'Oliver Eilhard'
20
20
  s.email = 'oliver.eilhard@gmail.com'
21
21
  s.homepage = 'http://github.com/olivere/blz'
22
+ s.license = 'MIT'
22
23
 
23
24
  s.files = `git ls-files`.split("\n") - ['.gitignore']
24
25
  s.bindir = 'bin'
@@ -29,7 +30,7 @@ EOF
29
30
  s.test_files = []
30
31
 
31
32
  s.add_development_dependency 'bundler', '~> 1.2'
32
- s.add_development_dependency 'rdoc', '~> 2.5'
33
- s.add_development_dependency 'rake', '>= 0.9'
33
+ s.add_development_dependency 'rdoc', '~> 2.5', '>= 2.5.3'
34
+ s.add_development_dependency 'rake', '~> 10.3', '>= 10.3.2'
34
35
  end
35
36
 
Binary file
data/lib/blz.rb CHANGED
@@ -9,21 +9,23 @@
9
9
 
10
10
  module BLZ
11
11
  DATA_FILE = begin
12
- now = Time.now
12
+ now = Time.now
13
+ glob = Dir[ File.join(File.dirname(__FILE__), '../data/*.tsv.gz') ].sort
13
14
 
14
- filename = if now <= Time.new(2013, 12, 9)
15
- warn '[BLZ] The data provided may not be accurate.'
16
- '2012_06_04.tsv.gz'
17
- elsif Time.new(2013, 12, 9) < now && now <= Time.new(2014, 3, 2)
18
- '2013_12_09.tsv.gz'
19
- elsif Time.new(2014, 3, 2) < now && now <= Time.new(2014, 6, 8)
20
- '2014_03_03.tsv.gz'
21
- else
15
+ file2time = proc do |f|
16
+ match = f.match /(?<y>\d{4})_(?<m>\d\d)_(?<d>\d\d)\.tsv\.gz$/
17
+ Time.new match[:y], match[:m], match[:d]
18
+ end
19
+
20
+ filename = glob.find {|c| now <= file2time[c] } || glob.last
21
+
22
+ # sanity check
23
+ t = file2time[filename]
24
+ if t < Time.new(2013, 12, 9) || now > t + (90 * 24 * 60 * 60)
22
25
  warn '[BLZ] The data provided may not be accurate.'
23
- '2014_03_03.tsv.gz'
24
26
  end
25
27
 
26
- File.join(File.dirname(__FILE__), '../data', filename)
28
+ filename
27
29
  end
28
30
  end
29
31
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blz
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4.20140608
4
+ version: 0.1.4.20140907
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oliver Eilhard
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-13 00:00:00.000000000 Z
11
+ date: 2014-06-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -31,6 +31,9 @@ dependencies:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
33
  version: '2.5'
34
+ - - ">="
35
+ - !ruby/object:Gem::Version
36
+ version: 2.5.3
34
37
  type: :development
35
38
  prerelease: false
36
39
  version_requirements: !ruby/object:Gem::Requirement
@@ -38,20 +41,29 @@ dependencies:
38
41
  - - "~>"
39
42
  - !ruby/object:Gem::Version
40
43
  version: '2.5'
44
+ - - ">="
45
+ - !ruby/object:Gem::Version
46
+ version: 2.5.3
41
47
  - !ruby/object:Gem::Dependency
42
48
  name: rake
43
49
  requirement: !ruby/object:Gem::Requirement
44
50
  requirements:
51
+ - - "~>"
52
+ - !ruby/object:Gem::Version
53
+ version: '10.3'
45
54
  - - ">="
46
55
  - !ruby/object:Gem::Version
47
- version: '0.9'
56
+ version: 10.3.2
48
57
  type: :development
49
58
  prerelease: false
50
59
  version_requirements: !ruby/object:Gem::Requirement
51
60
  requirements:
61
+ - - "~>"
62
+ - !ruby/object:Gem::Version
63
+ version: '10.3'
52
64
  - - ">="
53
65
  - !ruby/object:Gem::Version
54
- version: '0.9'
66
+ version: 10.3.2
55
67
  description: |
56
68
  BLZ (Bankleitzahlen) is a small library for looking up
57
69
  the widely used bank identifier code system in Germany
@@ -78,11 +90,13 @@ files:
78
90
  - data/2012_06_04.tsv.gz
79
91
  - data/2013_12_09.tsv.gz
80
92
  - data/2014_03_03.tsv.gz
93
+ - data/2014_06_09.tsv.gz
81
94
  - lib/blz.rb
82
95
  - lib/blz/bank.rb
83
96
  - test/test_bank.rb
84
97
  homepage: http://github.com/olivere/blz
85
- licenses: []
98
+ licenses:
99
+ - MIT
86
100
  metadata: {}
87
101
  post_install_message:
88
102
  rdoc_options: []
@@ -100,7 +114,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
100
114
  version: '0'
101
115
  requirements: []
102
116
  rubyforge_project:
103
- rubygems_version: 2.2.0
117
+ rubygems_version: 2.2.1
104
118
  signing_key:
105
119
  specification_version: 4
106
120
  summary: BLZ (Bankleitzahlen) for Ruby