api_gears 1.0.4 → 1.0.5

This diff has not been reviewed by any users.
Log in in order to be able to vote.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/api_gears.rb +5 -1
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0f507faa2482f5d973b16cccbd1e571f3475251cd2bd905cccc3e56557c4eeb1
4
- data.tar.gz: 16052d258d0e726758d00185999c6063b4ef9e05440406cdc4ff24d74714c9cc
3
+ metadata.gz: 5474a490a4667674a4f49e9293f530eb036a0fd03b08e9a186c83b9f26bf3255
4
+ data.tar.gz: d660f0d9fe17ba771ee63738d4d0a39269bc14c27aa62d25a39bd51826a3fc00
5
5
  SHA512:
6
- metadata.gz: 053a41ef2a760d158b8130b775357b32642b25e0bf5b5a61cb8c8dfc70f55b6925d3ce9af3e91b8e2238eb7013269f6059df87fb81e372535bd354c2d2b4216c
7
- data.tar.gz: d48f6cfd3fb8e7a6d58d9917309bfaced0f51352269a37560d505b986ca5f48d20386753b53e8e2bb405c6f77d1a0930ad4da53dd6943e1eb6775a64fb2be40f
6
+ metadata.gz: 20abc2d5430023f05af748c617b3fcbe127c561f3cd882a93f562dbe4ca622219f1bccbd03b903a118eecaa974657a4b34a23386c401d088929b9d8e8b935bc9
7
+ data.tar.gz: b6def0b792598c213884bae14efde9eec29405cb72760441367ae572774d718f7df155bdca9d3caf926b2cfe065814438c4ff43800982e2a664838b4d9ec418e
@@ -96,7 +96,11 @@ class ApiGears
96
96
  response = http.request(request)
97
97
  end
98
98
  @last_query_time = DateTime.now.strftime('%s').to_i
99
- data = JSON.parse(response.read_body)
99
+ if(response.content_type == "application/json")
100
+ data = JSON.parse(response.read_body)
101
+ else
102
+ data = response.read_body
103
+ end
100
104
  if(response.code.to_i >= 200 && response.code.to_i < 300)
101
105
  puts "success"
102
106
  return data
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: api_gears
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 1.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Greg Mikeska