flow-reference 0.2.85 → 0.2.87
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/io_flow_reference_v0.rb +1 -1
- metadata +7 -31
- data/.apidoc +0 -7
- data/.gitignore +0 -3
- data/Gemfile +0 -6
- data/Gemfile.lock +0 -36
- data/LICENSE +0 -21
- data/README.md +0 -49
- data/bin/build-currency.rb +0 -46
- data/bin/download.bash +0 -7
- data/bin/generate.bash +0 -3
- data/data/continents.json +0 -259
- data/data/countries.json +0 -2675
- data/data/currencies.json +0 -862
- data/data/languages.json +0 -1318
- data/data/locales.json +0 -3182
- data/data/payment-methods.json +0 -280
- data/data/regions.json +0 -4880
- data/flow-reference.gemspec +0 -16
- data/spec/common/basic_spec.rb +0 -30
- data/spec/spec_helper.rb +0 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c539e31599bcdfbb244ac4656648c56e64e7ed4f
|
4
|
+
data.tar.gz: 902a8ea23135186bfa58c4c9523e859de556a1a9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 948808f9990b43e2e43f755cd65d9388670a82912304e57a484bacb83a5348370213f811c268abf4e299c53e156fa840a4c30b6ce59d510dc8d8c623b405adb1
|
7
|
+
data.tar.gz: 8a9e1d5e2cde728ab3a4eb65b79805a15c7330d61f6215fb055509b66730618d4b956c310f25f9f7ee4baf6728f6e737534b984b64b2eb5ff5195427d46b27e9
|
data/lib/io_flow_reference_v0.rb
CHANGED
@@ -27,7 +27,7 @@ module Io
|
|
27
27
|
BASE_URL = 'https://api.flow.io/reference' unless defined?(Constants::BASE_URL)
|
28
28
|
NAMESPACE = 'io.flow.reference.v0' unless defined?(Constants::NAMESPACE)
|
29
29
|
USER_AGENT = 'apidoc:0.11.76 http://www.apidoc.me/flow/reference/0.2.83/ruby_client' unless defined?(Constants::USER_AGENT)
|
30
|
-
VERSION = '0.2.
|
30
|
+
VERSION = '0.2.87' unless defined?(Constants::VERSION)
|
31
31
|
VERSION_MAJOR = 0 unless defined?(VERSION_MAJOR)
|
32
32
|
|
33
33
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: flow-reference
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.87
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Bryzek
|
@@ -9,39 +9,17 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2017-
|
12
|
+
date: 2017-04-01 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: Flow helper libraries for working with https://api.flow.io
|
15
15
|
email: mbryzek@alum.mit.edu
|
16
|
-
executables:
|
17
|
-
- build-currency.rb
|
18
|
-
- download.bash
|
19
|
-
- generate.bash
|
16
|
+
executables: []
|
20
17
|
extensions: []
|
21
18
|
extra_rdoc_files: []
|
22
19
|
files:
|
23
|
-
- ".
|
24
|
-
- ".
|
25
|
-
-
|
26
|
-
- Gemfile.lock
|
27
|
-
- LICENSE
|
28
|
-
- README.md
|
29
|
-
- bin/build-currency.rb
|
30
|
-
- bin/download.bash
|
31
|
-
- bin/generate.bash
|
32
|
-
- data/continents.json
|
33
|
-
- data/countries.json
|
34
|
-
- data/currencies.json
|
35
|
-
- data/languages.json
|
36
|
-
- data/locales.json
|
37
|
-
- data/payment-methods.json
|
38
|
-
- data/regions.json
|
39
|
-
- flow-reference.gemspec
|
40
|
-
- lib/flow-reference.rb
|
41
|
-
- lib/generated/currencies.rb
|
42
|
-
- lib/io_flow_reference_v0.rb
|
43
|
-
- spec/common/basic_spec.rb
|
44
|
-
- spec/spec_helper.rb
|
20
|
+
- "./lib/flow-reference.rb"
|
21
|
+
- "./lib/generated/currencies.rb"
|
22
|
+
- "./lib/io_flow_reference_v0.rb"
|
45
23
|
homepage: https://www.flow.io
|
46
24
|
licenses:
|
47
25
|
- MIT
|
@@ -66,6 +44,4 @@ rubygems_version: 2.6.10
|
|
66
44
|
signing_key:
|
67
45
|
specification_version: 4
|
68
46
|
summary: Flow helpers
|
69
|
-
test_files:
|
70
|
-
- spec/common/basic_spec.rb
|
71
|
-
- spec/spec_helper.rb
|
47
|
+
test_files: []
|
data/.apidoc
DELETED
data/.gitignore
DELETED
data/Gemfile
DELETED
data/Gemfile.lock
DELETED
@@ -1,36 +0,0 @@
|
|
1
|
-
GEM
|
2
|
-
remote: http://rubygems.org/
|
3
|
-
specs:
|
4
|
-
awesome_print (1.7.0)
|
5
|
-
coderay (1.1.1)
|
6
|
-
diff-lcs (1.3)
|
7
|
-
method_source (0.8.2)
|
8
|
-
pry (0.10.4)
|
9
|
-
coderay (~> 1.1.0)
|
10
|
-
method_source (~> 0.8.1)
|
11
|
-
slop (~> 3.4)
|
12
|
-
rspec (3.5.0)
|
13
|
-
rspec-core (~> 3.5.0)
|
14
|
-
rspec-expectations (~> 3.5.0)
|
15
|
-
rspec-mocks (~> 3.5.0)
|
16
|
-
rspec-core (3.5.4)
|
17
|
-
rspec-support (~> 3.5.0)
|
18
|
-
rspec-expectations (3.5.0)
|
19
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
20
|
-
rspec-support (~> 3.5.0)
|
21
|
-
rspec-mocks (3.5.0)
|
22
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
23
|
-
rspec-support (~> 3.5.0)
|
24
|
-
rspec-support (3.5.0)
|
25
|
-
slop (3.6.0)
|
26
|
-
|
27
|
-
PLATFORMS
|
28
|
-
ruby
|
29
|
-
|
30
|
-
DEPENDENCIES
|
31
|
-
awesome_print
|
32
|
-
pry
|
33
|
-
rspec
|
34
|
-
|
35
|
-
BUNDLED WITH
|
36
|
-
1.14.3
|
data/LICENSE
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
MIT License
|
2
|
-
|
3
|
-
Copyright (c) 2017 Flow Commerce
|
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 all
|
13
|
-
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 THE
|
21
|
-
SOFTWARE.
|
data/README.md
DELETED
@@ -1,49 +0,0 @@
|
|
1
|
-
# lib-reference-ruby
|
2
|
-
|
3
|
-
## Usage
|
4
|
-
|
5
|
-
```
|
6
|
-
require 'flow-reference'
|
7
|
-
|
8
|
-
usd = Flow::Reference::Currencies.find("usd")
|
9
|
-
# or
|
10
|
-
usd = Flow::Reference::Currencies::Data.Usd
|
11
|
-
usd.to_cents(10) # 1000
|
12
|
-
|
13
|
-
Flow::Reference::Currencies::Data.Jpy.to_cents(105) # 105
|
14
|
-
```
|
15
|
-
|
16
|
-
## Developer Installation
|
17
|
-
|
18
|
-
```
|
19
|
-
bundler install # installs helper libs
|
20
|
-
bundler exec rspec # runs tests
|
21
|
-
|
22
|
-
bash ./bin/download.bash # gets json files
|
23
|
-
bash ./bin/generate.bash # auto-generates flow dep libs
|
24
|
-
```
|
25
|
-
|
26
|
-
### How it works?
|
27
|
-
|
28
|
-
* download fresh json with ./bin/download.bash
|
29
|
-
* generate libs with ./bin/generate.bash. Generated libs will be in ./lib/generated folder
|
30
|
-
* build and push gem
|
31
|
-
* gem build flow-reference.gemspec
|
32
|
-
* for local install and test
|
33
|
-
* gem install -l flow-reference-x-y-z.gem
|
34
|
-
* for the world
|
35
|
-
* gem push flow-reference-x-y-z.gem
|
36
|
-
* gem install 'flow-reference' # fresh install
|
37
|
-
* gem update 'flow-reference' # to get lates version
|
38
|
-
|
39
|
-
## Examples Converting to cents
|
40
|
-
|
41
|
-
```
|
42
|
-
Flow::Reference::Currencies::Data::Usd.to_cents("10.52") must equal(1052)
|
43
|
-
Flow::Reference::Currencies::Data::Usd.to_cents("10.524") must equal(1052)
|
44
|
-
Flow::Reference::Currencies::Data::Usd.to_cents("10.525") must equal(1053)
|
45
|
-
Flow::Reference::Currencies::Data::Usd.to_cents(100) must equal(10000)
|
46
|
-
Flow::Reference::Currencies::Data.Mro.to_cents("105") must equal(1050)
|
47
|
-
Flow::Reference::Currencies::Data.Mro.to_cents("105.55") must equal(1056)
|
48
|
-
Flow::Reference::Currencies::Data.Jpy.to_cents("105") must equal(105)
|
49
|
-
```
|
data/bin/build-currency.rb
DELETED
@@ -1,46 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
require 'json'
|
4
|
-
|
5
|
-
CURRENCY_LIB_FILE = './lib/generated/currencies.rb'
|
6
|
-
|
7
|
-
currencies = JSON.load File.read './data/currencies.json'
|
8
|
-
|
9
|
-
lib_data = []
|
10
|
-
|
11
|
-
lib_data.push '# Generated by Flow code builder'
|
12
|
-
lib_data.push ''
|
13
|
-
lib_data.push 'module Flow'
|
14
|
-
lib_data.push ' module Reference'
|
15
|
-
lib_data.push ' class Currencies'
|
16
|
-
lib_data.push ' class Data'
|
17
|
-
|
18
|
-
currencies.each do |currency|
|
19
|
-
code = currency['iso_4217_3']
|
20
|
-
lib_data.push ' def Data.%s' % code.downcase.capitalize
|
21
|
-
lib_data.push ' ::Io::Flow::Reference::V0::Models::Currency.new(%s)' % currency.to_json
|
22
|
-
lib_data.push ' end'
|
23
|
-
lib_data.push ''
|
24
|
-
end
|
25
|
-
|
26
|
-
lib_data.push ' end'
|
27
|
-
lib_data.push ''
|
28
|
-
lib_data.push ' def Currencies._get_currency(code)'
|
29
|
-
lib_data.push ' case code'
|
30
|
-
currencies.each do |currency|
|
31
|
-
code = currency['iso_4217_3'].to_s.downcase.gsub(/[^\w]/,"")
|
32
|
-
lib_data.push ' when :%s' % code
|
33
|
-
lib_data.push ' return Data.%s' % code.capitalize
|
34
|
-
end
|
35
|
-
lib_data.push ' end'
|
36
|
-
lib_data.push ' nil'
|
37
|
-
lib_data.push ' end'
|
38
|
-
lib_data.push ' end'
|
39
|
-
lib_data.push ' end'
|
40
|
-
lib_data.push 'end'
|
41
|
-
|
42
|
-
#puts lib_data.join("\n")
|
43
|
-
|
44
|
-
File.open(CURRENCY_LIB_FILE, 'w') { |file| file.write(lib_data.join("\n")) }
|
45
|
-
|
46
|
-
puts 'Generated %s with currency %d entries' % [CURRENCY_LIB_FILE, currencies.length]
|
data/bin/download.bash
DELETED
data/bin/generate.bash
DELETED
data/data/continents.json
DELETED
@@ -1,259 +0,0 @@
|
|
1
|
-
[
|
2
|
-
{
|
3
|
-
"name": "Africa",
|
4
|
-
"code": "AFR",
|
5
|
-
"countries": [
|
6
|
-
"BEN",
|
7
|
-
"BFA",
|
8
|
-
"BWA",
|
9
|
-
"CAF",
|
10
|
-
"CIV",
|
11
|
-
"CMR",
|
12
|
-
"COG",
|
13
|
-
"COM",
|
14
|
-
"CPV",
|
15
|
-
"DJI",
|
16
|
-
"DZA",
|
17
|
-
"EGY",
|
18
|
-
"ESH",
|
19
|
-
"ETH",
|
20
|
-
"GAB",
|
21
|
-
"GHA",
|
22
|
-
"GIN",
|
23
|
-
"GMB",
|
24
|
-
"GNB",
|
25
|
-
"GNQ",
|
26
|
-
"KEN",
|
27
|
-
"LBY",
|
28
|
-
"LSO",
|
29
|
-
"MAR",
|
30
|
-
"MLI",
|
31
|
-
"MRT",
|
32
|
-
"MUS",
|
33
|
-
"MWI",
|
34
|
-
"MYT",
|
35
|
-
"NAM",
|
36
|
-
"NER",
|
37
|
-
"NGA",
|
38
|
-
"REU",
|
39
|
-
"RWA",
|
40
|
-
"SEN",
|
41
|
-
"SHN",
|
42
|
-
"SLE",
|
43
|
-
"SOM",
|
44
|
-
"STP",
|
45
|
-
"SWZ",
|
46
|
-
"SYC",
|
47
|
-
"TCD",
|
48
|
-
"TGO",
|
49
|
-
"TUN",
|
50
|
-
"TZA",
|
51
|
-
"UGA",
|
52
|
-
"ZAF",
|
53
|
-
"ZMB"
|
54
|
-
]
|
55
|
-
},
|
56
|
-
{
|
57
|
-
"name": "Antarctica",
|
58
|
-
"code": "ANT",
|
59
|
-
"countries": null
|
60
|
-
},
|
61
|
-
{
|
62
|
-
"name": "Asia",
|
63
|
-
"code": "ASI",
|
64
|
-
"countries": [
|
65
|
-
"ARE",
|
66
|
-
"ARM",
|
67
|
-
"AZE",
|
68
|
-
"BGD",
|
69
|
-
"BHR",
|
70
|
-
"BRN",
|
71
|
-
"BTN",
|
72
|
-
"CHN",
|
73
|
-
"GEO",
|
74
|
-
"HKG",
|
75
|
-
"IDN",
|
76
|
-
"IND",
|
77
|
-
"ISR",
|
78
|
-
"JOR",
|
79
|
-
"JPN",
|
80
|
-
"KAZ",
|
81
|
-
"KGZ",
|
82
|
-
"KHM",
|
83
|
-
"KOR",
|
84
|
-
"KWT",
|
85
|
-
"LAO",
|
86
|
-
"LBN",
|
87
|
-
"LKA",
|
88
|
-
"MAC",
|
89
|
-
"MDV",
|
90
|
-
"MNG",
|
91
|
-
"MYS",
|
92
|
-
"NPL",
|
93
|
-
"OMN",
|
94
|
-
"PAK",
|
95
|
-
"PHL",
|
96
|
-
"QAT",
|
97
|
-
"SAU",
|
98
|
-
"SGP",
|
99
|
-
"THA",
|
100
|
-
"TUR",
|
101
|
-
"TWN",
|
102
|
-
"UZB",
|
103
|
-
"VNM",
|
104
|
-
"YEM"
|
105
|
-
]
|
106
|
-
},
|
107
|
-
{
|
108
|
-
"name": "Europe",
|
109
|
-
"code": "EUR",
|
110
|
-
"countries": [
|
111
|
-
"ALA",
|
112
|
-
"ALB",
|
113
|
-
"AND",
|
114
|
-
"AUT",
|
115
|
-
"BEL",
|
116
|
-
"BGR",
|
117
|
-
"BIH",
|
118
|
-
"CHE",
|
119
|
-
"CYP",
|
120
|
-
"CZE",
|
121
|
-
"DEU",
|
122
|
-
"DNK",
|
123
|
-
"ESP",
|
124
|
-
"EST",
|
125
|
-
"FIN",
|
126
|
-
"FRA",
|
127
|
-
"GBR",
|
128
|
-
"GGY",
|
129
|
-
"GIB",
|
130
|
-
"GRC",
|
131
|
-
"HRV",
|
132
|
-
"HUN",
|
133
|
-
"IMN",
|
134
|
-
"IRL",
|
135
|
-
"ISL",
|
136
|
-
"ITA",
|
137
|
-
"JEY",
|
138
|
-
"LIE",
|
139
|
-
"LTU",
|
140
|
-
"LUX",
|
141
|
-
"LVA",
|
142
|
-
"MCO",
|
143
|
-
"MDA",
|
144
|
-
"MLT",
|
145
|
-
"MNE",
|
146
|
-
"NLD",
|
147
|
-
"NOR",
|
148
|
-
"POL",
|
149
|
-
"PRT",
|
150
|
-
"ROU",
|
151
|
-
"RUS",
|
152
|
-
"SJM",
|
153
|
-
"SMR",
|
154
|
-
"SRB",
|
155
|
-
"SVK",
|
156
|
-
"SVN",
|
157
|
-
"SWE",
|
158
|
-
"UKR",
|
159
|
-
"VAT"
|
160
|
-
]
|
161
|
-
},
|
162
|
-
{
|
163
|
-
"name": "North America",
|
164
|
-
"code": "NOA",
|
165
|
-
"countries": [
|
166
|
-
"ABW",
|
167
|
-
"AIA",
|
168
|
-
"ATG",
|
169
|
-
"BES",
|
170
|
-
"BHS",
|
171
|
-
"BLM",
|
172
|
-
"BLZ",
|
173
|
-
"BMU",
|
174
|
-
"BRB",
|
175
|
-
"CAN",
|
176
|
-
"CRI",
|
177
|
-
"CUW",
|
178
|
-
"CYM",
|
179
|
-
"DMA",
|
180
|
-
"DOM",
|
181
|
-
"GLP",
|
182
|
-
"GRD",
|
183
|
-
"GRL",
|
184
|
-
"GTM",
|
185
|
-
"HND",
|
186
|
-
"HTI",
|
187
|
-
"JAM",
|
188
|
-
"KNA",
|
189
|
-
"LCA",
|
190
|
-
"MAF",
|
191
|
-
"MEX",
|
192
|
-
"MSR",
|
193
|
-
"MTQ",
|
194
|
-
"NIC",
|
195
|
-
"PAN",
|
196
|
-
"PRI",
|
197
|
-
"SLV",
|
198
|
-
"SPM",
|
199
|
-
"SXM",
|
200
|
-
"TCA",
|
201
|
-
"TTO",
|
202
|
-
"USA",
|
203
|
-
"VCT",
|
204
|
-
"VGB",
|
205
|
-
"VIR"
|
206
|
-
]
|
207
|
-
},
|
208
|
-
{
|
209
|
-
"name": "Oceania",
|
210
|
-
"code": "OCE",
|
211
|
-
"countries": [
|
212
|
-
"ASM",
|
213
|
-
"AUS",
|
214
|
-
"COK",
|
215
|
-
"FJI",
|
216
|
-
"FSM",
|
217
|
-
"GUM",
|
218
|
-
"KIR",
|
219
|
-
"MHL",
|
220
|
-
"MNP",
|
221
|
-
"NCL",
|
222
|
-
"NFK",
|
223
|
-
"NIU",
|
224
|
-
"NRU",
|
225
|
-
"NZL",
|
226
|
-
"PCN",
|
227
|
-
"PLW",
|
228
|
-
"PNG",
|
229
|
-
"PYF",
|
230
|
-
"SLB",
|
231
|
-
"TKL",
|
232
|
-
"TLS",
|
233
|
-
"TON",
|
234
|
-
"TUV",
|
235
|
-
"VUT",
|
236
|
-
"WLF",
|
237
|
-
"WSM"
|
238
|
-
]
|
239
|
-
},
|
240
|
-
{
|
241
|
-
"name": "South America",
|
242
|
-
"code": "SOA",
|
243
|
-
"countries": [
|
244
|
-
"ARG",
|
245
|
-
"BOL",
|
246
|
-
"BRA",
|
247
|
-
"CHL",
|
248
|
-
"COL",
|
249
|
-
"ECU",
|
250
|
-
"FLK",
|
251
|
-
"GUF",
|
252
|
-
"GUY",
|
253
|
-
"PER",
|
254
|
-
"PRY",
|
255
|
-
"URY",
|
256
|
-
"VEN"
|
257
|
-
]
|
258
|
-
}
|
259
|
-
]
|