wedding_registry_scraper 0.0.2 → 0.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: 1d95783063ce46d1a28af98b6c3330bd8d33ba95
4
- data.tar.gz: 56298d31eba3630e7a1f28bfd4565f655f110708
3
+ metadata.gz: cdde10975ee6f2819318a2482570e57f7f506d5c
4
+ data.tar.gz: f563bea9a46a59ce12f1716afcc63a69de34fb88
5
5
  SHA512:
6
- metadata.gz: 0f82473b27cf53ccdd6d000b2543256fe72ae7d35322e06a4eef9b71cf2b30bf780cf2a00d169adb7bbc38b0dc8e2a771f904768e02b85ac3caa125c1c433d14
7
- data.tar.gz: b29414b56a8faab31165d8fece59f57b2a5bc568aae8ce9809ad8cfadd14149d98befab78b7fa8d388d58ad58ef0ab55bfcdf798af0783a1a63e5a776b6eeebd
6
+ metadata.gz: 4b4998f93832e42d6b6ab9b9fc3bf23fbb4a6c2db31160c922dec647e8fdcc9de6ffb7d3bd653cabf36f3559e8210a060fb45ac549629ce2e607a7b824c2b8c3
7
+ data.tar.gz: b983f9fcd8277d212f6f56d57c444aed5c69502aa0eae6476c3acc92f5a1c66779d75a6815d01838e115adaa69373d9e67017dd89f0e4bbc5990e7c3d456889c
@@ -24,11 +24,18 @@ private
24
24
  product.css('[data-image-url]')[0]['data-image-url']
25
25
  end
26
26
 
27
+ def get_needed_section(product)
28
+ product.css('.needed').text.strip
29
+ end
30
+
27
31
  def get_remaining(product)
28
- product.css('.needed').text.strip.gsub(/[^\d]+/, '').to_i
32
+ needed_text = get_needed_section(product)
33
+ /Still Needs: (\d+)/.match(needed_text) { $1 }.to_i
29
34
  end
30
35
 
31
36
  def get_desired(product)
37
+ needed_text = get_needed_section(product)
38
+ /Requested: (\d+)/.match(needed_text) { $1 }.to_i
32
39
  end
33
40
 
34
41
  def get_price(product)
@@ -1,5 +1,5 @@
1
1
  module WeddingRegistryScraper
2
- VERSION = Gem::Version.new("0.0.2")
2
+ VERSION = Gem::Version.new("0.0.3")
3
3
 
4
4
  def self.version
5
5
  VERSION
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wedding_registry_scraper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Pariser
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-21 00:00:00.000000000 Z
11
+ date: 2015-04-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: unirest