gatherer 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -5,10 +5,10 @@ require 'gatherer/card_parser'
5
5
  module Gatherer
6
6
  class Client
7
7
  def fetch_by_multiverse_id(id)
8
- card_from(scraper(id))
8
+ card_from(multiverse_scraper(id))
9
9
  end
10
10
 
11
- def scraper(id)
11
+ def multiverse_scraper(id)
12
12
  Gatherer::Scraper.new(multiverse_id: id)
13
13
  end
14
14
 
@@ -20,5 +20,14 @@ module Gatherer
20
20
  parser = Gatherer::CardParser.new(page_from(scraper))
21
21
  Card.new_from_parser(parser)
22
22
  end
23
+
24
+ def expansions(file = nil)
25
+ file ||= open('http://gatherer.wizards.com')
26
+ doc = Nokogiri::HTML(file)
27
+ expansions = doc.css('select#ctl00_ctl00_MainContent_Content_SearchControls_setAddText')
28
+ .css('option')
29
+ .map {|option| option['value'] }
30
+ .select {|expansion| !expansion.empty?}
31
+ end
23
32
  end
24
33
  end
@@ -1,3 +1,3 @@
1
1
  module Gatherer
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gatherer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-01-07 00:00:00.000000000 Z
12
+ date: 2013-01-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: httparty