shopifydev 0.0.27 → 0.0.28
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/shopifydev/test/valid_zip.rb +18 -9
- data/lib/shopifydev/test.rb +2 -0
- data/lib/shopifydev/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 47004a0eb9003e44d868576c6602018869e8ada3
|
4
|
+
data.tar.gz: 46577e6156117dd03dee5cdcb92729d6d36dc490
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5c665d7b4af97eab1fbc270c037b9aca02ededd5ce5dd49761f24ea41f09dcf84b7e8d27cb9a804d7b5b279e4e773c3b6465ebc396471b79ff03c30869f168eb
|
7
|
+
data.tar.gz: 5276cb4b3ad6fa423b27c7a484d033f9148d299a8dc49f11bfe2bafdadf5a1919621418c13d7c015010909d7c47548a4682e4180ce8a59209cd87a54234c7680
|
@@ -4268,13 +4268,22 @@ module ValidZip
|
|
4268
4268
|
"99901", "99903", "99918", "99919", "99921", "99922", "99923", "99925", "99926", "99927",
|
4269
4269
|
"99928", "99929", "99950"]
|
4270
4270
|
|
4271
|
-
|
4272
|
-
|
4273
|
-
|
4274
|
-
|
4275
|
-
|
4276
|
-
|
4277
|
-
|
4278
|
-
|
4279
|
-
|
4271
|
+
def self.valid_zip
|
4272
|
+
ValidZip::Zips.sample
|
4273
|
+
end
|
4274
|
+
|
4275
|
+
def self.valid_place(opts=nil)
|
4276
|
+
place = nil
|
4277
|
+
tries = 0
|
4278
|
+
loop do
|
4279
|
+
tries += 1
|
4280
|
+
return nil if tries > 100
|
4281
|
+
zip = valid_zip
|
4282
|
+
place = Oj.load(
|
4283
|
+
`curl http://zip.elevenbasetwo.com/v2/US/#{zip}`
|
4284
|
+
).with_indifferent_access.merge(zip: zip)
|
4285
|
+
break if opts.nil? || opts.all?{|k,v| place[k].nil? || (place[k].downcase == v.downcase)}
|
4286
|
+
end
|
4287
|
+
return place
|
4288
|
+
end
|
4280
4289
|
end
|
data/lib/shopifydev/test.rb
CHANGED
data/lib/shopifydev/version.rb
CHANGED