market_bot 1.0.2 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6f707f649071abb6830d798f5fba1c8b3e7c4970
4
- data.tar.gz: f2f31e76497b853bdfc85d65b58139d9bdb51696
3
+ metadata.gz: 7906d07a5908e73e0d5ab52c2f2c7db934947865
4
+ data.tar.gz: cd3164cbc389e2251553de0b35d3c672e54d257d
5
5
  SHA512:
6
- metadata.gz: 5b9dc51098b5013fca3df07f6403c30fcc029ceb793c1119f246282b1159e63956ce14b7d1c299aa0ac26f769546cd3a5f46f188b3e02cf071621be6623052a8
7
- data.tar.gz: 8421f96b95626e6c04fa415e638d900d7fbcd0862594d1834fef8310262020000c0e26035ac11f92cd140f6f23bdcda0a8d24bbe540c11c6ce80027e95b9d145
6
+ metadata.gz: 3bc59b159dff66f3d11774d07fa17e5396fd9e9ff41aff2dd0c0901ee46aac84e1ad526590a4bfbf9f182850232ae140347f5ced1410157b2f655f705e2fecb7
7
+ data.tar.gz: ba15e8cf94c98969da8a60a7e176bf3d08ede174f13b9123e2f64d58ffdb31be7feab507e34ca98b7eeda3b8637456d5938a185f095dc10049a800d3cac997d9
@@ -132,13 +132,15 @@ module MarketBot
132
132
 
133
133
  result[:rating_distribution] = { 5 => nil, 4 => nil, 3 => nil, 2 => nil, 1 => nil }
134
134
 
135
- histogram = doc.css('div.rating-histogram')
136
- cur_index = 5
137
- %w(five four three two one).each do |slot|
138
- node = histogram.at_css(".#{slot.to_s}")
139
- result[:rating_distribution][cur_index] = node.css('.bar-number').text.gsub(/,/,'').to_i
140
- cur_index -= 1
141
-
135
+ if (histogram = doc.at_css('div.rating-histogram'))
136
+ cur_index = 5
137
+ %w(five four three two one).each do |slot|
138
+ node = histogram.at_css(".#{slot.to_s}")
139
+ result[:rating_distribution][cur_index] = node.css('.bar-number').text.gsub(/,/,'').to_i
140
+ cur_index -= 1
141
+ end
142
+ else
143
+ result[:rating_distribution] = nil
142
144
  end
143
145
 
144
146
  result[:html] = html
@@ -1,3 +1,3 @@
1
1
  module MarketBot
2
- VERSION = '1.0.2'
2
+ VERSION = '1.0.3'
3
3
  end
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: 1.0.2
4
+ version: 1.0.3
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-27 00:00:00.000000000 Z
11
+ date: 2016-06-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: typhoeus