sprsquish-blather 0.3.4 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (110) hide show
  1. data/LICENSE +1 -1
  2. data/README.rdoc +41 -12
  3. data/examples/echo.rb +1 -1
  4. data/examples/execute.rb +0 -5
  5. data/examples/pubsub/cli.rb +64 -0
  6. data/examples/pubsub/ping_pong.rb +18 -0
  7. data/examples/rosterprint.rb +14 -0
  8. data/examples/xmpp4r/echo.rb +35 -0
  9. data/lib/blather/client/client.rb +19 -13
  10. data/lib/blather/client/dsl/pubsub.rb +133 -0
  11. data/lib/blather/client/dsl.rb +16 -0
  12. data/lib/blather/client.rb +1 -1
  13. data/lib/blather/core_ext/active_support/inheritable_attributes.rb +117 -0
  14. data/lib/blather/core_ext/active_support.rb +1 -117
  15. data/lib/blather/core_ext/nokogiri.rb +35 -0
  16. data/lib/blather/errors/sasl_error.rb +3 -1
  17. data/lib/blather/errors/stanza_error.rb +10 -17
  18. data/lib/blather/errors/stream_error.rb +11 -14
  19. data/lib/blather/errors.rb +3 -20
  20. data/lib/blather/jid.rb +1 -0
  21. data/lib/blather/roster.rb +9 -0
  22. data/lib/blather/roster_item.rb +6 -1
  23. data/lib/blather/stanza/disco/disco_info.rb +45 -33
  24. data/lib/blather/stanza/disco/disco_items.rb +32 -21
  25. data/lib/blather/stanza/disco.rb +7 -1
  26. data/lib/blather/stanza/iq/query.rb +16 -8
  27. data/lib/blather/stanza/iq/roster.rb +33 -22
  28. data/lib/blather/stanza/iq.rb +13 -8
  29. data/lib/blather/stanza/message.rb +20 -31
  30. data/lib/blather/stanza/presence/status.rb +13 -21
  31. data/lib/blather/stanza/presence/subscription.rb +11 -16
  32. data/lib/blather/stanza/presence.rb +3 -5
  33. data/lib/blather/stanza/pubsub/affiliations.rb +50 -0
  34. data/lib/blather/stanza/pubsub/create.rb +43 -0
  35. data/lib/blather/stanza/pubsub/errors.rb +9 -0
  36. data/lib/blather/stanza/pubsub/event.rb +77 -0
  37. data/lib/blather/stanza/pubsub/items.rb +63 -0
  38. data/lib/blather/stanza/pubsub/publish.rb +58 -0
  39. data/lib/blather/stanza/pubsub/retract.rb +53 -0
  40. data/lib/blather/stanza/pubsub/subscribe.rb +42 -0
  41. data/lib/blather/stanza/pubsub/subscription.rb +66 -0
  42. data/lib/blather/stanza/pubsub/subscriptions.rb +55 -0
  43. data/lib/blather/stanza/pubsub/unsubscribe.rb +42 -0
  44. data/lib/blather/stanza/pubsub.rb +63 -0
  45. data/lib/blather/stanza/pubsub_owner/delete.rb +34 -0
  46. data/lib/blather/stanza/pubsub_owner/purge.rb +34 -0
  47. data/lib/blather/stanza/pubsub_owner.rb +41 -0
  48. data/lib/blather/stanza.rb +35 -18
  49. data/lib/blather/stream/client.rb +1 -2
  50. data/lib/blather/stream/component.rb +9 -5
  51. data/lib/blather/stream/features/resource.rb +63 -0
  52. data/lib/blather/stream/{sasl.rb → features/sasl.rb} +53 -52
  53. data/lib/blather/stream/features/session.rb +44 -0
  54. data/lib/blather/stream/features/tls.rb +28 -0
  55. data/lib/blather/stream/features.rb +53 -0
  56. data/lib/blather/stream/parser.rb +70 -46
  57. data/lib/blather/stream.rb +76 -168
  58. data/lib/blather/xmpp_node.rb +113 -52
  59. data/lib/blather.rb +35 -12
  60. data/spec/blather/client/client_spec.rb +44 -58
  61. data/spec/blather/client/dsl/pubsub_spec.rb +465 -0
  62. data/spec/blather/client/dsl_spec.rb +19 -6
  63. data/spec/blather/core_ext/nokogiri_spec.rb +83 -0
  64. data/spec/blather/errors/sasl_error_spec.rb +8 -8
  65. data/spec/blather/errors/stanza_error_spec.rb +25 -33
  66. data/spec/blather/errors/stream_error_spec.rb +21 -16
  67. data/spec/blather/errors_spec.rb +4 -11
  68. data/spec/blather/jid_spec.rb +31 -30
  69. data/spec/blather/roster_item_spec.rb +34 -23
  70. data/spec/blather/roster_spec.rb +27 -12
  71. data/spec/blather/stanza/discos/disco_info_spec.rb +61 -42
  72. data/spec/blather/stanza/discos/disco_items_spec.rb +47 -35
  73. data/spec/blather/stanza/iq/query_spec.rb +34 -11
  74. data/spec/blather/stanza/iq/roster_spec.rb +47 -30
  75. data/spec/blather/stanza/iq_spec.rb +19 -14
  76. data/spec/blather/stanza/message_spec.rb +30 -17
  77. data/spec/blather/stanza/presence/status_spec.rb +43 -20
  78. data/spec/blather/stanza/presence/subscription_spec.rb +41 -21
  79. data/spec/blather/stanza/presence_spec.rb +34 -21
  80. data/spec/blather/stanza/pubsub/affiliations_spec.rb +57 -0
  81. data/spec/blather/stanza/pubsub/create_spec.rb +56 -0
  82. data/spec/blather/stanza/pubsub/event_spec.rb +84 -0
  83. data/spec/blather/stanza/pubsub/items_spec.rb +79 -0
  84. data/spec/blather/stanza/pubsub/publish_spec.rb +83 -0
  85. data/spec/blather/stanza/pubsub/retract_spec.rb +75 -0
  86. data/spec/blather/stanza/pubsub/subscribe_spec.rb +61 -0
  87. data/spec/blather/stanza/pubsub/subscription_spec.rb +97 -0
  88. data/spec/blather/stanza/pubsub/subscriptions_spec.rb +59 -0
  89. data/spec/blather/stanza/pubsub/unsubscribe_spec.rb +61 -0
  90. data/spec/blather/stanza/pubsub_owner/delete_spec.rb +50 -0
  91. data/spec/blather/stanza/pubsub_owner/purge_spec.rb +50 -0
  92. data/spec/blather/stanza/pubsub_owner_spec.rb +27 -0
  93. data/spec/blather/stanza/pubsub_spec.rb +62 -0
  94. data/spec/blather/stanza_spec.rb +53 -38
  95. data/spec/blather/stream/client_spec.rb +231 -88
  96. data/spec/blather/stream/component_spec.rb +14 -5
  97. data/spec/blather/stream/parser_spec.rb +145 -0
  98. data/spec/blather/xmpp_node_spec.rb +192 -96
  99. data/spec/fixtures/pubsub.rb +311 -0
  100. data/spec/spec_helper.rb +5 -4
  101. metadata +53 -17
  102. data/Rakefile +0 -139
  103. data/ext/extconf.rb +0 -65
  104. data/ext/push_parser.c +0 -209
  105. data/lib/blather/core_ext/libxml.rb +0 -28
  106. data/lib/blather/stream/resource.rb +0 -48
  107. data/lib/blather/stream/session.rb +0 -36
  108. data/lib/blather/stream/stream_handler.rb +0 -39
  109. data/lib/blather/stream/tls.rb +0 -33
  110. data/spec/blather/core_ext/libxml_spec.rb +0 -58
@@ -0,0 +1,311 @@
1
+ def items_all_nodes_xml
2
+ <<-ITEMS
3
+ <iq type='result'
4
+ from='pubsub.shakespeare.lit'
5
+ to='francisco@denmark.lit/barracks'
6
+ id='items1'>
7
+ <pubsub xmlns='http://jabber.org/protocol/pubsub'>
8
+ <items node='princely_musings'>
9
+ <item id='368866411b877c30064a5f62b917cffe'>
10
+ <entry xmlns='http://www.w3.org/2005/Atom'>
11
+ <title>The Uses of This World</title>
12
+ <summary>
13
+ O, that this too too solid flesh would melt
14
+ Thaw and resolve itself into a dew!
15
+ </summary>
16
+ <link rel='alternate' type='text/html'
17
+ href='http://denmark.lit/2003/12/13/atom03'/>
18
+ <id>tag:denmark.lit,2003:entry-32396</id>
19
+ <published>2003-12-12T17:47:23Z</published>
20
+ <updated>2003-12-12T17:47:23Z</updated>
21
+ </entry>
22
+ </item>
23
+ <item id='3300659945416e274474e469a1f0154c'>
24
+ <entry xmlns='http://www.w3.org/2005/Atom'>
25
+ <title>Ghostly Encounters</title>
26
+ <summary>
27
+ O all you host of heaven! O earth! what else?
28
+ And shall I couple hell? O, fie! Hold, hold, my heart;
29
+ And you, my sinews, grow not instant old,
30
+ But bear me stiffly up. Remember thee!
31
+ </summary>
32
+ <link rel='alternate' type='text/html'
33
+ href='http://denmark.lit/2003/12/13/atom03'/>
34
+ <id>tag:denmark.lit,2003:entry-32396</id>
35
+ <published>2003-12-12T23:21:34Z</published>
36
+ <updated>2003-12-12T23:21:34Z</updated>
37
+ </entry>
38
+ </item>
39
+ <item id='4e30f35051b7b8b42abe083742187228'>
40
+ <entry xmlns='http://www.w3.org/2005/Atom'>
41
+ <title>Alone</title>
42
+ <summary>
43
+ Now I am alone.
44
+ O, what a rogue and peasant slave am I!
45
+ </summary>
46
+ <link rel='alternate' type='text/html'
47
+ href='http://denmark.lit/2003/12/13/atom03'/>
48
+ <id>tag:denmark.lit,2003:entry-32396</id>
49
+ <published>2003-12-13T11:09:53Z</published>
50
+ <updated>2003-12-13T11:09:53Z</updated>
51
+ </entry>
52
+ </item>
53
+ <item id='ae890ac52d0df67ed7cfdf51b644e901'>
54
+ <entry xmlns='http://www.w3.org/2005/Atom'>
55
+ <title>Soliloquy</title>
56
+ <summary>
57
+ To be, or not to be: that is the question:
58
+ Whether 'tis nobler in the mind to suffer
59
+ The slings and arrows of outrageous fortune,
60
+ Or to take arms against a sea of troubles,
61
+ And by opposing end them?
62
+ </summary>
63
+ <link rel='alternate' type='text/html'
64
+ href='http://denmark.lit/2003/12/13/atom03'/>
65
+ <id>tag:denmark.lit,2003:entry-32397</id>
66
+ <published>2003-12-13T18:30:02Z</published>
67
+ <updated>2003-12-13T18:30:02Z</updated>
68
+ </entry>
69
+ </item>
70
+ </items>
71
+ </pubsub>
72
+ </iq>
73
+ ITEMS
74
+ end
75
+
76
+ def pubsub_items_some_xml
77
+ <<-ITEMS
78
+ <iq type='result'
79
+ from='pubsub.shakespeare.lit'
80
+ to='francisco@denmark.lit/barracks'
81
+ id='items1'>
82
+ <pubsub xmlns='http://jabber.org/protocol/pubsub'>
83
+ <items node='princely_musings'>
84
+ <item id='368866411b877c30064a5f62b917cffe'>
85
+ <entry xmlns='http://www.w3.org/2005/Atom'>
86
+ <title>The Uses of This World</title>
87
+ <summary>
88
+ O, that this too too solid flesh would melt
89
+ Thaw and resolve itself into a dew!
90
+ </summary>
91
+ <link rel='alternate' type='text/html'
92
+ href='http://denmark.lit/2003/12/13/atom03'/>
93
+ <id>tag:denmark.lit,2003:entry-32396</id>
94
+ <published>2003-12-12T17:47:23Z</published>
95
+ <updated>2003-12-12T17:47:23Z</updated>
96
+ </entry>
97
+ </item>
98
+ <item id='3300659945416e274474e469a1f0154c'>
99
+ <entry xmlns='http://www.w3.org/2005/Atom'>
100
+ <title>Ghostly Encounters</title>
101
+ <summary>
102
+ O all you host of heaven! O earth! what else?
103
+ And shall I couple hell? O, fie! Hold, hold, my heart;
104
+ And you, my sinews, grow not instant old,
105
+ But bear me stiffly up. Remember thee!
106
+ </summary>
107
+ <link rel='alternate' type='text/html'
108
+ href='http://denmark.lit/2003/12/13/atom03'/>
109
+ <id>tag:denmark.lit,2003:entry-32396</id>
110
+ <published>2003-12-12T23:21:34Z</published>
111
+ <updated>2003-12-12T23:21:34Z</updated>
112
+ </entry>
113
+ </item>
114
+ <item id='4e30f35051b7b8b42abe083742187228'>
115
+ <entry xmlns='http://www.w3.org/2005/Atom'>
116
+ <title>Alone</title>
117
+ <summary>
118
+ Now I am alone.
119
+ O, what a rogue and peasant slave am I!
120
+ </summary>
121
+ <link rel='alternate' type='text/html'
122
+ href='http://denmark.lit/2003/12/13/atom03'/>
123
+ <id>tag:denmark.lit,2003:entry-32396</id>
124
+ <published>2003-12-13T11:09:53Z</published>
125
+ <updated>2003-12-13T11:09:53Z</updated>
126
+ </entry>
127
+ </item>
128
+ </items>
129
+ <set xmlns='http://jabber.org/protocol/rsm'>
130
+ <first index='0'>368866411b877c30064a5f62b917cffe</first>
131
+ <last>4e30f35051b7b8b42abe083742187228</last>
132
+ <count>19</count>
133
+ </set>
134
+ </pubsub>
135
+ </iq>
136
+ ITEMS
137
+ end
138
+
139
+ def affiliations_xml
140
+ <<-NODE
141
+ <iq type='result'
142
+ from='pubsub.shakespeare.lit'
143
+ to='francisco@denmark.lit'
144
+ id='affil1'>
145
+ <pubsub xmlns='http://jabber.org/protocol/pubsub'>
146
+ <affiliations>
147
+ <affiliation node='node1' affiliation='owner'/>
148
+ <affiliation node='node2' affiliation='owner'/>
149
+ <affiliation node='node3' affiliation='publisher'/>
150
+ <affiliation node='node4' affiliation='outcast'/>
151
+ <affiliation node='node5' affiliation='member'/>
152
+ <affiliation node='node6' affiliation='none'/>
153
+ </affiliations>
154
+ </pubsub>
155
+ </iq>
156
+ NODE
157
+ end
158
+
159
+ def subscriptions_xml
160
+ <<-NODE
161
+ <iq type='result'
162
+ from='pubsub.shakespeare.lit'
163
+ to='francisco@denmark.lit'
164
+ id='affil1'>
165
+ <pubsub xmlns='http://jabber.org/protocol/pubsub'>
166
+ <subscriptions>
167
+ <subscription node='node1' jid='francisco@denmark.lit' subscription='subscribed'/>
168
+ <subscription node='node2' jid='francisco@denmark.lit' subscription='subscribed'/>
169
+ <subscription node='node3' jid='francisco@denmark.lit' subscription='unconfigured'/>
170
+ <subscription node='node4' jid='francisco@denmark.lit' subscription='pending'/>
171
+ <subscription node='node5' jid='francisco@denmark.lit' subscription='none'/>
172
+ </subscriptions>
173
+ </pubsub>
174
+ </iq>
175
+ NODE
176
+ end
177
+
178
+ def event_with_payload_xml
179
+ <<-NODE
180
+ <message from='pubsub.shakespeare.lit' to='francisco@denmark.lit' id='foo'>
181
+ <event xmlns='http://jabber.org/protocol/pubsub#event'>
182
+ <items node='princely_musings'>
183
+ <item id='ae890ac52d0df67ed7cfdf51b644e901'>
184
+ <entry xmlns='http://www.w3.org/2005/Atom'>
185
+ <title>Soliloquy</title>
186
+ <summary>
187
+ To be, or not to be: that is the question:
188
+ Whether 'tis nobler in the mind to suffer
189
+ The slings and arrows of outrageous fortune,
190
+ Or to take arms against a sea of troubles,
191
+ And by opposing end them?
192
+ </summary>
193
+ <link rel='alternate' type='text/html'
194
+ href='http://denmark.lit/2003/12/13/atom03'/>
195
+ <id>tag:denmark.lit,2003:entry-32397</id>
196
+ <published>2003-12-13T18:30:02Z</published>
197
+ <updated>2003-12-13T18:30:02Z</updated>
198
+ </entry>
199
+ </item>
200
+ </items>
201
+ </event>
202
+ </message>
203
+ NODE
204
+ end
205
+
206
+ def event_notification_xml
207
+ <<-NODE
208
+ <message from='pubsub.shakespeare.lit' to='francisco@denmark.lit' id='foo'>
209
+ <event xmlns='http://jabber.org/protocol/pubsub#event'>
210
+ <items node='princely_musings'>
211
+ <item id='ae890ac52d0df67ed7cfdf51b644e901'/>
212
+ </items>
213
+ </event>
214
+ </message>
215
+ NODE
216
+ end
217
+
218
+ def event_subids_xml
219
+ <<-NODE
220
+ <message from='pubsub.shakespeare.lit' to='francisco@denmark.lit' id='foo'>
221
+ <event xmlns='http://jabber.org/protocol/pubsub#event'>
222
+ <items node='princely_musings'>
223
+ <item id='ae890ac52d0df67ed7cfdf51b644e901'/>
224
+ </items>
225
+ </event>
226
+ <headers xmlns='http://jabber.org/protocol/shim'>
227
+ <header name='SubID'>123-abc</header>
228
+ <header name='SubID'>004-yyy</header>
229
+ </headers>
230
+ </message>
231
+ NODE
232
+ end
233
+
234
+ def unsubscribe_xml
235
+ <<-NODE
236
+ <iq type='error'
237
+ from='pubsub.shakespeare.lit'
238
+ to='francisco@denmark.lit/barracks'
239
+ id='unsub1'>
240
+ <pubsub xmlns='http://jabber.org/protocol/pubsub'>
241
+ <unsubscribe node='princely_musings' jid='francisco@denmark.lit'/>
242
+ </pubsub>
243
+ <error type='modify'>
244
+ <bad-request xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
245
+ <subid-required xmlns='http://jabber.org/protocol/pubsub#errors'/>
246
+ </error>
247
+ </iq>
248
+ NODE
249
+ end
250
+
251
+ def subscription_xml
252
+ <<-NODE
253
+ <iq type='result'
254
+ from='pubsub.shakespeare.lit'
255
+ to='francisco@denmark.lit/barracks'
256
+ id='sub1'>
257
+ <pubsub xmlns='http://jabber.org/protocol/pubsub'>
258
+ <subscription
259
+ node='princely_musings'
260
+ jid='francisco@denmark.lit'
261
+ subid='ba49252aaa4f5d320c24d3766f0bdcade78c78d3'
262
+ subscription='subscribed'/>
263
+ </pubsub>
264
+ </iq>
265
+ NODE
266
+ end
267
+
268
+ def subscribe_xml
269
+ <<-NODE
270
+ <iq type='set'
271
+ from='francisco@denmark.lit/barracks'
272
+ to='pubsub.shakespeare.lit'
273
+ id='sub1'>
274
+ <pubsub xmlns='http://jabber.org/protocol/pubsub'>
275
+ <subscribe
276
+ node='princely_musings'
277
+ jid='francisco@denmark.lit'/>
278
+ </pubsub>
279
+ </iq>
280
+ NODE
281
+ end
282
+
283
+ def publish_xml
284
+ <<-NODE
285
+ <iq type='result'
286
+ from='pubsub.shakespeare.lit'
287
+ to='hamlet@denmark.lit/blogbot'
288
+ id='publish1'>
289
+ <pubsub xmlns='http://jabber.org/protocol/pubsub'>
290
+ <publish node='princely_musings'>
291
+ <item id='ae890ac52d0df67ed7cfdf51b644e901'/>
292
+ </publish>
293
+ </pubsub>
294
+ </iq>
295
+ NODE
296
+ end
297
+
298
+ def retract_xml
299
+ <<-NODE
300
+ <iq type='set'
301
+ from='hamlet@denmark.lit/elsinore'
302
+ to='pubsub.shakespeare.lit'
303
+ id='retract1'>
304
+ <pubsub xmlns='http://jabber.org/protocol/pubsub'>
305
+ <retract node='princely_musings'>
306
+ <item id='ae890ac52d0df67ed7cfdf51b644e901'/>
307
+ </retract>
308
+ </pubsub>
309
+ </iq>
310
+ NODE
311
+ end
data/spec/spec_helper.rb CHANGED
@@ -7,6 +7,8 @@ require 'minitest/spec'
7
7
  require 'mocha'
8
8
  require 'mocha/expectation_error'
9
9
 
10
+ MiniTest::Unit.autorun
11
+
10
12
  module MiniTest
11
13
  require 'pathname' if MINI_DIR =~ %r{^./}
12
14
 
@@ -36,7 +38,6 @@ class Object
36
38
  end
37
39
  end
38
40
 
39
- include Blather
40
- include MiniTest
41
-
42
- Unit.autorun
41
+ def parse_stanza(xml)
42
+ Nokogiri::XML.parse xml
43
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sprsquish-blather
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.4
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeff Smick
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-05-22 00:00:00 -07:00
12
+ date: 2009-06-05 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -23,21 +23,21 @@ dependencies:
23
23
  version: 0.12.6
24
24
  version:
25
25
  - !ruby/object:Gem::Dependency
26
- name: libxml-ruby
26
+ name: nokogiri
27
27
  type: :runtime
28
28
  version_requirement:
29
29
  version_requirements: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: 1.1.2
33
+ version: 1.3.0
34
34
  version:
35
- description: An evented XMPP library written on EventMachine and libxml-ruby
35
+ description: An XMPP DSL for Ruby written on top of EventMachine and Nokogiri
36
36
  email: sprsquish@gmail.com
37
37
  executables: []
38
38
 
39
- extensions:
40
- - Rakefile
39
+ extensions: []
40
+
41
41
  extra_rdoc_files:
42
42
  - LICENSE
43
43
  - README.rdoc
@@ -47,14 +47,18 @@ files:
47
47
  - examples/execute.rb
48
48
  - examples/ping_pong.rb
49
49
  - examples/print_heirarchy.rb
50
- - ext/extconf.rb
51
- - ext/push_parser.c
50
+ - examples/pubsub/cli.rb
51
+ - examples/pubsub/ping_pong.rb
52
+ - examples/rosterprint.rb
53
+ - examples/xmpp4r/echo.rb
52
54
  - lib/blather.rb
53
55
  - lib/blather/client.rb
54
56
  - lib/blather/client/client.rb
55
57
  - lib/blather/client/dsl.rb
58
+ - lib/blather/client/dsl/pubsub.rb
56
59
  - lib/blather/core_ext/active_support.rb
57
- - lib/blather/core_ext/libxml.rb
60
+ - lib/blather/core_ext/active_support/inheritable_attributes.rb
61
+ - lib/blather/core_ext/nokogiri.rb
58
62
  - lib/blather/errors.rb
59
63
  - lib/blather/errors/sasl_error.rb
60
64
  - lib/blather/errors/stanza_error.rb
@@ -73,15 +77,30 @@ files:
73
77
  - lib/blather/stanza/presence.rb
74
78
  - lib/blather/stanza/presence/status.rb
75
79
  - lib/blather/stanza/presence/subscription.rb
80
+ - lib/blather/stanza/pubsub.rb
81
+ - lib/blather/stanza/pubsub/affiliations.rb
82
+ - lib/blather/stanza/pubsub/create.rb
83
+ - lib/blather/stanza/pubsub/errors.rb
84
+ - lib/blather/stanza/pubsub/event.rb
85
+ - lib/blather/stanza/pubsub/items.rb
86
+ - lib/blather/stanza/pubsub/publish.rb
87
+ - lib/blather/stanza/pubsub/retract.rb
88
+ - lib/blather/stanza/pubsub/subscribe.rb
89
+ - lib/blather/stanza/pubsub/subscription.rb
90
+ - lib/blather/stanza/pubsub/subscriptions.rb
91
+ - lib/blather/stanza/pubsub/unsubscribe.rb
92
+ - lib/blather/stanza/pubsub_owner.rb
93
+ - lib/blather/stanza/pubsub_owner/delete.rb
94
+ - lib/blather/stanza/pubsub_owner/purge.rb
76
95
  - lib/blather/stream.rb
77
96
  - lib/blather/stream/client.rb
78
97
  - lib/blather/stream/component.rb
98
+ - lib/blather/stream/features.rb
99
+ - lib/blather/stream/features/resource.rb
100
+ - lib/blather/stream/features/sasl.rb
101
+ - lib/blather/stream/features/session.rb
102
+ - lib/blather/stream/features/tls.rb
79
103
  - lib/blather/stream/parser.rb
80
- - lib/blather/stream/resource.rb
81
- - lib/blather/stream/sasl.rb
82
- - lib/blather/stream/session.rb
83
- - lib/blather/stream/stream_handler.rb
84
- - lib/blather/stream/tls.rb
85
104
  - lib/blather/xmpp_node.rb
86
105
  - LICENSE
87
106
  - README.rdoc
@@ -110,11 +129,12 @@ rubyforge_project: squishtech
110
129
  rubygems_version: 1.2.0
111
130
  signing_key:
112
131
  specification_version: 3
113
- summary: Simpler XMPP
132
+ summary: Simpler XMPP built for speed
114
133
  test_files:
115
134
  - spec/blather/client/client_spec.rb
135
+ - spec/blather/client/dsl/pubsub_spec.rb
116
136
  - spec/blather/client/dsl_spec.rb
117
- - spec/blather/core_ext/libxml_spec.rb
137
+ - spec/blather/core_ext/nokogiri_spec.rb
118
138
  - spec/blather/errors/sasl_error_spec.rb
119
139
  - spec/blather/errors/stanza_error_spec.rb
120
140
  - spec/blather/errors/stream_error_spec.rb
@@ -131,8 +151,24 @@ test_files:
131
151
  - spec/blather/stanza/presence/status_spec.rb
132
152
  - spec/blather/stanza/presence/subscription_spec.rb
133
153
  - spec/blather/stanza/presence_spec.rb
154
+ - spec/blather/stanza/pubsub/affiliations_spec.rb
155
+ - spec/blather/stanza/pubsub/create_spec.rb
156
+ - spec/blather/stanza/pubsub/event_spec.rb
157
+ - spec/blather/stanza/pubsub/items_spec.rb
158
+ - spec/blather/stanza/pubsub/publish_spec.rb
159
+ - spec/blather/stanza/pubsub/retract_spec.rb
160
+ - spec/blather/stanza/pubsub/subscribe_spec.rb
161
+ - spec/blather/stanza/pubsub/subscription_spec.rb
162
+ - spec/blather/stanza/pubsub/subscriptions_spec.rb
163
+ - spec/blather/stanza/pubsub/unsubscribe_spec.rb
164
+ - spec/blather/stanza/pubsub_owner/delete_spec.rb
165
+ - spec/blather/stanza/pubsub_owner/purge_spec.rb
166
+ - spec/blather/stanza/pubsub_owner_spec.rb
167
+ - spec/blather/stanza/pubsub_spec.rb
134
168
  - spec/blather/stanza_spec.rb
135
169
  - spec/blather/stream/client_spec.rb
136
170
  - spec/blather/stream/component_spec.rb
171
+ - spec/blather/stream/parser_spec.rb
137
172
  - spec/blather/xmpp_node_spec.rb
173
+ - spec/fixtures/pubsub.rb
138
174
  - spec/spec_helper.rb
data/Rakefile DELETED
@@ -1,139 +0,0 @@
1
- require 'rubygems'
2
- require 'rake'
3
-
4
- begin
5
- require 'jeweler'
6
- Jeweler::Tasks.new do |gem|
7
- gem.name = 'blather'
8
- gem.summary = 'Simpler XMPP'
9
- gem.description = 'An evented XMPP library written on EventMachine and libxml-ruby'
10
-
11
- gem.email = 'sprsquish@gmail.com'
12
- gem.homepage = 'http://github.com/sprsquish/blather'
13
- gem.authors = ['Jeff Smick']
14
-
15
- gem.rubyforge_project = 'squishtech'
16
-
17
- gem.extensions = ['Rakefile']
18
-
19
- gem.add_dependency 'eventmachine', '>= 0.12.6'
20
- gem.add_dependency 'libxml-ruby', '>= 1.1.2'
21
-
22
- gem.files = FileList['examples/**/*', 'lib/**/*', 'ext/*.{rb,c}'].to_a
23
-
24
- gem.test_files = FileList['spec/**/*.rb']
25
-
26
- # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
27
- end
28
- rescue LoadError
29
- puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
30
- end
31
-
32
- require 'rake/testtask'
33
- Rake::TestTask.new(:test) do |test|
34
- test.libs << 'lib' << 'spec'
35
- test.pattern = 'spec/**/*_spec.rb'
36
- test.verbose = true
37
- end
38
-
39
- begin
40
- require 'rcov/rcovtask'
41
- Rcov::RcovTask.new do |test|
42
- test.libs << 'spec'
43
- test.pattern = 'spec/**/*_spec.rb'
44
- test.rcov_opts += ['--exclude \/Library\/Ruby\/Gems,spec\/', '--xrefs']
45
- test.verbose = true
46
- end
47
- rescue LoadError
48
- task :rcov do
49
- abort "RCov is not available. In order to run rcov, you must: sudo gem install spicycode-rcov"
50
- end
51
- end
52
-
53
-
54
- begin
55
- require 'hanna/rdoctask'
56
-
57
- Rake::RDocTask.new do |rdoc|
58
- if File.exist?('VERSION.yml')
59
- config = YAML.load(File.read('VERSION.yml'))
60
- version = "#{config[:major]}.#{config[:minor]}.#{config[:patch]}"
61
- else
62
- version = ""
63
- end
64
-
65
- rdoc.rdoc_dir = 'rdoc'
66
- rdoc.title = "blather #{version}"
67
- rdoc.rdoc_files.include('README*')
68
- rdoc.rdoc_files.include('lib/**/*.rb')
69
- rdoc.options += %w[-S -T hanna --main README.rdoc --exclude autotest --exclude vendor]
70
- end
71
- rescue LoadError
72
- task :rdoc do
73
- abort "Hanna is not available. In order to use the Hanna, you must: sudo gem install mislav-hanna"
74
- end
75
- end
76
-
77
- begin
78
- require 'rake/contrib/sshpublisher'
79
- namespace :rubyforge do
80
-
81
- desc "Release gem and RDoc documentation to RubyForge"
82
- task :release => ["rubyforge:release:gem", "rubyforge:release:docs"]
83
-
84
- namespace :release do
85
- desc "Publish RDoc to RubyForge."
86
- task :docs => [:rdoc] do
87
- config = YAML.load(
88
- File.read(File.expand_path('~/.rubyforge/user-config.yml'))
89
- )
90
-
91
- host = "#{config['username']}@rubyforge.org"
92
- remote_dir = "/var/www/gforge-projects/squishtech/blather"
93
- local_dir = 'rdoc'
94
-
95
- Rake::SshDirPublisher.new(host, remote_dir, local_dir).upload
96
- end
97
- end
98
- end
99
- rescue LoadError
100
- puts "Rake SshDirPublisher is unavailable or your rubyforge environment is not configured."
101
- end
102
-
103
- MAKE = ENV['MAKE'] || (RUBY_PLATFORM =~ /mswin/ ? 'nmake' : 'make')
104
-
105
- namespace :ext do
106
- ext_sources = FileList['ext/*.{rb,c}']
107
-
108
- desc 'Compile the makefile'
109
- file 'ext/Makefile' => ext_sources do
110
- chdir('ext') { ruby 'extconf.rb' }
111
- end
112
-
113
- desc "make extension"
114
- task :make => ext_sources + ['ext/Makefile'] do
115
- chdir('ext') { sh MAKE }
116
- end
117
-
118
- desc 'Build push parser'
119
- task :build => :make
120
-
121
- desc 'Clean extensions'
122
- task :clean do
123
- chdir 'ext' do
124
- sh "rm -f Makefile"
125
- sh "rm -f *.{o,so,bundle,log}"
126
- end
127
- end
128
- end
129
-
130
- # If running under rubygems...
131
- __DIR__ ||= File.expand_path(File.dirname(__FILE__))
132
- if Gem.path.any? {|path| %r(^#{Regexp.escape path}) =~ __DIR__}
133
- task :default => :gem_build
134
- else
135
- task :default => ['ext:build', :test]
136
- end
137
-
138
- desc ":default build when running under rubygems."
139
- task :gem_build => 'ext:build'
data/ext/extconf.rb DELETED
@@ -1,65 +0,0 @@
1
- require 'mkmf'
2
-
3
- flags = []
4
-
5
- case RUBY_PLATFORM.split('-',2)[1]
6
- when 'mswin32', 'mingw32', 'bccwin32'
7
- unless have_header('windows.h') and
8
- have_header('winsock.h') and
9
- have_library('kernel32') and
10
- have_library('rpcrt4') and
11
- have_library('gdi32')
12
- exit
13
- end
14
-
15
- flags << "-D OS_WIN32"
16
- flags << '-D BUILD_FOR_RUBY'
17
- flags << "-EHs"
18
- flags << "-GR"
19
-
20
- dir_config('xml2')
21
- exit unless have_library('xml2') && have_header('libxml/parser.h')
22
-
23
- when /solaris/
24
- unless have_library('pthread') and
25
- have_library('nsl') and
26
- have_library('socket')
27
- exit
28
- end
29
-
30
- flags << '-D OS_UNIX'
31
- flags << '-D OS_SOLARIS8'
32
- flags << '-D BUILD_FOR_RUBY'
33
-
34
- dir_config('xml2')
35
- exit unless have_library('xml2') && find_header('libxml/parser.h', '/usr/include/libxml2')
36
-
37
- # on Unix we need a g++ link, not gcc.
38
- #CONFIG['LDSHARED'] = "$(CXX) -shared"
39
-
40
- when /darwin/
41
- flags << '-DOS_UNIX'
42
- flags << '-DBUILD_FOR_RUBY'
43
-
44
- dir_config('xml2')
45
- exit unless have_library('xml2') && find_header('libxml/parser.h', '/usr/include/libxml2')
46
- # on Unix we need a g++ link, not gcc.
47
- #CONFIG['LDSHARED'] = "$(CXX) " + CONFIG['LDSHARED'].split[1..-1].join(' ')
48
-
49
- else
50
- unless have_library('pthread')
51
- exit
52
- end
53
-
54
- flags << '-DOS_UNIX'
55
- flags << '-DBUILD_FOR_RUBY'
56
-
57
- dir_config('xml2')
58
- exit unless have_library('xml2') && find_header('libxml/parser.h', '/usr/include/libxml2')
59
- # on Unix we need a g++ link, not gcc.
60
- #CONFIG['LDSHARED'] = "$(CXX) -shared"
61
- end
62
-
63
- $CFLAGS += ' ' + flags.join(' ')
64
-
65
- create_makefile "push_parser"