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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 34327eaaa0ac0aceb770ac807a61aff909317306c9510a31b2b68c683a823ea9
4
- data.tar.gz: f28adfcf950d6fdfc312e460990932ffdd471c119240dd83fbc685890a0ffae8
3
+ metadata.gz: 1779e3faf74733ae9d38c9e079b0cd48580d0b8d4d60524e653930b8bff4ba90
4
+ data.tar.gz: a030c9c6440f8ee5383ed0a9f7d41b1a29c9f569054aaa9d61c3d721df8cb52a
5
5
  SHA512:
6
- metadata.gz: cc189246c6deb32f97e0430f74f67d30a2ecd5c57143283364dafde619bd70e6dcab5a03e54d907f3a29d815e2a35bb1ae8b2ea0e46775e6292b3291871f7d55
7
- data.tar.gz: 8d7c602945e2f88edca791e4f313f7a2fcb6d12f744dc474e9786e2997e999918aed7359e51566c957752f480627f01a64460921713c935bfa3c65267b62eb68
6
+ metadata.gz: 9805356be076b7d086d3ea557401ca2543f198f6ded69c5f858c1367c6620dee0936741e33a2c5c35dfbc22ebffe62b8036e552066fe662a821d0ac25feaccd6
7
+ data.tar.gz: 2d507819ce2ce35d0e910c283d513d04f62269af140bd260eaec0a5eb27311f0a410a327e0ccf07bf8cc2acd28b5be63c24ff010b28800089c4a984f3fe1ff53
@@ -1,3 +1,3 @@
1
1
  module TindieApi
2
- VERSION = "0.1.8"
2
+ VERSION = "0.1.9"
3
3
  end
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
- raise JSON::ParserError, "Invalid JSON response from Tindie.com" if response.nil?
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
- end
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.8
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-23 00:00:00.000000000 Z
11
+ date: 2024-12-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler