galerts 1.0.5 → 1.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 877b4d65b38edf96bc4da168d3501ad6af933738
4
- data.tar.gz: ca6a0faa18b190b28592fe67a19d18538e281bfc
3
+ metadata.gz: a115cb20e419155562ad8d1c81de77d64e143a84
4
+ data.tar.gz: 35109efa123cf9433bc8fcf2f1760a553c9099d5
5
5
  SHA512:
6
- metadata.gz: 61c62948e20d35c47f14e021439a5a876447c22f3dba86a4503b1f7fe2c4cb0861d83030065f86eba8501134ae6054690a18cac0abd3cb1a14bc182c7aef284a
7
- data.tar.gz: fd516486d76b32515e6a0e5f26d6fe953d49d7cc22a6d6efa709a2439f4e41ab971ebc31a07bc756b93be3387e834b654c0e520d9d31da32bdd53e1daa4a7911
6
+ metadata.gz: 6dc87543aea78b84ddf00e030986058e69baadfef80a2590993f1c5c1255f80051396dc20aa61a17e720ad9da9d2b4e8d3a4c22ef4e8c98f23444c2b860a8095
7
+ data.tar.gz: 67e9794c8ab97fdd9824e5a0f972091602895f0bec055c0fd7958d439e4f0d4917a35eee748efcb04c78bff305aeab141d9c28eabb45ac9010174c6159c8f890
@@ -19,6 +19,7 @@ module Galerts
19
19
  ALERT_EXIST = "[null,11,null,\"\"]"
20
20
  ALERT_SOMETHING_WENT_WRONG = "[null,7,null,\"\"]"
21
21
  ALERT_NOT_EXIST = "[null,5,null,\"\"]"
22
+ ALERT_LIMIT_EXCEEDED = "[null,4,null,\"\"]"
22
23
  # Google Value
23
24
  BEST_RESULTS = 'Only the best results'
24
25
  ALL_RESULTS = 'All results'
@@ -15,6 +15,8 @@ module Galerts
15
15
  @agent.keep_alive = true
16
16
  @agent.redirect_ok = true
17
17
  @agent.follow_meta_refresh = true
18
+ @agent.open_timeout=10
19
+ @agent.read_timeout=10
18
20
  end
19
21
 
20
22
  def login
@@ -133,6 +135,8 @@ module Galerts
133
135
  find_by_query(query).first
134
136
  elsif response.body == ALERT_SOMETHING_WENT_WRONG
135
137
  raise "Something went wrong!" # internal error, html changed maybe
138
+ elsif response.body == ALERT_LIMIT_EXCEEDED
139
+ raise "You have exceeded the limit of 1000 alerts per account"
136
140
  else
137
141
  response_body = response.body.gsub('null', 'nil')
138
142
  created_alert = Nokogiri::HTML(eval(response_body)[4][0][2], nil, 'utf-8')
@@ -1,3 +1,3 @@
1
1
  module Galerts
2
- VERSION = '1.0.5'.freeze unless defined?(::Galerts::VERSION)
2
+ VERSION = '1.0.6'.freeze unless defined?(::Galerts::VERSION)
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: galerts
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.5
4
+ version: 1.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Emre Can Yılmaz