adglare 0.0.5 → 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/adglare.rb +5 -2
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9516573c2c889c7f04b9b5391e704291544d9955
4
- data.tar.gz: c1a5c83e29752789f2c2adb5489ade508c6d45c2
3
+ metadata.gz: 7312ac495a7a1ba8d41cae88c4c782dc7d1bf4b4
4
+ data.tar.gz: f484a8710f6f396586107ba3504528b3e06c95ba
5
5
  SHA512:
6
- metadata.gz: 48c690fd54a7c935352a2a53d4735047fe98ca88ea3c5b29229f0b14bca1360791f549b25d2cf0c6304f5167708a85db063f48f5c18cb1e1741c7b48f30534df
7
- data.tar.gz: 9afe922f39cf597fb64129db057358023bc660644d6a65e480b64f895b7ca9ecc03a1c8ca39641874393ba153265e217859fe748d32466c3a11ab1fcf777ca9f
6
+ metadata.gz: 6150c4a2f962dd956d989d9f1036d302eca19467a21b601b913cc5b088c114ae7e375050eeed979ef3b311a160c2d00a1158a1db761deca7d23b2951ebb8fbd0
7
+ data.tar.gz: c9d91322b378031aace3d607350a04693f0f3a2a8e8f7789fb920f5a86b03ada7789ea6b66aa948493edb746e2249138547f9f6e81034533c145326fe949d366
@@ -2,7 +2,8 @@ class Adglare
2
2
  require 'digest/sha1'
3
3
  require 'curb'
4
4
  require 'json'
5
-
5
+ require 'byebug'
6
+
6
7
  attr_accessor :public_key, :private_key, :ajax
7
8
  # If ajax is true, the class will output the required Javascript to make the API call, instead of using CURL
8
9
 
@@ -173,9 +174,11 @@ class Adglare
173
174
  # parse response into JSON object
174
175
  json = JSON.parse content
175
176
 
176
- if json["response"]["success"] == '1'
177
+ if json["response"]["success"] == '1' || json["response"]["errormsg"] == "No results with these filters."
177
178
  if json["response"]["data"]
178
179
  return json["response"]["data"]
180
+ elsif json["response"]["errormsg"] == "No results with these filters."
181
+ return []
179
182
  else
180
183
  return json["response"]
181
184
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: adglare
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nicolas Connault