tindie_api 0.1.8 → 0.1.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/tindie_api/version.rb +1 -1
- data/lib/tindie_api.rb +9 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1779e3faf74733ae9d38c9e079b0cd48580d0b8d4d60524e653930b8bff4ba90
|
4
|
+
data.tar.gz: a030c9c6440f8ee5383ed0a9f7d41b1a29c9f569054aaa9d61c3d721df8cb52a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9805356be076b7d086d3ea557401ca2543f198f6ded69c5f858c1367c6620dee0936741e33a2c5c35dfbc22ebffe62b8036e552066fe662a821d0ac25feaccd6
|
7
|
+
data.tar.gz: 2d507819ce2ce35d0e910c283d513d04f62269af140bd260eaec0a5eb27311f0a410a327e0ccf07bf8cc2acd28b5be63c24ff010b28800089c4a984f3fe1ff53
|
data/lib/tindie_api/version.rb
CHANGED
data/lib/tindie_api.rb
CHANGED
@@ -76,9 +76,16 @@ module TindieApi
|
|
76
76
|
url += "&shipped=#{shipped}" unless shipped.nil?
|
77
77
|
uri = URI(url)
|
78
78
|
response = Net::HTTP.get(uri)
|
79
|
-
|
79
|
+
|
80
|
+
if response.nil? || response.empty?
|
81
|
+
raise JSON::ParserError, "Empty response from Tindie API"
|
82
|
+
end
|
83
|
+
|
80
84
|
JSON.parse(response)
|
81
|
-
|
85
|
+
rescue JSON::ParserError => e
|
86
|
+
puts "Failed to parse JSON: #{response}"
|
87
|
+
raise e
|
88
|
+
end
|
82
89
|
|
83
90
|
def get_orders(shipped = nil)
|
84
91
|
raise ArgumentError, "shipped must be true, false, or nil" if !shipped.nil? && ![true, false].include?(shipped)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tindie_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Spencer Owen
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-12-
|
11
|
+
date: 2024-12-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|