fifthgear 0.0.3 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/fifthgear.rb +1 -0
- data/lib/fifthgear/code_maps.rb +343 -0
- data/lib/fifthgear/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7fe1a573bf14e49ccb363fde9ec4a921807a6aa3
|
4
|
+
data.tar.gz: fd095b8450901282e00244a47755f338436abc67
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f71c4daf685e9a554a775c7ff223259663c713a8979ecb83671694c5267feff32dad4b244aeac0496ad223ca1eb823f473a19d3f3a0e2af842ab0256c9bd4a51
|
7
|
+
data.tar.gz: 05903711c568bf841cd69c979bd7e3dc40fe6af95cc2951e13b06185de6ae29a93b84b850561e6f3354bb56292b08ad4a6e4aa257242839748eed75673c92650
|
data/lib/fifthgear.rb
CHANGED
@@ -0,0 +1,343 @@
|
|
1
|
+
require 'fifthgear'
|
2
|
+
module Fifthgear
|
3
|
+
class CodeMaps
|
4
|
+
Countries = {
|
5
|
+
"AFG" => 1,
|
6
|
+
"ALA" => 2,
|
7
|
+
"ALB" => 3,
|
8
|
+
"DZA" => 4,
|
9
|
+
"ASM" => 5,
|
10
|
+
"AND" => 6,
|
11
|
+
"AGO" => 7,
|
12
|
+
"AIA" => 8,
|
13
|
+
"ATA" => 9,
|
14
|
+
"ATG" => 10,
|
15
|
+
"ARG" => 11,
|
16
|
+
"ARM" => 12,
|
17
|
+
"ABW" => 13,
|
18
|
+
"AUS" => 14,
|
19
|
+
"AUT" => 15,
|
20
|
+
"AZE" => 16,
|
21
|
+
"BHS" => 17,
|
22
|
+
"BHR" => 18,
|
23
|
+
"BGD" => 19,
|
24
|
+
"BRB" => 20,
|
25
|
+
"BLR" => 21,
|
26
|
+
"BEL" => 22,
|
27
|
+
"BLZ" => 23,
|
28
|
+
"BEN" => 24,
|
29
|
+
"BMU" => 25,
|
30
|
+
"BTN" => 26,
|
31
|
+
"BOL" => 27,
|
32
|
+
"BIH" => 28,
|
33
|
+
"BWA" => 29,
|
34
|
+
"BVT" => 30,
|
35
|
+
"BRA" => 31,
|
36
|
+
"IOT" => 32,
|
37
|
+
"BRN" => 33,
|
38
|
+
"BGR" => 34,
|
39
|
+
"BFA" => 35,
|
40
|
+
"BDI" => 36,
|
41
|
+
"KHM" => 37,
|
42
|
+
"CMR" => 38,
|
43
|
+
"CAN" => 39,
|
44
|
+
"CPV" => 40,
|
45
|
+
"CYM" => 41,
|
46
|
+
"CAF" => 42,
|
47
|
+
"TCD" => 43,
|
48
|
+
"CHL" => 44,
|
49
|
+
"CHN" => 45,
|
50
|
+
"CXR" => 46,
|
51
|
+
"CCK" => 47,
|
52
|
+
"COL" => 48,
|
53
|
+
"COM" => 49,
|
54
|
+
"COG" => 50,
|
55
|
+
"COD" => 51,
|
56
|
+
"COK" => 52,
|
57
|
+
"CRI" => 53,
|
58
|
+
"CIV" => 54,
|
59
|
+
"HRV" => 55,
|
60
|
+
"CUB" => 56,
|
61
|
+
"CYP" => 57,
|
62
|
+
"CZE" => 58,
|
63
|
+
"DNK" => 59,
|
64
|
+
"DJI" => 60,
|
65
|
+
"DMA" => 61,
|
66
|
+
"DOM" => 62,
|
67
|
+
"ECU" => 63,
|
68
|
+
"EGY" => 64,
|
69
|
+
"SLV" => 65,
|
70
|
+
"GNQ" => 66,
|
71
|
+
"ERI" => 67,
|
72
|
+
"EST" => 68,
|
73
|
+
"ETH" => 69,
|
74
|
+
"FLK" => 70,
|
75
|
+
"FRO" => 71,
|
76
|
+
"FJI" => 72,
|
77
|
+
"FIN" => 73,
|
78
|
+
"FRA" => 74,
|
79
|
+
"GUF" => 75,
|
80
|
+
"PYF" => 76,
|
81
|
+
"ATF" => 77,
|
82
|
+
"GAB" => 78,
|
83
|
+
"GMB" => 79,
|
84
|
+
"GEO" => 80,
|
85
|
+
"DEU" => 81,
|
86
|
+
"GHA" => 82,
|
87
|
+
"GIB" => 83,
|
88
|
+
"GRC" => 84,
|
89
|
+
"GRL" => 85,
|
90
|
+
"GRD" => 86,
|
91
|
+
"GLP" => 87,
|
92
|
+
"GUM" => 88,
|
93
|
+
"GTM" => 89,
|
94
|
+
"GGY" => 90,
|
95
|
+
"GIN" => 91,
|
96
|
+
"GNB" => 92,
|
97
|
+
"GUY" => 93,
|
98
|
+
"HTI" => 94,
|
99
|
+
"HMD" => 95,
|
100
|
+
"VAT" => 96,
|
101
|
+
"HND" => 97,
|
102
|
+
"HKG" => 98,
|
103
|
+
"HUN" => 99,
|
104
|
+
"ISL" => 100,
|
105
|
+
"IND" => 101,
|
106
|
+
"IDN" => 102,
|
107
|
+
"IRN" => 103,
|
108
|
+
"IRQ" => 104,
|
109
|
+
"IRL" => 105,
|
110
|
+
"IMN" => 106,
|
111
|
+
"ISR" => 107,
|
112
|
+
"ITA" => 108,
|
113
|
+
"JAM" => 109,
|
114
|
+
"JPN" => 110,
|
115
|
+
"JEY" => 111,
|
116
|
+
"JOR" => 112,
|
117
|
+
"KAZ" => 113,
|
118
|
+
"KEN" => 114,
|
119
|
+
"KIR" => 115,
|
120
|
+
"PRK" => 116,
|
121
|
+
"KOR" => 117,
|
122
|
+
"KWT" => 118,
|
123
|
+
"KGZ" => 119,
|
124
|
+
"LAO" => 120,
|
125
|
+
"LVA" => 121,
|
126
|
+
"LBN" => 122,
|
127
|
+
"LSO" => 123,
|
128
|
+
"LBR" => 124,
|
129
|
+
"LBY" => 125,
|
130
|
+
"LIE" => 126,
|
131
|
+
"LTU" => 127,
|
132
|
+
"LUX" => 128,
|
133
|
+
"MAC" => 129,
|
134
|
+
"MKD" => 130,
|
135
|
+
"MDG" => 131,
|
136
|
+
"MWI" => 132,
|
137
|
+
"MYS" => 133,
|
138
|
+
"MDV" => 134,
|
139
|
+
"MLI" => 135,
|
140
|
+
"MLT" => 136,
|
141
|
+
"MHL" => 137,
|
142
|
+
"MTQ" => 138,
|
143
|
+
"MRT" => 139,
|
144
|
+
"MUS" => 140,
|
145
|
+
"MYT" => 141,
|
146
|
+
"MEX" => 142,
|
147
|
+
"FSM" => 143,
|
148
|
+
"MDA" => 144,
|
149
|
+
"MCO" => 145,
|
150
|
+
"MNG" => 146,
|
151
|
+
"MNE" => 147,
|
152
|
+
"MSR" => 148,
|
153
|
+
"MAR" => 149,
|
154
|
+
"MOZ" => 150,
|
155
|
+
"MMR" => 151,
|
156
|
+
"NAM" => 152,
|
157
|
+
"NRU" => 153,
|
158
|
+
"NPL" => 154,
|
159
|
+
"NLD" => 155,
|
160
|
+
"ANT" => 156,
|
161
|
+
"NCL" => 157,
|
162
|
+
"NZL" => 158,
|
163
|
+
"NIC" => 159,
|
164
|
+
"NER" => 160,
|
165
|
+
"NGA" => 161,
|
166
|
+
"NIU" => 162,
|
167
|
+
"NFK" => 163,
|
168
|
+
"MNP" => 164,
|
169
|
+
"NOR" => 165,
|
170
|
+
"OMN" => 166,
|
171
|
+
"PAK" => 167,
|
172
|
+
"PLW" => 168,
|
173
|
+
"PSE" => 169,
|
174
|
+
"PAN" => 170,
|
175
|
+
"PNG" => 171,
|
176
|
+
"PRY" => 172,
|
177
|
+
"PER" => 173,
|
178
|
+
"PHL" => 174,
|
179
|
+
"PCN" => 175,
|
180
|
+
"POL" => 176,
|
181
|
+
"PRT" => 177,
|
182
|
+
"PRI" => 178,
|
183
|
+
"QAT" => 179,
|
184
|
+
"REU" => 180,
|
185
|
+
"ROM" => 181,
|
186
|
+
"RUS" => 182,
|
187
|
+
"RWA" => 183,
|
188
|
+
"SHN" => 184,
|
189
|
+
"KNA" => 185,
|
190
|
+
"LCA" => 186,
|
191
|
+
"SPM" => 187,
|
192
|
+
"VCT" => 188,
|
193
|
+
"WSM" => 189,
|
194
|
+
"SMR" => 190,
|
195
|
+
"STP" => 191,
|
196
|
+
"SAU" => 192,
|
197
|
+
"SEN" => 193,
|
198
|
+
"SRB" => 194,
|
199
|
+
"SYC" => 195,
|
200
|
+
"SLE" => 196,
|
201
|
+
"SGP" => 197,
|
202
|
+
"SVK" => 198,
|
203
|
+
"SVN" => 199,
|
204
|
+
"SLB" => 200,
|
205
|
+
"SOM" => 201,
|
206
|
+
"ZAF" => 202,
|
207
|
+
"SGS" => 203,
|
208
|
+
"ESP" => 204,
|
209
|
+
"LKA" => 205,
|
210
|
+
"SDN" => 206,
|
211
|
+
"SUR" => 207,
|
212
|
+
"SJM" => 208,
|
213
|
+
"SWZ" => 209,
|
214
|
+
"SWE" => 210,
|
215
|
+
"CHE" => 211,
|
216
|
+
"SYR" => 212,
|
217
|
+
"TWN" => 213,
|
218
|
+
"TJK" => 214,
|
219
|
+
"TZA" => 215,
|
220
|
+
"THA" => 216,
|
221
|
+
"TLS" => 217,
|
222
|
+
"TGO" => 218,
|
223
|
+
"TKL" => 219,
|
224
|
+
"TON" => 220,
|
225
|
+
"TTO" => 221,
|
226
|
+
"TUN" => 222,
|
227
|
+
"TUR" => 223,
|
228
|
+
"TKM" => 224,
|
229
|
+
"TCA" => 225,
|
230
|
+
"TUV" => 226,
|
231
|
+
"UGA" => 227,
|
232
|
+
"UKR" => 228,
|
233
|
+
"ARE" => 229,
|
234
|
+
"GBR" => 230,
|
235
|
+
"USA" => 231,
|
236
|
+
"UMI" => 232,
|
237
|
+
"URY" => 233,
|
238
|
+
"UZB" => 234,
|
239
|
+
"VUT" => 235,
|
240
|
+
"VEN" => 236,
|
241
|
+
"VNM" => 237,
|
242
|
+
"VGB" => 238,
|
243
|
+
"VIR" => 239,
|
244
|
+
"WLF" => 240,
|
245
|
+
"ESH" => 241,
|
246
|
+
"YEM" => 242,
|
247
|
+
"ZMB" => 243,
|
248
|
+
"ZWE" => 244
|
249
|
+
}
|
250
|
+
|
251
|
+
StatesOrProvinces = {
|
252
|
+
"PR" => 0,
|
253
|
+
"AS" => 1,
|
254
|
+
"FM" => 2,
|
255
|
+
"GU" => 3,
|
256
|
+
"MH" => 4,
|
257
|
+
"MP" => 5,
|
258
|
+
"PW" => 6,
|
259
|
+
"VI" => 7,
|
260
|
+
"UM" => 8,
|
261
|
+
"AL" => 9,
|
262
|
+
"AK" => 10,
|
263
|
+
"AZ" => 11,
|
264
|
+
"AR" => 12,
|
265
|
+
"CA" => 13,
|
266
|
+
"CO" => 14,
|
267
|
+
"CT" => 15,
|
268
|
+
"DE" => 16,
|
269
|
+
"DC" => 17,
|
270
|
+
"FL" => 18,
|
271
|
+
"GA" => 19,
|
272
|
+
"HI" => 20,
|
273
|
+
"ID" => 21,
|
274
|
+
"IL" => 22,
|
275
|
+
"IN" => 23,
|
276
|
+
"IA" => 24,
|
277
|
+
"KS" => 25,
|
278
|
+
"KY" => 26,
|
279
|
+
"LA" => 27,
|
280
|
+
"ME" => 28,
|
281
|
+
"MD" => 29,
|
282
|
+
"MA" => 30,
|
283
|
+
"MI" => 31,
|
284
|
+
"MN" => 32,
|
285
|
+
"MS" => 33,
|
286
|
+
"MO" => 34,
|
287
|
+
"MT" => 35,
|
288
|
+
"NE" => 36,
|
289
|
+
"NV" => 37,
|
290
|
+
"NH" => 38,
|
291
|
+
"NJ" => 39,
|
292
|
+
"NM" => 40,
|
293
|
+
"NY" => 41,
|
294
|
+
"NC" => 42,
|
295
|
+
"ND" => 43,
|
296
|
+
"OH" => 44,
|
297
|
+
"OK" => 45,
|
298
|
+
"OR" => 46,
|
299
|
+
"PA" => 47,
|
300
|
+
"RI" => 48,
|
301
|
+
"SC" => 49,
|
302
|
+
"SD" => 50,
|
303
|
+
"TN" => 51,
|
304
|
+
"TX" => 52,
|
305
|
+
"UT" => 53,
|
306
|
+
"VT" => 54,
|
307
|
+
"VA" => 55,
|
308
|
+
"WA" => 56,
|
309
|
+
"WV" => 57,
|
310
|
+
"WI" => 58,
|
311
|
+
"WY" => 59,
|
312
|
+
"AE" => 60,
|
313
|
+
"AA" => 61,
|
314
|
+
"AP" => 62,
|
315
|
+
"AB" => 63,
|
316
|
+
"BC" => 64,
|
317
|
+
"MB" => 65,
|
318
|
+
"NB" => 66,
|
319
|
+
"NL" => 67,
|
320
|
+
"NT" => 68,
|
321
|
+
"NS" => 69,
|
322
|
+
"ON" => 70,
|
323
|
+
"PE" => 71,
|
324
|
+
"QC" => 72,
|
325
|
+
"SK" => 73,
|
326
|
+
"YT" => 74,
|
327
|
+
"NU" => 75,
|
328
|
+
"Other" => 76
|
329
|
+
}
|
330
|
+
|
331
|
+
def self.state_or_province_code(state)
|
332
|
+
StatesOrProvinces[state] || StatesOrProvinces["Other"]
|
333
|
+
end
|
334
|
+
|
335
|
+
Shipping = {
|
336
|
+
fedex_smart_post: {label: "FedEx SmartPost", code: "SF1"},
|
337
|
+
usps_priority: {label: "USPS Priority", code: "P03"},
|
338
|
+
ldmk_express: {label: "LDMK Express (2-4)", code: "Z99"},
|
339
|
+
ldmk_standard: {label: "LDMK Standard (3-8)", code: "Z98"}
|
340
|
+
}
|
341
|
+
end
|
342
|
+
|
343
|
+
end
|
data/lib/fifthgear/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fifthgear
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tom Hanley
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-10-
|
11
|
+
date: 2014-10-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -113,6 +113,7 @@ files:
|
|
113
113
|
- lib/fifthgear.rb
|
114
114
|
- lib/fifthgear/cart.rb
|
115
115
|
- lib/fifthgear/client.rb
|
116
|
+
- lib/fifthgear/code_maps.rb
|
116
117
|
- lib/fifthgear/configuration.rb
|
117
118
|
- lib/fifthgear/helper.rb
|
118
119
|
- lib/fifthgear/item.rb
|