MxnBanks 0.1.1
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 +7 -0
- data/.gitignore +12 -0
- data/.rspec +2 -0
- data/.travis.yml +5 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +21 -0
- data/MxnBanks.gemspec +30 -0
- data/README.md +39 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/lib/MxnBanks.rb +12 -0
- data/lib/MxnBanks/version.rb +3 -0
- data/lib/banks.json +187 -0
- data/rubocop.yml +22 -0
- metadata +128 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: '082c397c1f003e00b08986b4551cd16c6c320c34'
|
4
|
+
data.tar.gz: 2451cec5db57beb5e28f51aa99d434ce0b57d425
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: e03f9baf5fb08be77b6ba2c6783a6fc696cb97ec5fb19edc007269946279f8a19784a8c551e4504c523667fdb0010973b396208f5934c8457c08c586fc7b9eb6
|
7
|
+
data.tar.gz: cfb7f1b119fe0a1c067fe6a0bdcb8156206dda30ab62a4cd0941e86f54bb9112415d16de6c345a3243e151673821204a40731318e256892b81a58b8a23889d92
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2017 aldosolorzano
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/MxnBanks.gemspec
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
lib = File.expand_path('../lib', __FILE__)
|
4
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
5
|
+
require 'MxnBanks/version'
|
6
|
+
|
7
|
+
Gem::Specification.new do |spec|
|
8
|
+
spec.name = 'MxnBanks'
|
9
|
+
spec.version = MxnBanks::VERSION
|
10
|
+
spec.authors = ['aldosolorzano']
|
11
|
+
spec.email = ['aldosolorzanop@gmail.com']
|
12
|
+
|
13
|
+
spec.summary = 'Created for the purpose of autocomplete banks info.'
|
14
|
+
spec.description = 'Created for the purpose of autocomplete banks info.'
|
15
|
+
spec.homepage = 'http://rubygems.com/MxnBanks'
|
16
|
+
spec.license = 'MIT'
|
17
|
+
|
18
|
+
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
19
|
+
f.match(%r{^(test|spec|features)/})
|
20
|
+
end
|
21
|
+
spec.bindir = 'exe'
|
22
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
23
|
+
spec.require_paths = ['lib']
|
24
|
+
|
25
|
+
spec.add_development_dependency 'bundler', '~> 1.15'
|
26
|
+
spec.add_development_dependency 'rake', '~> 10.0'
|
27
|
+
spec.add_development_dependency 'rspec', '~> 3.0'
|
28
|
+
spec.add_development_dependency 'pry', '~> 0'
|
29
|
+
spec.add_development_dependency 'rubocop', '~> 0'
|
30
|
+
end
|
data/README.md
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
# MxnBanks
|
2
|
+
|
3
|
+
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/MxnBanks`. To experiment with that code, run `bin/console` for an interactive prompt.
|
4
|
+
|
5
|
+
TODO: Delete this and the text above, and describe your gem
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Add this line to your application's Gemfile:
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
gem 'MxnBanks'
|
13
|
+
```
|
14
|
+
|
15
|
+
And then execute:
|
16
|
+
|
17
|
+
$ bundle
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
|
21
|
+
$ gem install MxnBanks
|
22
|
+
|
23
|
+
## Usage
|
24
|
+
|
25
|
+
TODO: Write usage instructions here
|
26
|
+
|
27
|
+
## Development
|
28
|
+
|
29
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
30
|
+
|
31
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
32
|
+
|
33
|
+
## Contributing
|
34
|
+
|
35
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/MxnBanks.
|
36
|
+
|
37
|
+
## License
|
38
|
+
|
39
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'bundler/setup'
|
4
|
+
require 'MxnBanks'
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require 'irb'
|
14
|
+
IRB.start(__FILE__)
|
data/bin/setup
ADDED
data/lib/MxnBanks.rb
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
require 'MxnBanks/version'
|
2
|
+
|
3
|
+
module MxnBanks
|
4
|
+
def self.from_iban(num)
|
5
|
+
a = to_hash.select { |b| b[:number] == num.slice(0, 3) }
|
6
|
+
a.first
|
7
|
+
end
|
8
|
+
|
9
|
+
def self.to_hash
|
10
|
+
@banks ||= JSON.parse(File.read('lib/banks.json'), symbolize_names: true)
|
11
|
+
end
|
12
|
+
end
|
data/lib/banks.json
ADDED
@@ -0,0 +1,187 @@
|
|
1
|
+
[
|
2
|
+
{
|
3
|
+
"number": "012",
|
4
|
+
"name": "BBVA Bancomer, S.A.",
|
5
|
+
"abreviate": "BBVA BANCOMER"
|
6
|
+
},
|
7
|
+
{
|
8
|
+
"number": "014",
|
9
|
+
"name": "Banco Santander, S.A.",
|
10
|
+
"abreviate": "SANTANDER"
|
11
|
+
},
|
12
|
+
{
|
13
|
+
"number": "019",
|
14
|
+
"name": "Banco Nacional del Ejército, Fuerza Aérea y Armada, S.N.C.",
|
15
|
+
"abreviate": "BANJERCITO"
|
16
|
+
},
|
17
|
+
{
|
18
|
+
"number": "002",
|
19
|
+
"name": "Banco Nacional de México, S.A.",
|
20
|
+
"abreviate": "BANAMEX"
|
21
|
+
},
|
22
|
+
{
|
23
|
+
"number": "021",
|
24
|
+
"name": "HSBC México, S.A.",
|
25
|
+
"abreviate": "HSBC"
|
26
|
+
},
|
27
|
+
{
|
28
|
+
"number": "022",
|
29
|
+
"name": "GE Money Bank, S.A.",
|
30
|
+
"abreviate": "GE MONEY"
|
31
|
+
},
|
32
|
+
{
|
33
|
+
"number": "030",
|
34
|
+
"name": "Banco del Bajío, S.A.",
|
35
|
+
"abreviate": "BAJÍO"
|
36
|
+
},
|
37
|
+
{
|
38
|
+
"number": "032",
|
39
|
+
"name": "IXE Banco, S.A.",
|
40
|
+
"abreviate": "IXE"
|
41
|
+
},
|
42
|
+
{
|
43
|
+
"number": "036",
|
44
|
+
"name": "Banco Inbursa, S.A.",
|
45
|
+
"abreviate": "INBURSA"
|
46
|
+
},
|
47
|
+
{
|
48
|
+
"number": "037",
|
49
|
+
"name": "Banco Interacciones, S.A.",
|
50
|
+
"abreviate": "INTERACCIONES"
|
51
|
+
},
|
52
|
+
{
|
53
|
+
"number": "042",
|
54
|
+
"name": "Banca Mifel, S.A.",
|
55
|
+
"abreviate": "MIFEL"
|
56
|
+
},
|
57
|
+
{
|
58
|
+
"number": "044",
|
59
|
+
"name": "Scotiabank Inverlat, S.A.",
|
60
|
+
"abreviate": "SCOTIABANK"
|
61
|
+
},
|
62
|
+
{
|
63
|
+
"number": "058",
|
64
|
+
"name": "Banco Regional de Monterrey, S.A.",
|
65
|
+
"abreviate": "BANREGIO"
|
66
|
+
},
|
67
|
+
{
|
68
|
+
"number": "059",
|
69
|
+
"name": "Banco Invex, S.A.",
|
70
|
+
"abreviate": "INVEX"
|
71
|
+
},
|
72
|
+
{
|
73
|
+
"number": "060",
|
74
|
+
"name": "Bansi, S.A.",
|
75
|
+
"abreviate": "BANSI"
|
76
|
+
},
|
77
|
+
{
|
78
|
+
"number": "062",
|
79
|
+
"name": "Banca Afirme, S.A.",
|
80
|
+
"abreviate": "AFIRME"
|
81
|
+
},
|
82
|
+
{
|
83
|
+
"number": "072",
|
84
|
+
"name": "Banco Mercantil del Norte, S.A.",
|
85
|
+
"abreviate": "BANORTE"
|
86
|
+
},
|
87
|
+
{
|
88
|
+
"number": "103",
|
89
|
+
"name": "American Express Bank (México), S.A.",
|
90
|
+
"abreviate": "AMERICAN EXPRESS"
|
91
|
+
},
|
92
|
+
{
|
93
|
+
"number": "112",
|
94
|
+
"name": "Banco Monex, S.A.",
|
95
|
+
"abreviate": "BMONEX"
|
96
|
+
},
|
97
|
+
{
|
98
|
+
"number": "113",
|
99
|
+
"name": "Banco Ve por Mas, S.A.",
|
100
|
+
"abreviate": "VE POR MAS"
|
101
|
+
},
|
102
|
+
{
|
103
|
+
"number": "127",
|
104
|
+
"name": "Banco Azteca, S.A.",
|
105
|
+
"abreviate": "AZTECA"
|
106
|
+
},
|
107
|
+
{
|
108
|
+
"number": "128",
|
109
|
+
"name": "Banco Autofin México, S.A.",
|
110
|
+
"abreviate": "AUTOFIN"
|
111
|
+
},
|
112
|
+
{
|
113
|
+
"number": "130",
|
114
|
+
"name": "Banco Compartamos, S.A.",
|
115
|
+
"abreviate": "COMPARTAMOS"
|
116
|
+
},
|
117
|
+
{
|
118
|
+
"number": "131",
|
119
|
+
"name": "Banco Ahorro Famsa, S.A.",
|
120
|
+
"abreviate": "FAMSA"
|
121
|
+
},
|
122
|
+
{
|
123
|
+
"number": "132",
|
124
|
+
"name": "Banco Multiva, S.A.",
|
125
|
+
"abreviate": "BMULTIVA"
|
126
|
+
},
|
127
|
+
{
|
128
|
+
"number": "134",
|
129
|
+
"name": "Banco Wal Mart de México Adelante, S.A.",
|
130
|
+
"abreviate": "WAL-MART"
|
131
|
+
},
|
132
|
+
{
|
133
|
+
"number": "135",
|
134
|
+
"name": "Nacional Financiera, S.N.C.",
|
135
|
+
"abreviate": "NAFIN"
|
136
|
+
},
|
137
|
+
{
|
138
|
+
"number": "136",
|
139
|
+
"name": "Banco Regional, S.A.",
|
140
|
+
"abreviate": "REGIONAL"
|
141
|
+
},
|
142
|
+
{
|
143
|
+
"number": "137",
|
144
|
+
"name": "BanCoppel, S.A.",
|
145
|
+
"abreviate": "BANCOPPEL"
|
146
|
+
},
|
147
|
+
{
|
148
|
+
"number": "138",
|
149
|
+
"name": "Banco Amigo, S.A.",
|
150
|
+
"abreviate": "AMIGO"
|
151
|
+
},
|
152
|
+
{
|
153
|
+
"number": "139",
|
154
|
+
"name": "UBS Banco, S.A.",
|
155
|
+
"abreviate": "UBS BANK"
|
156
|
+
},
|
157
|
+
{
|
158
|
+
"number": "140",
|
159
|
+
"name": "Banco Fácil, S.A.",
|
160
|
+
"abreviate": "FÁCIL"
|
161
|
+
},
|
162
|
+
{
|
163
|
+
"number": "143",
|
164
|
+
"name": "Consultoría Internacional Banco, S.A.",
|
165
|
+
"abreviate": "CIBanco"
|
166
|
+
},
|
167
|
+
{
|
168
|
+
"number": "145",
|
169
|
+
"name": "Banco BASE, S.A. de I.B.M.",
|
170
|
+
"abreviate": "BBASE"
|
171
|
+
},
|
172
|
+
{
|
173
|
+
"number": "147",
|
174
|
+
"name": "Bankaool, S.A., Institución de Banca Múltiple",
|
175
|
+
"abreviate": "BANKAOOL"
|
176
|
+
},
|
177
|
+
{
|
178
|
+
"number": "150",
|
179
|
+
"name": "Banco Inmobiliario Mexicano, S.A., Institución de Banca Múltiple",
|
180
|
+
"abreviate": "BIM"
|
181
|
+
},
|
182
|
+
{
|
183
|
+
"number": "166",
|
184
|
+
"name": "Banco del Ahorro Nacional y Servicios Financieros, S.N.C.",
|
185
|
+
"abreviate": "BANSEFI"
|
186
|
+
}
|
187
|
+
]
|
data/rubocop.yml
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Style/TrailingCommaInArguments:
|
2
|
+
EnforcedStyleForMultiline: consistent_comma
|
3
|
+
|
4
|
+
Style/TrailingCommaInLiteral:
|
5
|
+
EnforcedStyleForMultiline: consistent_comma
|
6
|
+
|
7
|
+
Metrics/LineLength:
|
8
|
+
Max: 120
|
9
|
+
|
10
|
+
Style/Documentation:
|
11
|
+
Enabled: false
|
12
|
+
|
13
|
+
Metrics/BlockLength:
|
14
|
+
Exclude:
|
15
|
+
- '*.gemspec'
|
16
|
+
- 'spec/**/*'
|
17
|
+
|
18
|
+
Style/SignalException:
|
19
|
+
EnforcedStyle: semantic
|
20
|
+
|
21
|
+
Layout/AccessModifierIndentation:
|
22
|
+
EnforcedStyle: outdent
|
metadata
ADDED
@@ -0,0 +1,128 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: MxnBanks
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- aldosolorzano
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2017-07-24 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.15'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.15'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '3.0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '3.0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: pry
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rubocop
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
description: Created for the purpose of autocomplete banks info.
|
84
|
+
email:
|
85
|
+
- aldosolorzanop@gmail.com
|
86
|
+
executables: []
|
87
|
+
extensions: []
|
88
|
+
extra_rdoc_files: []
|
89
|
+
files:
|
90
|
+
- ".gitignore"
|
91
|
+
- ".rspec"
|
92
|
+
- ".travis.yml"
|
93
|
+
- Gemfile
|
94
|
+
- LICENSE.txt
|
95
|
+
- MxnBanks.gemspec
|
96
|
+
- README.md
|
97
|
+
- Rakefile
|
98
|
+
- bin/console
|
99
|
+
- bin/setup
|
100
|
+
- lib/MxnBanks.rb
|
101
|
+
- lib/MxnBanks/version.rb
|
102
|
+
- lib/banks.json
|
103
|
+
- rubocop.yml
|
104
|
+
homepage: http://rubygems.com/MxnBanks
|
105
|
+
licenses:
|
106
|
+
- MIT
|
107
|
+
metadata: {}
|
108
|
+
post_install_message:
|
109
|
+
rdoc_options: []
|
110
|
+
require_paths:
|
111
|
+
- lib
|
112
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
113
|
+
requirements:
|
114
|
+
- - ">="
|
115
|
+
- !ruby/object:Gem::Version
|
116
|
+
version: '0'
|
117
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
118
|
+
requirements:
|
119
|
+
- - ">="
|
120
|
+
- !ruby/object:Gem::Version
|
121
|
+
version: '0'
|
122
|
+
requirements: []
|
123
|
+
rubyforge_project:
|
124
|
+
rubygems_version: 2.4.8
|
125
|
+
signing_key:
|
126
|
+
specification_version: 4
|
127
|
+
summary: Created for the purpose of autocomplete banks info.
|
128
|
+
test_files: []
|