banking_data 0.4.0 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 86e57b2a0d3555b6294b62d199e16f0b909e2f94
4
+ data.tar.gz: 6cd6230675157543aa32f07bd564168abe87501c
5
+ SHA512:
6
+ metadata.gz: 73ea9d56961f2204bb6276c332f333c63a4739be8b33593f5e7105690a9e296f11aec84f985cd287dd8621dcb8b8027fa18d017ca0f786ee6766f05ae1fbe0ff
7
+ data.tar.gz: 13a39027a9f1fe03106c47dfcbfd662556c750b8c0c0cd4aa5657dc1d37ff4acf62c911a198cf66c3310400a2454f9d715de7bfc5803d68af67c679f4bfce4a6
data/.gitignore CHANGED
@@ -4,3 +4,5 @@ pkg/
4
4
  vendor/cache/*.gem
5
5
  coverage
6
6
  *.gem
7
+ .ruby-version
8
+ gemfiles/*.lock
data/.travis.yml CHANGED
@@ -7,7 +7,12 @@ rvm:
7
7
  - jruby-head
8
8
  - rbx-19mode
9
9
  - rbx-2.0.0
10
- - rbx-head
10
+ - rbx-2.1.1
11
+ gemfile:
12
+ - gemfiles/rails_3.0.gemfile
13
+ - gemfiles/rails_3.1.gemfile
14
+ - gemfiles/rails_3.2.gemfile
15
+ - gemfiles/rails_4.0.gemfile
11
16
  matrix:
12
17
  allow_failures:
13
18
  - rvm: rbx-2.0.0
data/Appraisals ADDED
@@ -0,0 +1,19 @@
1
+ appraise 'rails 4.0' do
2
+ gem 'activesupport', '~>4.0.0'
3
+ gem 'activemodel', '~>4.0.0'
4
+ end
5
+
6
+ appraise 'rails 3.2' do
7
+ gem 'activesupport', '~>3.2.0'
8
+ gem 'activemodel', '~>3.2.0'
9
+ end
10
+
11
+ appraise 'rails 3.1' do
12
+ gem 'activesupport', '~>3.1.0'
13
+ gem 'activemodel', '~>3.1.0'
14
+ end
15
+
16
+ appraise 'rails 3.0' do
17
+ gem 'activesupport', '~>3.0.0'
18
+ gem 'activemodel', '~>3.0.0'
19
+ end
data/Rakefile ADDED
@@ -0,0 +1,14 @@
1
+ # vim:ts=2:sw=2:et:
2
+
3
+ require 'rubygems'
4
+ require 'bundler/setup'
5
+ require 'appraisal'
6
+ gem 'rspec', '>= 1.2.4'
7
+ require 'rspec/core/rake_task'
8
+
9
+ task :default => :core
10
+
11
+ RSpec::Core::RakeTask.new(:core) do |spec|
12
+ spec.pattern = 'spec/**/*_spec.rb'
13
+ spec.rspec_opts = ['--backtrace']
14
+ end
data/banking_data.gemspec CHANGED
@@ -25,4 +25,5 @@ Gem::Specification.new do |gem|
25
25
  gem.add_development_dependency 'coveralls'
26
26
  gem.add_development_dependency 'pry'
27
27
  gem.add_development_dependency 'rubocop'
28
+ gem.add_development_dependency 'appraisal'
28
29
  end
@@ -0,0 +1,8 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "activesupport", "~>3.0.0"
6
+ gem "activemodel", "~>3.0.0"
7
+
8
+ gemspec :path=>"../"
@@ -0,0 +1,8 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "activesupport", "~>3.1.0"
6
+ gem "activemodel", "~>3.1.0"
7
+
8
+ gemspec :path=>"../"
@@ -0,0 +1,8 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "activesupport", "~>3.2.0"
6
+ gem "activemodel", "~>3.2.0"
7
+
8
+ gemspec :path=>"../"
@@ -0,0 +1,8 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "activesupport", "~>4.0.0"
6
+ gem "activemodel", "~>4.0.0"
7
+
8
+ gemspec :path=>"../"
@@ -13,6 +13,7 @@ class BankingData::AustrianBank < BankingData::Bank
13
13
  class << self
14
14
 
15
15
  delegate :where, :only, to: :query
16
+ delegate :map, :each, to: :all
16
17
 
17
18
  def all
18
19
  @@all ||= get_all
@@ -21,13 +22,13 @@ class BankingData::AustrianBank < BankingData::Bank
21
22
  def get_all
22
23
  banks = []
23
24
  SmarterCSV.process(file, opts).each do |line|
24
- if line[:kennzeichen] == 'Hauptanstalt'
25
- blz = line[:bankleitzahl].try(:gsub, /"/, '')
26
- bic = line[:'swift-code'].try(:gsub, /"/, '')
25
+ blz = line[:bankleitzahl].try(:gsub, /"/, '')
26
+ bic = line[:'swift-code'].try(:gsub, /"/, '')
27
+ if blz && bic
27
28
  banks << new(bic: bic, blz: blz)
28
29
  end
29
30
  end
30
- banks
31
+ banks.uniq
31
32
  end
32
33
 
33
34
  private
@@ -12,6 +12,7 @@ class BankingData::GermanBank < BankingData::Bank
12
12
  class << self
13
13
 
14
14
  delegate :where, :only, to: :query
15
+ delegate :map, :each, to: :all
15
16
 
16
17
  def all
17
18
  @@all ||= get_all
@@ -21,12 +22,12 @@ class BankingData::GermanBank < BankingData::Bank
21
22
 
22
23
  def get_all
23
24
  banks = []
24
- File.open(file).each_line do |line|
25
+ File.open(file, 'r:iso-8859-1').each_line do |line|
25
26
  blz = line[0..7]
26
27
  bic = line[139..149]
27
28
  banks << new(bic: bic, blz: blz)
28
29
  end
29
- banks
30
+ banks.uniq
30
31
  end
31
32
 
32
33
  def file
@@ -1,4 +1,5 @@
1
1
  require 'active_support/core_ext/class/subclasses'
2
+ require 'active_support/core_ext/module/delegation'
2
3
 
3
4
  module BankingData
4
5
  class Query
@@ -12,6 +12,7 @@ class BankingData::SwissBank < BankingData::Bank
12
12
  class << self
13
13
 
14
14
  delegate :where, :only, to: :query
15
+ delegate :map, :each, to: :all
15
16
 
16
17
  def all
17
18
  @@all ||= get_all
@@ -27,7 +28,7 @@ class BankingData::SwissBank < BankingData::Bank
27
28
  banks << new(bic: bic, blz: blz)
28
29
  end
29
30
  end
30
- banks
31
+ banks.uniq
31
32
  end
32
33
 
33
34
  def file
@@ -1,4 +1,4 @@
1
1
  module BankingData
2
2
  # banking_data version
3
- VERSION = '0.4.0'
3
+ VERSION = '0.5.0'
4
4
  end
@@ -10,6 +10,17 @@ module BankingData
10
10
  .to include(bic)
11
11
  end
12
12
  end
13
+
14
+ ['60000', '15150'].each do |blz|
15
+ it "includes #{blz}" do
16
+ expect(AustrianBank.only(:blz).map(&:first)).to include(blz)
17
+ expect(AustrianBank.only(:blz).flatten).to include(blz)
18
+ expect(Bank.where(locale: :at, blz: blz).only(:blz).first)
19
+ .to eq([blz])
20
+ expect(Bank.where(blz: blz, locale: :at).only(:blz).last)
21
+ .to eq([blz])
22
+ end
23
+ end
13
24
  end
14
25
  end
15
26
  end
@@ -10,9 +10,11 @@ module BankingData
10
10
  .to include(bic)
11
11
  end
12
12
  end
13
- ['76350000', '37040044'].each do |blz|
13
+
14
+ ['76350000', '37040044', '40050150'].each do |blz|
14
15
  it "includes #{blz}" do
15
16
  expect(GermanBank.only(:blz).map(&:first)).to include(blz)
17
+ expect(GermanBank.map(&:blz)).to include(blz)
16
18
  expect(GermanBank.only(:blz).flatten).to include(blz)
17
19
  expect(Bank.where(locale: :de, blz: blz).only(:blz).first)
18
20
  .to eq([blz])
metadata CHANGED
@@ -1,142 +1,139 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: banking_data
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
5
- prerelease:
4
+ version: 0.5.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - Frank C. Eckert
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-10-22 00:00:00.000000000 Z
11
+ date: 2013-10-29 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: activesupport
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ! '>='
17
+ - - '>='
20
18
  - !ruby/object:Gem::Version
21
19
  version: '0'
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ! '>='
24
+ - - '>='
28
25
  - !ruby/object:Gem::Version
29
26
  version: '0'
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: activemodel
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
- - - ! '>='
31
+ - - '>='
36
32
  - !ruby/object:Gem::Version
37
33
  version: '0'
38
34
  type: :runtime
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
- - - ! '>='
38
+ - - '>='
44
39
  - !ruby/object:Gem::Version
45
40
  version: '0'
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: smarter_csv
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
- - - ! '>='
45
+ - - '>='
52
46
  - !ruby/object:Gem::Version
53
47
  version: '0'
54
48
  type: :runtime
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
- - - ! '>='
52
+ - - '>='
60
53
  - !ruby/object:Gem::Version
61
54
  version: '0'
62
55
  - !ruby/object:Gem::Dependency
63
56
  name: rspec
64
57
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
58
  requirements:
67
- - - ! '>='
59
+ - - '>='
68
60
  - !ruby/object:Gem::Version
69
61
  version: '0'
70
62
  type: :development
71
63
  prerelease: false
72
64
  version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
65
  requirements:
75
- - - ! '>='
66
+ - - '>='
76
67
  - !ruby/object:Gem::Version
77
68
  version: '0'
78
69
  - !ruby/object:Gem::Dependency
79
70
  name: rake
80
71
  requirement: !ruby/object:Gem::Requirement
81
- none: false
82
72
  requirements:
83
- - - ! '>='
73
+ - - '>='
84
74
  - !ruby/object:Gem::Version
85
75
  version: '0'
86
76
  type: :development
87
77
  prerelease: false
88
78
  version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
79
  requirements:
91
- - - ! '>='
80
+ - - '>='
92
81
  - !ruby/object:Gem::Version
93
82
  version: '0'
94
83
  - !ruby/object:Gem::Dependency
95
84
  name: coveralls
96
85
  requirement: !ruby/object:Gem::Requirement
97
- none: false
98
86
  requirements:
99
- - - ! '>='
87
+ - - '>='
100
88
  - !ruby/object:Gem::Version
101
89
  version: '0'
102
90
  type: :development
103
91
  prerelease: false
104
92
  version_requirements: !ruby/object:Gem::Requirement
105
- none: false
106
93
  requirements:
107
- - - ! '>='
94
+ - - '>='
108
95
  - !ruby/object:Gem::Version
109
96
  version: '0'
110
97
  - !ruby/object:Gem::Dependency
111
98
  name: pry
112
99
  requirement: !ruby/object:Gem::Requirement
113
- none: false
114
100
  requirements:
115
- - - ! '>='
101
+ - - '>='
116
102
  - !ruby/object:Gem::Version
117
103
  version: '0'
118
104
  type: :development
119
105
  prerelease: false
120
106
  version_requirements: !ruby/object:Gem::Requirement
121
- none: false
122
107
  requirements:
123
- - - ! '>='
108
+ - - '>='
124
109
  - !ruby/object:Gem::Version
125
110
  version: '0'
126
111
  - !ruby/object:Gem::Dependency
127
112
  name: rubocop
128
113
  requirement: !ruby/object:Gem::Requirement
129
- none: false
130
114
  requirements:
131
- - - ! '>='
115
+ - - '>='
132
116
  - !ruby/object:Gem::Version
133
117
  version: '0'
134
118
  type: :development
135
119
  prerelease: false
136
120
  version_requirements: !ruby/object:Gem::Requirement
137
- none: false
138
121
  requirements:
139
- - - ! '>='
122
+ - - '>='
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: appraisal
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - '>='
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - '>='
140
137
  - !ruby/object:Gem::Version
141
138
  version: '0'
142
139
  description: This gem exposes the official banking data of the respective national
@@ -151,13 +148,19 @@ files:
151
148
  - .rspec
152
149
  - .rubocop.yml
153
150
  - .travis.yml
151
+ - Appraisals
154
152
  - Gemfile
155
153
  - LICENSE.txt
156
154
  - README.md
155
+ - Rakefile
157
156
  - banking_data.gemspec
158
157
  - data/BLZ_20130909.txt
159
158
  - data/bcbankenstamm.txt
160
159
  - data/kiverzeichnis_gesamt_de_1381499802577.csv
160
+ - gemfiles/rails_3.0.gemfile
161
+ - gemfiles/rails_3.1.gemfile
162
+ - gemfiles/rails_3.2.gemfile
163
+ - gemfiles/rails_4.0.gemfile
161
164
  - lib/banking_data.rb
162
165
  - lib/banking_data/austrian_bank.rb
163
166
  - lib/banking_data/bank.rb
@@ -175,27 +178,26 @@ files:
175
178
  homepage: https://github.com/opahk/banking_data
176
179
  licenses:
177
180
  - MIT
181
+ metadata: {}
178
182
  post_install_message:
179
183
  rdoc_options: []
180
184
  require_paths:
181
185
  - lib
182
186
  required_ruby_version: !ruby/object:Gem::Requirement
183
- none: false
184
187
  requirements:
185
- - - ! '>='
188
+ - - '>='
186
189
  - !ruby/object:Gem::Version
187
190
  version: '0'
188
191
  required_rubygems_version: !ruby/object:Gem::Requirement
189
- none: false
190
192
  requirements:
191
- - - ! '>='
193
+ - - '>='
192
194
  - !ruby/object:Gem::Version
193
195
  version: '0'
194
196
  requirements: []
195
197
  rubyforge_project:
196
- rubygems_version: 1.8.25
198
+ rubygems_version: 2.0.3
197
199
  signing_key:
198
- specification_version: 3
200
+ specification_version: 4
199
201
  summary: Banking data for German, Austrian and Swiss banks
200
202
  test_files:
201
203
  - spec/banking_data/austrian_bank_spec.rb