jxl-lewtlynx 0.0.1 → 0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/lewtlynx.gemspec +3 -4
  2. data/lib/lewtlynx.rb +8 -8
  3. metadata +4 -4
@@ -1,13 +1,12 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "lewtlynx"
3
- s.version = "0.0.1"
4
- s.date = "2008-12-13"
5
3
  s.summary = "wowhead links ftw"
4
+ s.version = "0.1"
5
+ s.date = "2008-12-16"
6
+ s.author = "jxl"
6
7
  s.email = "jxl@ganja.nl"
7
8
  s.homepage = "http://github.com/jxl/lewtlynx"
8
- s.description = "wowhead links ftw"
9
9
  s.has_rdoc = false
10
- s.author = "Ron Damen"
11
10
  s.files = [
12
11
  "lewtlynx.gemspec",
13
12
  "lib/lewtlynx.rb",
@@ -1,5 +1,5 @@
1
1
  require 'rubygems'
2
- require 'nokogiri'
2
+ require 'hpricot'
3
3
  require 'open-uri'
4
4
 
5
5
  module LewtLynx
@@ -16,10 +16,10 @@ module LewtLynx
16
16
  end
17
17
 
18
18
  def parse
19
- @name = xml.xpath('//name').inner_text
20
- @quality = xml.xpath('//quality').inner_text
21
- @qid = xml.xpath('//quality').attr("id")
22
- @url = xml.xpath('//link').inner_text
19
+ @name = xml.search('//name').inner_text
20
+ @quality = xml.search('//quality').inner_text
21
+ @qid = xml.search('//quality').attr("id")
22
+ @url = xml.search('//link').inner_text
23
23
  @link = "<a class=\"q#{@qid}\" href=\"#{@url}\">#{@name}</a>"
24
24
  end
25
25
 
@@ -40,8 +40,8 @@ module LewtLynx
40
40
  end
41
41
 
42
42
  def valid?
43
- !!xml.xpath('/wowhead/error').empty? &&
44
- !xml.xpath('/wowhead/item').empty?
43
+ !!xml.search('/wowhead/error').empty? &&
44
+ !xml.search('/wowhead/item').empty?
45
45
  end
46
46
  end
47
47
 
@@ -51,7 +51,7 @@ module LewtLynx
51
51
  end
52
52
 
53
53
  def xml
54
- @xml ||= Nokogiri.XML(get)
54
+ @xml ||= Hpricot.XML(get)
55
55
  end
56
56
 
57
57
  def get
metadata CHANGED
@@ -1,19 +1,19 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jxl-lewtlynx
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: "0.1"
5
5
  platform: ruby
6
6
  authors:
7
- - Ron Damen
7
+ - jxl
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-12-13 00:00:00 -08:00
12
+ date: 2008-12-16 00:00:00 -08:00
13
13
  default_executable:
14
14
  dependencies: []
15
15
 
16
- description: wowhead links ftw
16
+ description:
17
17
  email: jxl@ganja.nl
18
18
  executables: []
19
19