market_bot 0.15.1 → 0.16.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/market_bot.rb +16 -0
- data/lib/market_bot/android/app.rb +10 -2
- data/lib/market_bot/android/leaderboard.rb +3 -1
- data/lib/market_bot/exceptions.rb +3 -2
- data/lib/market_bot/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 59cd879c52da9961e36e4ef57a63dc9713f024ca
|
4
|
+
data.tar.gz: 7312a30bed4ab78a77560be7ab7551beb9be1e7a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 91741e2d5550b7adfd1efdae920f4590a94502d1f03c2ebdc6b4fd06be2ffa8aa629a856e0157eb064233c33b3019e78a08885d7e9fcdf03d0e0a4eccfa4571f
|
7
|
+
data.tar.gz: a1de07b3787e5665447739a72f8918c8031bf00381a953b55a2ae68024946362aa7266ad3643c57ceacaa4aba0c51aa234c42353b542df6ac2184c24fbe7a7d8
|
data/lib/market_bot.rb
CHANGED
@@ -17,5 +17,21 @@ module MarketBot
|
|
17
17
|
def self.hydra
|
18
18
|
@hydra ||= Typhoeus::Hydra.new(:max_concurrency => 5)
|
19
19
|
end
|
20
|
+
|
21
|
+
def self.timeout
|
22
|
+
@timeout ||= 10
|
23
|
+
end
|
24
|
+
|
25
|
+
def self.timeout=(val)
|
26
|
+
@timeout = val
|
27
|
+
end
|
28
|
+
|
29
|
+
def self.connecttimeout
|
30
|
+
@connecttimeout ||= 10
|
31
|
+
end
|
32
|
+
|
33
|
+
def self.connecttimeout=(val)
|
34
|
+
@connecttimeout = val
|
35
|
+
end
|
20
36
|
end
|
21
37
|
|
@@ -175,9 +175,11 @@ module MarketBot
|
|
175
175
|
@app_id = app_id
|
176
176
|
@hydra = options[:hydra] || MarketBot.hydra
|
177
177
|
@lang = options[:lang] || 'en'
|
178
|
-
@request_opts = options[:request_opts] || {}
|
179
178
|
@callback = nil
|
180
179
|
@error = nil
|
180
|
+
@request_opts = options[:request_opts] || {}
|
181
|
+
@request_opts[:timeout] ||= MarketBot.timeout
|
182
|
+
@request_opts[:connecttimeout] ||= MarketBot.connecttimeout
|
181
183
|
end
|
182
184
|
|
183
185
|
def market_url
|
@@ -222,7 +224,13 @@ module MarketBot
|
|
222
224
|
if response.success?
|
223
225
|
App.parse(response.body)
|
224
226
|
else
|
225
|
-
|
227
|
+
codes = "code=#{response.code}, return_code=#{response.return_code}"
|
228
|
+
case response.code
|
229
|
+
when 404
|
230
|
+
raise MarketBot::AppNotFoundError.new("Unable to find app in store: #{codes}")
|
231
|
+
else
|
232
|
+
raise MarketBot::ResponseError.new("Unhandled response: #{codes}")
|
233
|
+
end
|
226
234
|
end
|
227
235
|
end
|
228
236
|
|
@@ -139,9 +139,11 @@ module MarketBot
|
|
139
139
|
@identifier = identifier
|
140
140
|
@category = category
|
141
141
|
@hydra = options[:hydra] || MarketBot.hydra
|
142
|
-
@request_opts = options[:request_opts] || {}
|
143
142
|
@parsed_results = []
|
144
143
|
@pending_pages = []
|
144
|
+
@request_opts = options[:request_opts] || {}
|
145
|
+
@request_opts[:timeout] ||= MarketBot.timeout
|
146
|
+
@request_opts[:connecttimeout] ||= MarketBot.connecttimeout
|
145
147
|
end
|
146
148
|
|
147
149
|
def market_urls(options={})
|
@@ -1,4 +1,5 @@
|
|
1
1
|
module MarketBot
|
2
|
-
|
3
|
-
class ResponseError <
|
2
|
+
class MarketBotError < StandardError; end
|
3
|
+
class ResponseError < MarketBotError; end
|
4
|
+
class AppNotFoundError < ResponseError; end
|
4
5
|
end
|
data/lib/market_bot/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: market_bot
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.16.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chad Remesch
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-05-
|
11
|
+
date: 2016-05-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: typhoeus
|