mxn_banks 0.1.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: c95b6d9a6bdeca2c43702b67e8b59e3bc03c3e5d
4
+ data.tar.gz: 339ea828585320f7035492a57d08231a3f461ff1
5
+ SHA512:
6
+ metadata.gz: bdeeec14dbbddb0935e66e4c59c28747c6ea6f2df39128b485325ecd9af20d7cf059d95bee7e60ce31583179857e89ca4968e35cf47175e9ccd042b025af3119
7
+ data.tar.gz: 2f2bcad9157a15fd2a9cd33bffd72f7c9f546c07f330a78162ec14b99b7e0570d720f53db7e0b64833320a28b9f87f74680966ef8c2d3e10c84e04c254ddc12c
data/.gitignore ADDED
@@ -0,0 +1,12 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+
11
+ # rspec failure tracking
12
+ .rspec_status
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --format documentation
2
+ --color
data/.travis.yml ADDED
@@ -0,0 +1,5 @@
1
+ sudo: false
2
+ language: ruby
3
+ rvm:
4
+ - 2.3.3
5
+ before_install: gem install bundler -v 1.15.1
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "https://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in mxn_banks.gemspec
4
+ gemspec
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/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/mxn_banks`. 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 'mxn_banks'
13
+ ```
14
+
15
+ And then execute:
16
+
17
+ $ bundle
18
+
19
+ Or install it yourself as:
20
+
21
+ $ gem install mxn_banks
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]/mxn_banks.
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
@@ -0,0 +1,6 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "mxn_banks"
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
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
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
+ ]
@@ -0,0 +1,9 @@
1
+ class Bank
2
+ attr_reader :name, :number, :abreviate
3
+
4
+ def initialize(args)
5
+ @name = args[:name]
6
+ @number = args[:number]
7
+ @abreviate = args[:abreviate]
8
+ end
9
+ end
@@ -0,0 +1,3 @@
1
+ module MxnBanks
2
+ VERSION = "0.1.0"
3
+ end
data/lib/mxn_banks.rb ADDED
@@ -0,0 +1,14 @@
1
+ require "mxn_banks/version"
2
+ autoload :Bank , 'mxn_banks/bank'
3
+
4
+ module MxnBanks
5
+ def self.from_iban(num)
6
+ a = to_hash.select { |b| b[:number] == num.slice(0, 3) }
7
+ Bank.new(a.first)
8
+ end
9
+
10
+ def self.to_hash
11
+ json_file = File.read(File.join(File.dirname(__FILE__), 'banks.json'))
12
+ @banks ||= JSON.parse(json_file, symbolize_names: true)
13
+ end
14
+ end
data/mxn_banks.gemspec ADDED
@@ -0,0 +1,28 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path("../lib", __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require "mxn_banks/version"
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "mxn_banks"
8
+ spec.version = MxnBanks::VERSION
9
+ spec.authors = ['aldosolorzano']
10
+ spec.email = ['aldosolorzanop@gmail.com']
11
+
12
+ spec.summary = 'Created for the purpose of autocomplete banks info.'
13
+ spec.homepage = 'https://github.com/aldosolorzano/mxn_banks'
14
+ spec.license = 'MIT'
15
+
16
+ spec.files = `git ls-files -z`.split("\x0").reject do |f|
17
+ f.match(%r{^(test|spec|features)/})
18
+ end
19
+ spec.bindir = 'exe'
20
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
21
+ spec.require_paths = ['lib']
22
+
23
+ spec.add_development_dependency 'bundler', '~> 1.15'
24
+ spec.add_development_dependency 'rake', '~> 10.0'
25
+ spec.add_development_dependency 'rspec', '~> 3.0'
26
+ spec.add_development_dependency 'pry', '~> 0'
27
+ spec.add_development_dependency 'rubocop', '~> 0'
28
+ end
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,129 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: mxn_banks
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - aldosolorzano
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2017-07-25 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:
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
+ - README.md
96
+ - Rakefile
97
+ - bin/console
98
+ - bin/setup
99
+ - lib/banks.json
100
+ - lib/mxn_banks.rb
101
+ - lib/mxn_banks/bank.rb
102
+ - lib/mxn_banks/version.rb
103
+ - mxn_banks.gemspec
104
+ - rubocop.yml
105
+ homepage: https://github.com/aldosolorzano/mxn_banks
106
+ licenses:
107
+ - MIT
108
+ metadata: {}
109
+ post_install_message:
110
+ rdoc_options: []
111
+ require_paths:
112
+ - lib
113
+ required_ruby_version: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ required_rubygems_version: !ruby/object:Gem::Requirement
119
+ requirements:
120
+ - - ">="
121
+ - !ruby/object:Gem::Version
122
+ version: '0'
123
+ requirements: []
124
+ rubyforge_project:
125
+ rubygems_version: 2.4.8
126
+ signing_key:
127
+ specification_version: 4
128
+ summary: Created for the purpose of autocomplete banks info.
129
+ test_files: []