xfn_stone 0.0.5 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/xfn_stone/document.rb +10 -0
- data/lib/xfn_stone.rb +1 -1
- data/spec/person.rb +9 -8
- metadata +5 -4
data/lib/xfn_stone/document.rb
CHANGED
@@ -2,6 +2,16 @@
|
|
2
2
|
#we're parsing HTML now
|
3
3
|
require 'hpricot'
|
4
4
|
|
5
|
+
module Hpricot
|
6
|
+
class Elements
|
7
|
+
def urls
|
8
|
+
self.map do |fragment|
|
9
|
+
fragment.attributes["href"]
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
5
15
|
module XfnStone
|
6
16
|
# This is an empty subclass of hpricot. Substuting a
|
7
17
|
# different XML parser in the future will be easier this way.
|
data/lib/xfn_stone.rb
CHANGED
data/spec/person.rb
CHANGED
@@ -2,6 +2,14 @@ require File.join(File.dirname(__FILE__), *%w[spec_helper])
|
|
2
2
|
require File.join(File.dirname(__FILE__), *%w[../lib/xfn_stone.rb])
|
3
3
|
|
4
4
|
describe XfnStone::Person do
|
5
|
+
|
6
|
+
before(:each) do
|
7
|
+
html_page = open(File.dirname(__FILE__)+"/html/bob.html")
|
8
|
+
XfnStone::Document.should_receive(:open).and_return(html_page)
|
9
|
+
@url = "http://localhost"
|
10
|
+
@person = XfnStone::Person.new(@url)
|
11
|
+
end
|
12
|
+
|
5
13
|
it "should know its load URL" do
|
6
14
|
@person.uri.to_s.should == @url
|
7
15
|
end
|
@@ -15,14 +23,7 @@ describe XfnStone::Person do
|
|
15
23
|
end
|
16
24
|
|
17
25
|
it "should return the contact links found in the document" do
|
18
|
-
@person.
|
19
|
-
end
|
20
|
-
|
21
|
-
before(:each) do
|
22
|
-
html_page = open(File.join(File.dirname(__FILE__),"bob.html"))
|
23
|
-
XfnStone::Document.should_receive(:open).and_return(html_page)
|
24
|
-
@url = "http://localhost"
|
25
|
-
@person = XfnStone::Person.new(@url)
|
26
|
+
@person.contacts.size.should == 2
|
26
27
|
end
|
27
28
|
end
|
28
29
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: xfn_stone
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Don Park
|
@@ -9,17 +9,18 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-
|
12
|
+
date: 2008-07-19 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: hoe
|
17
|
+
type: :runtime
|
17
18
|
version_requirement:
|
18
19
|
version_requirements: !ruby/object:Gem::Requirement
|
19
20
|
requirements:
|
20
21
|
- - ">="
|
21
22
|
- !ruby/object:Gem::Version
|
22
|
-
version: 1.5.
|
23
|
+
version: 1.5.1
|
23
24
|
version:
|
24
25
|
description: "== DESCRIPTION: XfnStone provides helper methods to make simple the processing of XML documents that contain HTML with XFN (XHTML Friends Network) attributes on its tags. == FEATURES/PROBLEMS: * XFN processing"
|
25
26
|
email: don.park@gmail.com
|
@@ -64,7 +65,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
64
65
|
requirements: []
|
65
66
|
|
66
67
|
rubyforge_project: foafstone
|
67
|
-
rubygems_version: 1.0
|
68
|
+
rubygems_version: 1.2.0
|
68
69
|
signing_key:
|
69
70
|
specification_version: 2
|
70
71
|
summary: XHTML Frinds Network helper library
|