mic 0.0.1 → 0.9.0
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 +5 -13
- data/README.md +77 -2
- data/Rakefile +9 -0
- data/files/ISO10383.csv +1032 -0
- data/lib/mic.rb +2 -4
- data/lib/mic/mic.rb +22 -0
- data/lib/mic/search.rb +29 -0
- data/lib/mic/version.rb +2 -2
- data/mic.gemspec +6 -3
- metadata +60 -12
data/lib/mic.rb
CHANGED
data/lib/mic/mic.rb
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
class Mic
|
|
2
|
+
|
|
3
|
+
require 'csv'
|
|
4
|
+
|
|
5
|
+
FILE = 'files/ISO10383.csv'
|
|
6
|
+
|
|
7
|
+
class << self
|
|
8
|
+
|
|
9
|
+
def where(options = {})
|
|
10
|
+
include_segments = options[:include_segments] || false
|
|
11
|
+
puts include_segments
|
|
12
|
+
a = Mic::Search.new
|
|
13
|
+
a = a.select_by(:mic, options[:mic], include_segments) if options[:mic]
|
|
14
|
+
a = a.select_by(:operating_mic, options[:operating_mic], include_segments) if options[:operating_mic]
|
|
15
|
+
a = a.select_by(:market_name, options[:market_name], include_segments) if options[:market_name]
|
|
16
|
+
a = a.select_by(:country_code, options[:country_code], include_segments) if options[:country_code]
|
|
17
|
+
a
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
end
|
data/lib/mic/search.rb
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
class Mic
|
|
2
|
+
|
|
3
|
+
class Search
|
|
4
|
+
|
|
5
|
+
def initialize
|
|
6
|
+
@a = []
|
|
7
|
+
CSV.foreach(Mic::FILE) do |row|
|
|
8
|
+
h = {}
|
|
9
|
+
h[:mic] = row[2]
|
|
10
|
+
h[:acronym] = row[6]
|
|
11
|
+
h[:market_name] = row[5]
|
|
12
|
+
h[:market_type] = row[4]
|
|
13
|
+
h[:operating_mic] = row[3]
|
|
14
|
+
h[:country_code] = row[1]
|
|
15
|
+
h[:country_name] = row[0]
|
|
16
|
+
h[:city] = row[7]
|
|
17
|
+
h[:website] = row[8]
|
|
18
|
+
@a << h
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
def select_by(symbol, string, include_segments)
|
|
23
|
+
@a = @a.select{ |m| m[:market_type] == 'O' } unless include_segments
|
|
24
|
+
@a.select{ |m| m[symbol] =~ Regexp.new(string, 'i') }
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
end
|
data/lib/mic/version.rb
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
VERSION = "0.0
|
|
1
|
+
class Mic
|
|
2
|
+
VERSION = "0.9.0"
|
|
3
3
|
end
|
data/mic.gemspec
CHANGED
|
@@ -8,9 +8,9 @@ Gem::Specification.new do |spec|
|
|
|
8
8
|
spec.version = Mic::VERSION
|
|
9
9
|
spec.authors = ["Javier Vidal"]
|
|
10
10
|
spec.email = ["javier@javiervidal.net"]
|
|
11
|
-
spec.summary = 'MIC'
|
|
12
|
-
spec.description = 'MIC'
|
|
13
|
-
spec.homepage = ""
|
|
11
|
+
spec.summary = 'ISO 10383 - Market Identifier Codes (MIC)'
|
|
12
|
+
spec.description = 'Market Identifier Codes (MIC). The ISO 10383 specifies a universal method of identifying exchanges, trading platforms, regulated or non-regulated markets and trade reporting facilities as sources of prices and related information in order to facilitate automated processing.'
|
|
13
|
+
spec.homepage = "https://github.com/javiervidal/mic"
|
|
14
14
|
spec.license = "MIT"
|
|
15
15
|
|
|
16
16
|
spec.files = `git ls-files -z`.split("\x0")
|
|
@@ -20,4 +20,7 @@ Gem::Specification.new do |spec|
|
|
|
20
20
|
|
|
21
21
|
spec.add_development_dependency "bundler", "~> 1.5"
|
|
22
22
|
spec.add_development_dependency "rake"
|
|
23
|
+
spec.add_development_dependency "awesome_print"
|
|
24
|
+
spec.add_development_dependency "rspec"
|
|
25
|
+
spec.add_development_dependency "simplecov"
|
|
23
26
|
end
|
metadata
CHANGED
|
@@ -1,59 +1,107 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: mic
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0
|
|
4
|
+
version: 0.9.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Javier Vidal
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2014-11-
|
|
11
|
+
date: 2014-11-17 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
|
16
16
|
requirements:
|
|
17
|
-
- - ~>
|
|
17
|
+
- - "~>"
|
|
18
18
|
- !ruby/object:Gem::Version
|
|
19
19
|
version: '1.5'
|
|
20
20
|
type: :development
|
|
21
21
|
prerelease: false
|
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
|
23
23
|
requirements:
|
|
24
|
-
- - ~>
|
|
24
|
+
- - "~>"
|
|
25
25
|
- !ruby/object:Gem::Version
|
|
26
26
|
version: '1.5'
|
|
27
27
|
- !ruby/object:Gem::Dependency
|
|
28
28
|
name: rake
|
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
|
30
30
|
requirements:
|
|
31
|
-
- -
|
|
31
|
+
- - ">="
|
|
32
32
|
- !ruby/object:Gem::Version
|
|
33
33
|
version: '0'
|
|
34
34
|
type: :development
|
|
35
35
|
prerelease: false
|
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
|
37
37
|
requirements:
|
|
38
|
-
- -
|
|
38
|
+
- - ">="
|
|
39
39
|
- !ruby/object:Gem::Version
|
|
40
40
|
version: '0'
|
|
41
|
-
|
|
41
|
+
- !ruby/object:Gem::Dependency
|
|
42
|
+
name: awesome_print
|
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
|
44
|
+
requirements:
|
|
45
|
+
- - ">="
|
|
46
|
+
- !ruby/object:Gem::Version
|
|
47
|
+
version: '0'
|
|
48
|
+
type: :development
|
|
49
|
+
prerelease: false
|
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
51
|
+
requirements:
|
|
52
|
+
- - ">="
|
|
53
|
+
- !ruby/object:Gem::Version
|
|
54
|
+
version: '0'
|
|
55
|
+
- !ruby/object:Gem::Dependency
|
|
56
|
+
name: rspec
|
|
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: simplecov
|
|
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: Market Identifier Codes (MIC). The ISO 10383 specifies a universal method
|
|
84
|
+
of identifying exchanges, trading platforms, regulated or non-regulated markets
|
|
85
|
+
and trade reporting facilities as sources of prices and related information in order
|
|
86
|
+
to facilitate automated processing.
|
|
42
87
|
email:
|
|
43
88
|
- javier@javiervidal.net
|
|
44
89
|
executables: []
|
|
45
90
|
extensions: []
|
|
46
91
|
extra_rdoc_files: []
|
|
47
92
|
files:
|
|
48
|
-
- .gitignore
|
|
93
|
+
- ".gitignore"
|
|
49
94
|
- Gemfile
|
|
50
95
|
- LICENSE.txt
|
|
51
96
|
- README.md
|
|
52
97
|
- Rakefile
|
|
98
|
+
- files/ISO10383.csv
|
|
53
99
|
- lib/mic.rb
|
|
100
|
+
- lib/mic/mic.rb
|
|
101
|
+
- lib/mic/search.rb
|
|
54
102
|
- lib/mic/version.rb
|
|
55
103
|
- mic.gemspec
|
|
56
|
-
homepage:
|
|
104
|
+
homepage: https://github.com/javiervidal/mic
|
|
57
105
|
licenses:
|
|
58
106
|
- MIT
|
|
59
107
|
metadata: {}
|
|
@@ -63,12 +111,12 @@ require_paths:
|
|
|
63
111
|
- lib
|
|
64
112
|
required_ruby_version: !ruby/object:Gem::Requirement
|
|
65
113
|
requirements:
|
|
66
|
-
- -
|
|
114
|
+
- - ">="
|
|
67
115
|
- !ruby/object:Gem::Version
|
|
68
116
|
version: '0'
|
|
69
117
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
70
118
|
requirements:
|
|
71
|
-
- -
|
|
119
|
+
- - ">="
|
|
72
120
|
- !ruby/object:Gem::Version
|
|
73
121
|
version: '0'
|
|
74
122
|
requirements: []
|
|
@@ -76,5 +124,5 @@ rubyforge_project:
|
|
|
76
124
|
rubygems_version: 2.2.2
|
|
77
125
|
signing_key:
|
|
78
126
|
specification_version: 4
|
|
79
|
-
summary: MIC
|
|
127
|
+
summary: ISO 10383 - Market Identifier Codes (MIC)
|
|
80
128
|
test_files: []
|