pet_rescue-scraper 1.1.0 → 1.2.0

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: 54be7848062e5bb60907a0569975e20654f7b63a
4
- data.tar.gz: 939c3871b89b4a93f7b5e3d89b140a5ff9c4af04
3
+ metadata.gz: 95529b59301edbc50910043e7ad256dbdd1d998c
4
+ data.tar.gz: 8855463c233833ce3d5cd55634998d8456699c8f
5
5
  SHA512:
6
- metadata.gz: 94f1ff15d60c9bfd9f505e5dd2a0c75634251a3ad560c7e47b068656808dc951839cf137d60a51fcc277da4cb1eaed9e883fd0bfb1e7e224b4f55ade101eaea1
7
- data.tar.gz: 93298f5821c3869629b5d2bd079b157ffc4e7a57287363774f7162bb434efc12839c9a2f1a800491cf600e0cfa023cb49e4acf1c3bff023352b3adcf4e8a6b95
6
+ metadata.gz: 37395780534ce92d5713f68ae86faa50e8729e3bd3e6bd899bfb81cc74e85d5e898e39075ab0584e11524931ac3df6cb80c89b3dcdf1caec82ee3e181caaaf01
7
+ data.tar.gz: 441243911b898c80a581569e24ec769789d6d74529a49fa250b0d195bbf33fc4fa7d14c974509fecac779528d4777794a30fd2c77d26077dbef533007bfeb770
@@ -5,6 +5,10 @@ module PetRescue
5
5
  class ListingPage
6
6
  attr_reader :id
7
7
 
8
+ def self.for_listing(id)
9
+ new(id, ListingPageParser.new)
10
+ end
11
+
8
12
  def initialize(id, parser)
9
13
  @id = id
10
14
  @url = "http://www.petrescue.com.au/listings/#{@id}"
@@ -1,5 +1,5 @@
1
1
  module PetRescue
2
2
  module Scraper
3
- VERSION = "1.1.0"
3
+ VERSION = "1.2.0"
4
4
  end
5
5
  end
@@ -15,10 +15,7 @@ module PetRescue
15
15
  end
16
16
 
17
17
  def listing_pages
18
- listing_ids.map do |id|
19
- parser = PetRescue::ListingPageParser.new
20
- ListingPage.new(id, parser)
21
- end
18
+ listing_ids.map { |id| ListingPage.for_listing(id) }
22
19
  end
23
20
 
24
21
  def has_next_page?
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pet_rescue-scraper
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Smith
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-11 00:00:00.000000000 Z
11
+ date: 2014-10-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri