mini_autobot 0.0.6 → 0.0.7

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: 7d5e760ec10a2b75b9954d6825519b9316fd6683
4
- data.tar.gz: a2f02d827a7a120262a51267a648af8d93afb6d7
3
+ metadata.gz: 450c062a5d8552df67d74eabc30a98985cc486b6
4
+ data.tar.gz: 3873f47a095042190509d027abdb4a9df7ba773b
5
5
  SHA512:
6
- metadata.gz: 1758a33d13a6f816f6cdc55af2a6e7576459e761286dd99e91879b34fcbac2a5a240e7590f90e768cc8b2553406269d560d140838ad2b9efb02b42491e3c3d21
7
- data.tar.gz: c60e1084788c836d5fb0519f0c1197af3627c708da526e9a9c8baaf243713555bd80a57d249de93f45b34afba558e1f0c3551efec7aa953e35d508e4b6a7105d
6
+ metadata.gz: 6a4d9406f93ed67b7f4be16c645406e286a92da76909adbf50b2f6ce8bd00c417a3af17b45e6bb9220de7807e9d9b03507436f17b5c76a30341892907246d88c
7
+ data.tar.gz: 4ae84816a493fb8ad624874bb7e868e4a1679be3197b4ece58b0e1c7eb12b99d2df8f337fa1401b30453e769fcedd92fb6501494f58739bbb2e61e096e5ec666
@@ -146,6 +146,21 @@ module MiniAutobot
146
146
  return value
147
147
  end
148
148
 
149
+ # Retry a block of code for a number of times
150
+ def retry_with_count(count, &block)
151
+ try = 0
152
+ count.times do
153
+ try += 1
154
+ begin
155
+ block.call
156
+ return true
157
+ rescue Exception => e
158
+ MiniAutobot.logger.warn "Exception: #{e}\nfrom\n#{block.source_location.join(':')}"
159
+ MiniAutobot.logger.warn "Retrying" if try < count
160
+ end
161
+ end
162
+ end
163
+
149
164
  # Check if a web element exists on page or not, without wait
150
165
  def is_element_present?(how, what, driver = nil)
151
166
  element_appeared?(how, what, driver)
@@ -1,3 +1,3 @@
1
1
  module MiniAutobot
2
- VERSION = '0.0.6'
2
+ VERSION = '0.0.7'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mini_autobot
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ripta Pasay
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2015-08-21 00:00:00.000000000 Z
13
+ date: 2015-08-27 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activesupport