ruby-yadis 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/yadis/service.rb +0 -1
- data/lib/yadis/xrds.rb +14 -14
- data/test/test_xrds.rb +4 -0
- metadata +2 -2
data/lib/yadis/service.rb
CHANGED
data/lib/yadis/xrds.rb
CHANGED
@@ -96,7 +96,7 @@ class XRDS
|
|
96
96
|
service.uri = nil
|
97
97
|
service.service_types = []
|
98
98
|
|
99
|
-
|
99
|
+
REXML::XPath.each(service_element, 'xrdns:Type', @@namespaces) do |t|
|
100
100
|
# XXX: If the Type element is empty, should we add an empty element
|
101
101
|
# to our list, or none at all?
|
102
102
|
service.service_types << t.text.strip unless t.text.nil?
|
@@ -104,23 +104,23 @@ class XRDS
|
|
104
104
|
|
105
105
|
sp = service_element.attributes['priority']
|
106
106
|
service_priority = sp ? sp.to_i : -1
|
107
|
+
has_uri = false
|
107
108
|
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
_add_service(priority, _service)
|
118
|
-
end
|
109
|
+
REXML::XPath.each(service.element, 'xrdns:URI', @@namespaces) do |uri|
|
110
|
+
has_uri = true
|
111
|
+
_service = service.dup
|
112
|
+
_service.uri = uri.text.strip
|
113
|
+
|
114
|
+
up = uri.attributes['priority']
|
115
|
+
uri_priority = up ? up.to_i : -1
|
116
|
+
priority = [service_priority, uri_priority]
|
119
117
|
|
120
|
-
|
118
|
+
_add_service(priority, _service)
|
119
|
+
end
|
120
|
+
|
121
|
+
unless has_uri
|
121
122
|
priority = [service_priority, -1]
|
122
123
|
_add_service(priority, service)
|
123
|
-
|
124
124
|
end
|
125
125
|
|
126
126
|
end
|
data/test/test_xrds.rb
CHANGED
metadata
CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.8.11
|
|
3
3
|
specification_version: 1
|
4
4
|
name: ruby-yadis
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.3.
|
7
|
-
date: 2006-06-
|
6
|
+
version: 0.3.2
|
7
|
+
date: 2006-06-26 00:00:00 -07:00
|
8
8
|
summary: A library for performing Yadis service discovery
|
9
9
|
require_paths:
|
10
10
|
- lib
|