skates 0.4.0 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -12,7 +12,7 @@ begin
12
12
 
13
13
  gem.add_dependency('eventmachine', ">= 0.12.10")
14
14
  gem.add_dependency('log4r')
15
- gem.add_dependency('nokogiri', "= 1.4.2")
15
+ gem.add_dependency('nokogiri', "= 1.4.4")
16
16
  gem.add_dependency('utf8cleaner')
17
17
  gem.requirements = ["bundler", "eventmachine", "yaml", "fileutils", "log4r", "nokogiri", "optparse", "digest/sha1", "base64", "resolv", "utf8cleaner"]
18
18
  gem.executables = "skates"
@@ -25,7 +25,7 @@ module Skates
25
25
  end
26
26
 
27
27
  ##
28
- # Resolution for clients, based on SRV records
28
+ # Resolution for clients, based on SRV records, or A if no SRV is present. Also randomizes the servers if multiple with same priority are found.
29
29
  def self.resolve(host, &block)
30
30
  Resolv::DNS.open { |dns|
31
31
  # If ruby version is too old and SRV is unknown, this will raise a NameError
@@ -67,7 +67,9 @@ module Skates
67
67
  "RESOLVING: #{host} (A record)"
68
68
  }
69
69
  records = dns.getresources(host, Resolv::DNS::Resource::IN::A)
70
- records.each do |record|
70
+ records.sort_by { |record|
71
+ rand()
72
+ }.each do |record|
71
73
  ip = record.address.to_s
72
74
  if block.call({"host" => ip, "port" => Integer(Skates.config["port"]) || 5222})
73
75
  found = true
@@ -117,17 +119,17 @@ module Skates
117
119
  super # Can be dispatched
118
120
 
119
121
  when :wait_for_stream_authenticated
120
- if stanza.name == "stream:stream" && stanza.attributes['id']
122
+ if stanza.name == "stream" && stanza.attributes['id']
121
123
  @state = :wait_for_bind
122
124
  end
123
125
 
124
126
  when :wait_for_stream
125
- if stanza.name == "stream:stream" && stanza.attributes['id']
127
+ if stanza.name == "stream" && stanza.attributes['id']
126
128
  @state = :wait_for_auth_mechanisms
127
129
  end
128
130
 
129
131
  when :wait_for_auth_mechanisms
130
- if stanza.name == "stream:features"
132
+ if stanza.name == "features"
131
133
  if stanza.children.first.name == "starttls"
132
134
  doc = Nokogiri::XML::Document.new
133
135
  starttls = Nokogiri::XML::Node.new("starttls", doc)
@@ -164,7 +166,7 @@ module Skates
164
166
  end
165
167
 
166
168
  when :wait_for_bind
167
- if stanza.name == "stream:features"
169
+ if stanza.name == "features"
168
170
  if stanza.children.first.name == "bind"
169
171
  doc = Nokogiri::XML::Document.new
170
172
  # Let's build the binding_iq
@@ -43,7 +43,7 @@ module Skates
43
43
  super(stanza) # Can be dispatched
44
44
 
45
45
  when :wait_for_stream
46
- if stanza.name == "stream:stream" && stanza.attributes['id']
46
+ if stanza.name == "stream" && stanza.attributes['id']
47
47
  # This means the XMPP session started!
48
48
  # We must send the handshake now.
49
49
  send_xml(handshake(stanza))
@@ -62,7 +62,7 @@ module Skates
62
62
  }
63
63
  end
64
64
  @state = :connected
65
- elsif stanza.name == "stream:error"
65
+ elsif stanza.name == "error"
66
66
  raise AuthenticationError
67
67
  else
68
68
  raise
@@ -43,11 +43,35 @@ module Skates
43
43
  clear_characters_buffer
44
44
  @doc ||= Nokogiri::XML::Document.new
45
45
  @elem ||= @doc # If we have no current element, then, we take the doc
46
- @elem = @elem.add_child(Nokogiri::XML::Element.new(qname, @doc))
46
+ @parent = @elem
47
47
 
48
- add_namespaces_and_attributes_to_current_node(attributes)
48
+ # First thing first : identify namespaces, and attributes
49
+ namespaces, attributes = identify_namespaces_and_attributes(attributes)
49
50
 
50
- if @elem.name == "stream:stream"
51
+ # Now, we may need to add a namespace!
52
+ namespace, qname = qname.split(":") if qname.match(/.*:.*/)
53
+
54
+ @elem = Nokogiri::XML::Element.new(qname, @doc)
55
+ # Let's now add all namespaces
56
+ namespaces.each do |prefix, uri|
57
+ set_namespace(prefix, uri)
58
+ end
59
+
60
+ # And all attributes
61
+ attributes.each do |name, value|
62
+ set_attribute(name, value)
63
+ end
64
+
65
+ # And now addback the namespace if applicable
66
+ if prefix = ["xmlns", namespace].join(":") and uri = @parent.namespaces[prefix]
67
+ @elem.namespace = @parent.namespace_definitions.select() {|ns|
68
+ ns.href == uri
69
+ }.first
70
+ end
71
+
72
+ @parent.add_child(@elem) # Finally, add the element
73
+
74
+ if @elem.name == "stream"
51
75
  # We activate the callback since this element will never end.
52
76
  @callback.call(@elem)
53
77
  @doc = @elem = nil # Let's prepare for the next stanza
@@ -84,29 +108,32 @@ module Skates
84
108
  end
85
109
 
86
110
  ##
87
- # Adds namespaces and attributes. Nokogiri passes them as a array of [[ns_name, ns_url], [ns_name, ns_url]..., key, value, key, value]...
88
- def add_namespaces_and_attributes_to_current_node(attrs)
89
- # Namespaces
90
- attrs.select {|k| k.is_a? Array}.each do |pair|
91
- set_namespace(pair[0], pair[1])
92
- # set_normal_attribute(pair[0], pair[1])
93
- end
94
- # Attributes
95
- attrs.select {|k| k.is_a? String}.in_groups_of(2) do |pair|
96
- set_normal_attribute(pair[0], pair[1])
111
+ # Idenitifies namespaces and attributes
112
+ # Nokogiri passes them as a array of [[ns_name, ns_url], [ns_name, ns_url]..., key, value, key, value]...
113
+ def identify_namespaces_and_attributes(attrs)
114
+ namespaces = {}
115
+ attributes = {}
116
+
117
+ attrs.each do |pair|
118
+ if pair[0].match /xmlns/
119
+ # It's a namespace!
120
+ prefix = pair[0].split(":").last
121
+ prefix = nil if prefix == "xmlns"
122
+ namespaces[prefix] = pair[1] # Now assign the url. Easy.
123
+ else
124
+ # It's an attribute
125
+ attributes[pair[0]] = pair[1]
126
+ end
97
127
  end
128
+ [namespaces, attributes]
98
129
  end
99
-
100
- def set_normal_attribute(key, value)
130
+
131
+ def set_attribute(key, value)
101
132
  @elem.set_attribute key, Skates.decode_xml(value)
102
133
  end
103
134
 
104
135
  def set_namespace(key, value)
105
- if key.include? ':'
106
- @elem.add_namespace(key.split(':').last, value)
107
- else
108
- @elem.add_namespace(nil, value)
109
- end
136
+ @elem.add_namespace(key, value)
110
137
  end
111
138
  end
112
139
  end
@@ -15,8 +15,8 @@ describe Skates::Base::Controller do
15
15
  stanza = mock(Object)
16
16
  c = Skates::Base::Controller.new(stanza)
17
17
 
18
- c.instance_variables.should be_include "@stanza"
19
- c.instance_variable_get("@stanza").should == stanza
18
+ c.instance_variables.should be_include :"@stanza"
19
+ c.instance_variable_get(:"@stanza").should == stanza
20
20
  end
21
21
 
22
22
  it "should not be rendered yet" do
@@ -140,7 +140,7 @@ describe Skates::Base::Controller do
140
140
  end
141
141
  @controller = MyController.new(@stanza)
142
142
  @controller.do_something
143
- @controller.assigns.should == vars.merge("stanza" => @stanza)
143
+ @controller.assigns.should == vars.merge("stanza" => @stanza, "view" => nil)
144
144
  end
145
145
  end
146
146
 
@@ -25,9 +25,9 @@ describe Skates::ClientConnection do
25
25
  @params.delete("host")
26
26
  @params.delete("port")
27
27
  @srv = [
28
- mock(Resolv::DNS::Resource, :priority => 10, :target => "12.13.14.15", :port => 1234),
29
- mock(Resolv::DNS::Resource, :priority => 3, :target => "12.13.14.16", :port => 4567),
30
- mock(Resolv::DNS::Resource, :priority => 100, :target => "12.13.14.17", :port => 8910)
28
+ mock(Resolv::DNS::Resource, :priority => 10, :target => "12.13.14.15", :port => 1234, :address => "12.13.14.15"),
29
+ mock(Resolv::DNS::Resource, :priority => 3, :target => "12.13.14.16", :port => 4567, :address => "12.13.14.16"),
30
+ mock(Resolv::DNS::Resource, :priority => 100, :target => "12.13.14.17", :port => 8910, :address => "12.13.14.17")
31
31
  ]
32
32
  @mock_dns = mock(Object)
33
33
  Resolv::DNS.stub!(:open).and_yield(@mock_dns)
@@ -36,7 +36,7 @@ describe Skates::ClientConnection do
36
36
 
37
37
  it "should get resources assiated with _xmpp-client._tcp.host.tld}" do
38
38
  Resolv::DNS.should_receive(:open).and_yield(@mock_dns)
39
- @mock_dns.should_receive(:getresources).with("_xmpp-client._tcp.server.tld", Resolv::DNS::Resource::IN::SRV).and_return(@srv)
39
+ @mock_dns.should_receive(:getresources).with("server.tld", Resolv::DNS::Resource::IN::SRV).and_return(@srv)
40
40
  Skates::ClientConnection.resolve("server.tld")
41
41
  end
42
42
 
@@ -84,10 +84,10 @@ describe Skates::ClientConnection do
84
84
  describe "when wait_for_stream_authenticated" do
85
85
  before(:each) do
86
86
  @client.instance_variable_set("@state", :wait_for_stream_authenticated)
87
- @stanza = Nokogiri::XML::Node.new("stream:stream", @doc)
87
+ @stanza = Nokogiri::XML::Node.new("stream", @doc)
88
88
  @stanza["id"] = "123"
89
89
  end
90
- it "should change state to wait_for_bind if the stanza is stream:stream with an id" do
90
+ it "should change state to wait_for_bind if the stanza is stream with an id" do
91
91
  @client.receive_stanza(@stanza)
92
92
  @client.instance_variable_get("@state").should == :wait_for_bind
93
93
  end
@@ -96,10 +96,10 @@ describe Skates::ClientConnection do
96
96
  describe "when wait_for_stream" do
97
97
  before(:each) do
98
98
  @client.instance_variable_set("@state", :wait_for_stream)
99
- @stanza = Nokogiri::XML::Node.new("stream:stream", @doc)
99
+ @stanza = Nokogiri::XML::Node.new("stream", @doc)
100
100
  @stanza["id"] = "123"
101
101
  end
102
- it "should change state to wait_for_auth_mechanisms if the stanza is stream:stream with an id" do
102
+ it "should change state to wait_for_auth_mechanisms if the stanza is stream with an id" do
103
103
  @client.receive_stanza(@stanza)
104
104
  @client.instance_variable_get("@state").should == :wait_for_auth_mechanisms
105
105
  end
@@ -110,9 +110,9 @@ describe Skates::ClientConnection do
110
110
  @client.instance_variable_set("@state", :wait_for_auth_mechanisms)
111
111
  end
112
112
 
113
- describe "if the stanza is stream:features" do
113
+ describe "if the stanza is features" do
114
114
  before(:each) do
115
- @stanza = Nokogiri::XML::Node.new("stream:features", @doc)
115
+ @stanza = Nokogiri::XML::Node.new("features", @doc)
116
116
  @stanza["id"] = "123"
117
117
  end
118
118
 
@@ -194,9 +194,9 @@ describe Skates::ClientConnection do
194
194
  @client.instance_variable_set("@state", :wait_for_bind)
195
195
  end
196
196
 
197
- describe "if stanza is stream:features" do
197
+ describe "if stanza is features" do
198
198
  before(:each) do
199
- @stanza = Nokogiri::XML::Node.new("stream:features", @doc)
199
+ @stanza = Nokogiri::XML::Node.new("features", @doc)
200
200
  end
201
201
 
202
202
  describe "if stanza has bind" do
@@ -47,7 +47,7 @@ describe Skates::ComponentConnection do
47
47
 
48
48
  describe "if the stanza is stream" do
49
49
  before(:each) do
50
- @stanza = Nokogiri::XML::Node.new("stream:stream", @doc)
50
+ @stanza = Nokogiri::XML::Node.new("stream", @doc)
51
51
  @stanza["xmlns:stream"] = 'http://etherx.jabber.org/streams'
52
52
  @stanza["xmlns"] = 'jabber:component:accept'
53
53
  @stanza["from"] = 'plays.shakespeare.lit'
@@ -98,7 +98,7 @@ describe Skates::ComponentConnection do
98
98
 
99
99
  describe "if we receive a stream:error" do
100
100
  it "should raise an Authentication Error" do
101
- lambda {@component.receive_stanza(Nokogiri::XML::Node.new("stream:error", @doc))}.should raise_error(Skates::AuthenticationError)
101
+ lambda {@component.receive_stanza(Nokogiri::XML::Node.new("error", @doc))}.should raise_error(Skates::AuthenticationError)
102
102
  end
103
103
  end
104
104
 
@@ -122,7 +122,7 @@ describe Skates::ComponentConnection do
122
122
  it "should build a handshake Element with the password and the id of the stanza" do
123
123
  @component.connection_completed
124
124
  doc = Nokogiri::XML::Document.new
125
- stanza = Nokogiri::XML::Node.new("stream:stream", doc)
125
+ stanza = Nokogiri::XML::Node.new("stream", doc)
126
126
  stanza["xmlns:stream"] = 'http://etherx.jabber.org/streams'
127
127
  stanza["xmlns"] = 'jabber:component:accept'
128
128
  stanza["from"] = 'plays.shakespeare.lit'
@@ -135,7 +135,7 @@ describe Skates::ComponentConnection do
135
135
  describe "when resolving" do
136
136
  it "should resolve records" do
137
137
  Skates::ComponentConnection.resolve("xmpp2.superfeedr.com") do |res|
138
- res["host"].should == "173.45.226.99"
138
+ res["host"].should == "173.255.193.75"
139
139
  true
140
140
  end
141
141
  end
@@ -1,3 +1,4 @@
1
+ $: << "." # Adding the local directory to the path, so we can safely require models, controllers and views.
1
2
  require File.dirname(__FILE__) + '/../../spec_helper'
2
3
 
3
4
  describe Skates::XmppParser do
@@ -69,7 +70,7 @@ describe Skates::XmppParser do
69
70
 
70
71
  before(:each) do
71
72
  @new_elem_name = "new"
72
- @new_elem_attributes = ["to", "you@yourserver.com/home", "xmlns", "http://ns.com"]
73
+ @new_elem_attributes = [["to", "you@yourserver.com/home"], ["xmlns", "http://ns.com"]]
73
74
  end
74
75
 
75
76
  it "should create a new doc if we don't have one" do
@@ -117,8 +118,7 @@ describe Skates::XmppParser do
117
118
  it "should add the right attributes and namespaces to the newly created element" do
118
119
  @parser.start_element(@new_elem_name, @new_elem_attributes)
119
120
  @parser.elem["to"].should == "you@yourserver.com/home"
120
- # TODO : FIX NAMESPACES : @parser.elem.namespaces.should == {"xmlns"=>"http://ns.com"}
121
- @parser.elem.namespaces.should == {}
121
+ @parser.elem.namespaces.should == {"xmlns"=>"http://ns.com"}
122
122
  end
123
123
 
124
124
  describe "when the new element is of name stream:stream" do
@@ -182,53 +182,6 @@ describe Skates::XmppParser do
182
182
  end
183
183
  end
184
184
 
185
- describe ".add_namespaces_and_attributes_to_node" do
186
- before(:each) do
187
- @doc = Nokogiri::XML::Document.new
188
- @parser.doc = @doc
189
- @element = Nokogiri::XML::Element.new("element", @parser.doc)
190
- @attrs = ["from", "me", "xmlns:atom", "http://www.w3.org/2005/Atom" ,"to", "you", "xmlns", "http://namespace.com"]
191
- @parser.elem = @element
192
- end
193
-
194
- it "should assign even elements to attributes value or namespaces urls" do
195
- @parser.__send__(:add_namespaces_and_attributes_to_current_node, @attrs)
196
- even = []
197
- @attrs.size.times do |i|
198
- even << @attrs[i*2]
199
- end
200
- even.compact!
201
- @element.attributes.keys.each do |k|
202
- even.should include(k)
203
- end
204
- end
205
-
206
- it "should assign odd elements to attributes names of namespaces prefixes" do
207
- @parser.__send__(:add_namespaces_and_attributes_to_current_node, @attrs)
208
- even = []
209
- @attrs.size.times do |i|
210
- even << @attrs[i*2+1]
211
- end
212
- even.compact!
213
- @element.attributes.values.each do |v|
214
- even.should include("#{v}")
215
- end
216
- end
217
-
218
- it "should add namespace for each attribute name that starts with xmlns" do
219
- @parser.__send__(:add_namespaces_and_attributes_to_current_node, @attrs)
220
- # TODO: FIX NAMESPACES @element.namespaces.values.should == ["http://www.w3.org/2005/Atom", "http://namespace.com"]
221
- @element.namespaces.values.should == []
222
- end
223
-
224
- it "should escape characters correctly" do
225
- @attrs = ["url", "http://api.flickr.com/services/feeds/photos_public.gne?id=49724566@N00&amp;lang=en-us&amp;format=atom"]
226
- @parser.__send__(:add_namespaces_and_attributes_to_current_node, @attrs)
227
- @element["url"].should == "http://api.flickr.com/services/feeds/photos_public.gne?id=49724566@N00&lang=en-us&format=atom"
228
- end
229
-
230
- end
231
-
232
185
  describe "a communication with an XMPP Client" do
233
186
 
234
187
  before(:each) do
@@ -274,10 +227,243 @@ describe Skates::XmppParser do
274
227
  @parser.push(s)
275
228
  end
276
229
 
277
- @stanzas.join("").should == "<stream:stream xmlns:stream=\"http://etherx.jabber.org/streams\" xmlns=\"jabber:component:accept\" from=\"plays.shakespeare.lit\" id=\"3BF96D32\"/><handshake/><message from=\"juliet@example.com\" to=\"romeo@example.net\" xml:lang=\"en\">\n <body>Art thou not Romeo, and a Montague?</body>\n <link href=\"http://sfbay.craigslist.org/search/sss?query=%2522mac+mini%2522+Intel+Core+Duo&amp;minAsk=min&amp;maxAsk=max&amp;format=rss&amp;format=rss\"/>\n</message>"
230
+ @stanzas.map(&:to_xml).join("").should == "<stream xmlns:stream=\"http://etherx.jabber.org/streams\" xmlns=\"jabber:component:accept\" from=\"plays.shakespeare.lit\" id=\"3BF96D32\"/><handshake/><message from=\"juliet@example.com\" to=\"romeo@example.net\" xml:lang=\"en\">\n <body>Art thou not Romeo, and a Montague?</body>\n <link href=\"http://sfbay.craigslist.org/search/sss?query=%2522mac+mini%2522+Intel+Core+Duo&amp;minAsk=min&amp;maxAsk=max&amp;format=rss&amp;format=rss\"/>\n</message>"
278
231
  @stanzas.last.at("link")["href"].should == "http://sfbay.craigslist.org/search/sss?query=%2522mac+mini%2522+Intel+Core+Duo&minAsk=min&maxAsk=max&format=rss&format=rss"
279
232
  end
280
233
 
281
234
  end
282
235
 
236
+ describe "when parsing a complex stanza" do
237
+ before(:each) do
238
+ @xml =<<-EOXML
239
+ <iq id="pub-296" to="test-track.superfeedr.com" type="set">
240
+ <feed xmlns="http://superfeedr.com/xmpp-superfeedr-ext" id="368">
241
+ <url>http://superfeedr.com/dummy.xml</url>
242
+ <http_code>200</http_code>
243
+ <etag>"eb8dfc6fa342dc8326851907efe35cda"</etag>
244
+ <number_of_new_entries>10</number_of_new_entries>
245
+ <last_error_message>7462B in 1.036602s, 10/10 new entries</last_error_message>
246
+ <last_fetch>2011-02-21T14:34:52-05:00</last_fetch>
247
+ <next_fetch>2011-02-21T14:38:37-05:00</next_fetch>
248
+ <period>225</period>
249
+ <last_maintenance_at>2011-02-21T14:34:52-05:00</last_maintenance_at>
250
+ <entries_count>10</entries_count>
251
+ <perform_maintenance>true</perform_maintenance>
252
+ <title>The Dummy Time Feed</title>
253
+ <format>feed</format>
254
+ <link href="http://superfeedr.com" rel="alternate" type="text/html"/>
255
+ <link href="http://superfeedr.com/dummy.xml" rel="self" type="application/atom+xml"/>
256
+ <last_parse>2011-02-21T14:34:52-05:00</last_parse>
257
+ <headers>
258
+ <server>nginx/0.8.52</server>
259
+ <date>Mon, 21 Feb 2011 19:35:41 GMT</date>
260
+ <content_type>application/xml; charset=utf-8</content_type>
261
+ <connection>close</connection>
262
+ <status>200 OK</status>
263
+ <etag>"eb8dfc6fa342dc8326851907efe35cda"</etag>
264
+ <x_runtime>858</x_runtime>
265
+ <content_length>7462</content_length>
266
+ <set_cookie/>
267
+ <cache_control>private, max-age=0, must-revalidate</cache_control>
268
+ </headers>
269
+ <id>tag:superfeedr.com,2005:/hubbub/dummy</id>
270
+ </feed>
271
+ <pubsub xmlns="http://jabber.org/protocol/pubsub">
272
+ <publish node="368">
273
+ <item>
274
+ <entry xmlns="http://www.w3.org/2005/Atom" xmlns:geo="http://www.georss.org/georss" xmlns:as="http://activitystrea.ms/spec/1.0/" xmlns:sf="http://superfeedr.com/xmpp-pubsub-ext" xml:lang="en-US">
275
+ <id>tag:superfeedr.com,2005:String/1298307758</id>
276
+ <published>2011-02-21T12:02:38-05:00</published>
277
+ <updated>2011-02-21T12:02:38-05:00</updated>
278
+ <title>17:02:38</title>
279
+ <summary type="text"/>
280
+ <content type="text">Monday February 21 17:02:38 UTC 2011 Somebody wanted to know what time it was.</content>
281
+ <geo:point>37.773721,-122.414957</geo:point>
282
+ <link href="http://superfeedr.com/?1298307758" title="17:02:38" rel="alternate" type="text/html"/>
283
+ <category term="tests"/>
284
+ <author>
285
+ <name>Superfeedr</name>
286
+ <uri>http://superfeedr.com/</uri>
287
+ <email>julien@superfeedr.com</email>
288
+ </author>
289
+ </entry>
290
+ </item>
291
+ <item>
292
+ <entry xmlns="http://www.w3.org/2005/Atom" xmlns:geo="http://www.georss.org/georss" xmlns:as="http://activitystrea.ms/spec/1.0/" xmlns:sf="http://superfeedr.com/xmpp-pubsub-ext" xml:lang="en-US">
293
+ <id>tag:superfeedr.com,2005:String/1298307618</id>
294
+ <published>2011-02-21T12:00:18-05:00</published>
295
+ <updated>2011-02-21T12:00:18-05:00</updated>
296
+ <title>17:00:18</title>
297
+ <summary type="text"/>
298
+ <content type="text">Monday February 21 17:00:18 UTC 2011 Somebody wanted to know what time it was.</content>
299
+ <geo:point>37.773721,-122.414957</geo:point>
300
+ <link href="http://superfeedr.com/?1298307618" title="17:00:18" rel="alternate" type="text/html"/>
301
+ <category term="tests"/>
302
+ <author>
303
+ <name>Superfeedr</name>
304
+ <uri>http://superfeedr.com/</uri>
305
+ <email>julien@superfeedr.com</email>
306
+ </author>
307
+ </entry>
308
+ </item>
309
+ <item>
310
+ <entry xmlns="http://www.w3.org/2005/Atom" xmlns:geo="http://www.georss.org/georss" xmlns:as="http://activitystrea.ms/spec/1.0/" xmlns:sf="http://superfeedr.com/xmpp-pubsub-ext" xml:lang="en-US">
311
+ <id>tag:superfeedr.com,2005:String/1298307454</id>
312
+ <published>2011-02-21T11:57:34-05:00</published>
313
+ <updated>2011-02-21T11:57:34-05:00</updated>
314
+ <title>16:57:34</title>
315
+ <summary type="text"/>
316
+ <content type="text">Monday February 21 16:57:34 UTC 2011 Somebody wanted to know what time it was.</content>
317
+ <geo:point>37.773721,-122.414957</geo:point>
318
+ <link href="http://superfeedr.com/?1298307454" title="16:57:34" rel="alternate" type="text/html"/>
319
+ <category term="tests"/>
320
+ <author>
321
+ <name>Superfeedr</name>
322
+ <uri>http://superfeedr.com/</uri>
323
+ <email>julien@superfeedr.com</email>
324
+ </author>
325
+ </entry>
326
+ </item>
327
+ <item>
328
+ <entry xmlns="http://www.w3.org/2005/Atom" xmlns:geo="http://www.georss.org/georss" xmlns:as="http://activitystrea.ms/spec/1.0/" xmlns:sf="http://superfeedr.com/xmpp-pubsub-ext" xml:lang="en-US">
329
+ <id>tag:superfeedr.com,2005:String/1298307099</id>
330
+ <published>2011-02-21T11:51:39-05:00</published>
331
+ <updated>2011-02-21T11:51:39-05:00</updated>
332
+ <title>16:51:39</title>
333
+ <summary type="text"/>
334
+ <content type="text">Monday February 21 16:51:39 UTC 2011 Somebody wanted to know what time it was.</content>
335
+ <geo:point>37.773721,-122.414957</geo:point>
336
+ <link href="http://superfeedr.com/?1298307099" title="16:51:39" rel="alternate" type="text/html"/>
337
+ <category term="tests"/>
338
+ <author>
339
+ <name>Superfeedr</name>
340
+ <uri>http://superfeedr.com/</uri>
341
+ <email>julien@superfeedr.com</email>
342
+ </author>
343
+ </entry>
344
+ </item>
345
+ <item>
346
+ <entry xmlns="http://www.w3.org/2005/Atom" xmlns:geo="http://www.georss.org/georss" xmlns:as="http://activitystrea.ms/spec/1.0/" xmlns:sf="http://superfeedr.com/xmpp-pubsub-ext" xml:lang="en-US">
347
+ <id>tag:superfeedr.com,2005:String/1298305317</id>
348
+ <published>2011-02-21T11:21:57-05:00</published>
349
+ <updated>2011-02-21T11:21:57-05:00</updated>
350
+ <title>16:21:57</title>
351
+ <summary type="text"/>
352
+ <content type="text">Monday February 21 16:21:57 UTC 2011 Somebody wanted to know what time it was.</content>
353
+ <geo:point>37.773721,-122.414957</geo:point>
354
+ <link href="http://superfeedr.com/?1298305317" title="16:21:57" rel="alternate" type="text/html"/>
355
+ <category term="tests"/>
356
+ <author>
357
+ <name>Superfeedr</name>
358
+ <uri>http://superfeedr.com/</uri>
359
+ <email>julien@superfeedr.com</email>
360
+ </author>
361
+ </entry>
362
+ </item>
363
+ <item>
364
+ <entry xmlns="http://www.w3.org/2005/Atom" xmlns:geo="http://www.georss.org/georss" xmlns:as="http://activitystrea.ms/spec/1.0/" xmlns:sf="http://superfeedr.com/xmpp-pubsub-ext" xml:lang="en-US">
365
+ <id>tag:superfeedr.com,2005:String/1298305151</id>
366
+ <published>2011-02-21T11:19:11-05:00</published>
367
+ <updated>2011-02-21T11:19:11-05:00</updated>
368
+ <title>16:19:11</title>
369
+ <summary type="text"/>
370
+ <content type="text">Monday February 21 16:19:11 UTC 2011 Somebody wanted to know what time it was.</content>
371
+ <geo:point>37.773721,-122.414957</geo:point>
372
+ <link href="http://superfeedr.com/?1298305151" title="16:19:11" rel="alternate" type="text/html"/>
373
+ <category term="tests"/>
374
+ <author>
375
+ <name>Superfeedr</name>
376
+ <uri>http://superfeedr.com/</uri>
377
+ <email>julien@superfeedr.com</email>
378
+ </author>
379
+ </entry>
380
+ </item>
381
+ <item>
382
+ <entry xmlns="http://www.w3.org/2005/Atom" xmlns:geo="http://www.georss.org/georss" xmlns:as="http://activitystrea.ms/spec/1.0/" xmlns:sf="http://superfeedr.com/xmpp-pubsub-ext" xml:lang="en-US">
383
+ <id>tag:superfeedr.com,2005:String/1298304372</id>
384
+ <published>2011-02-21T11:06:12-05:00</published>
385
+ <updated>2011-02-21T11:06:12-05:00</updated>
386
+ <title>16:06:12</title>
387
+ <summary type="text"/>
388
+ <content type="text">Monday February 21 16:06:12 UTC 2011 Somebody wanted to know what time it was.</content>
389
+ <geo:point>37.773721,-122.414957</geo:point>
390
+ <link href="http://superfeedr.com/?1298304372" title="16:06:12" rel="alternate" type="text/html"/>
391
+ <category term="tests"/>
392
+ <author>
393
+ <name>Superfeedr</name>
394
+ <uri>http://superfeedr.com/</uri>
395
+ <email>julien@superfeedr.com</email>
396
+ </author>
397
+ </entry>
398
+ </item>
399
+ <item>
400
+ <entry xmlns="http://www.w3.org/2005/Atom" xmlns:geo="http://www.georss.org/georss" xmlns:as="http://activitystrea.ms/spec/1.0/" xmlns:sf="http://superfeedr.com/xmpp-pubsub-ext" xml:lang="en-US">
401
+ <id>tag:superfeedr.com,2005:String/1298304371</id>
402
+ <published>2011-02-21T11:06:11-05:00</published>
403
+ <updated>2011-02-21T11:06:11-05:00</updated>
404
+ <title>16:06:11</title>
405
+ <summary type="text"/>
406
+ <content type="text">Monday February 21 16:06:11 UTC 2011 Somebody wanted to know what time it was.</content>
407
+ <geo:point>37.773721,-122.414957</geo:point>
408
+ <link href="http://superfeedr.com/?1298304371" title="16:06:11" rel="alternate" type="text/html"/>
409
+ <category term="tests"/>
410
+ <author>
411
+ <name>Superfeedr</name>
412
+ <uri>http://superfeedr.com/</uri>
413
+ <email>julien@superfeedr.com</email>
414
+ </author>
415
+ </entry>
416
+ </item>
417
+ <item>
418
+ <entry xmlns="http://www.w3.org/2005/Atom" xmlns:geo="http://www.georss.org/georss" xmlns:as="http://activitystrea.ms/spec/1.0/" xmlns:sf="http://superfeedr.com/xmpp-pubsub-ext" xml:lang="en-US">
419
+ <id>tag:superfeedr.com,2005:String/1298304085</id>
420
+ <published>2011-02-21T11:01:25-05:00</published>
421
+ <updated>2011-02-21T11:01:25-05:00</updated>
422
+ <title>16:01:25</title>
423
+ <summary type="text"/>
424
+ <content type="text">Monday February 21 16:01:25 UTC 2011 Somebody wanted to know what time it was.</content>
425
+ <geo:point>37.773721,-122.414957</geo:point>
426
+ <link href="http://superfeedr.com/?1298304085" title="16:01:25" rel="alternate" type="text/html"/>
427
+ <category term="tests"/>
428
+ <author>
429
+ <name>Superfeedr</name>
430
+ <uri>http://superfeedr.com/</uri>
431
+ <email>julien@superfeedr.com</email>
432
+ </author>
433
+ </entry>
434
+ </item>
435
+ <item>
436
+ <entry xmlns="http://www.w3.org/2005/Atom" xmlns:geo="http://www.georss.org/georss" xmlns:as="http://activitystrea.ms/spec/1.0/" xmlns:sf="http://superfeedr.com/xmpp-pubsub-ext" xml:lang="en-US">
437
+ <id>tag:superfeedr.com,2005:String/1298303653</id>
438
+ <published>2011-02-21T10:54:13-05:00</published>
439
+ <updated>2011-02-21T10:54:13-05:00</updated>
440
+ <title>15:54:13</title>
441
+ <summary type="text"/>
442
+ <content type="text">Monday February 21 15:54:13 UTC 2011 Somebody wanted to know what time it was.</content>
443
+ <geo:point>37.773721,-122.414957</geo:point>
444
+ <link href="http://superfeedr.com/?1298303653" title="15:54:13" rel="alternate" type="text/html"/>
445
+ <category term="tests"/>
446
+ <author>
447
+ <name>Superfeedr</name>
448
+ <uri>http://superfeedr.com/</uri>
449
+ <email>julien@superfeedr.com</email>
450
+ </author>
451
+ </entry>
452
+ </item>
453
+ </publish>
454
+ </pubsub>
455
+ </iq>
456
+ EOXML
457
+
458
+ @proc = Proc.new { |stanza|
459
+ stanza.to_xml.should == @xml.strip
460
+ }
461
+ @parser = Skates::XmppParser.new(@proc)
462
+ end
463
+
464
+ it "should parse correctly the namespaces and the attributes" do
465
+ @parser.push(@xml)
466
+ end
467
+ end
468
+
283
469
  end
metadata CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
4
4
  prerelease: false
5
5
  segments:
6
6
  - 0
7
- - 4
7
+ - 5
8
8
  - 0
9
- version: 0.4.0
9
+ version: 0.5.0
10
10
  platform: ruby
11
11
  authors:
12
12
  - julien Genestoux
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2011-01-11 00:00:00 +01:00
17
+ date: 2011-02-21 00:00:00 -05:00
18
18
  default_executable: skates
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -56,8 +56,8 @@ dependencies:
56
56
  segments:
57
57
  - 1
58
58
  - 4
59
- - 2
60
- version: 1.4.2
59
+ - 4
60
+ version: 1.4.4
61
61
  type: :runtime
62
62
  version_requirements: *id003
63
63
  - !ruby/object:Gem::Dependency