cancer 0.1.0.a1
Sign up to get free protection for your applications and to get access to all the features.
- data/.autotest +3 -0
- data/.gitignore +5 -0
- data/LICENSE.txt +22 -0
- data/Rakefile +46 -0
- data/VERSION +1 -0
- data/cancer.gemspec +156 -0
- data/documentation/STREAM_INITIATION.markdown +18 -0
- data/examples/example.rb +80 -0
- data/examples/example_2.rb +20 -0
- data/examples/example_em.rb +11 -0
- data/examples/example_em_helper.rb +23 -0
- data/examples/example_im_roster.rb +26 -0
- data/examples/example_xep_0004.rb +124 -0
- data/examples/example_xep_0047.rb +35 -0
- data/examples/example_xep_0050.rb +78 -0
- data/examples/example_xep_0065.rb +66 -0
- data/examples/example_xep_0096.dup.rb +40 -0
- data/examples/example_xep_0096_xep_0047.rb +42 -0
- data/examples/example_xep_0096_xep_0065.rb +40 -0
- data/lib/cancer.rb +122 -0
- data/lib/cancer/adapter.rb +33 -0
- data/lib/cancer/adapters/em.rb +88 -0
- data/lib/cancer/adapters/socket.rb +122 -0
- data/lib/cancer/builder.rb +28 -0
- data/lib/cancer/controller.rb +32 -0
- data/lib/cancer/dependencies.rb +187 -0
- data/lib/cancer/events/abstract_event.rb +10 -0
- data/lib/cancer/events/base_matchers.rb +63 -0
- data/lib/cancer/events/binary_matchers.rb +30 -0
- data/lib/cancer/events/eventable.rb +92 -0
- data/lib/cancer/events/exception_events.rb +28 -0
- data/lib/cancer/events/handler.rb +33 -0
- data/lib/cancer/events/manager.rb +130 -0
- data/lib/cancer/events/named_events.rb +25 -0
- data/lib/cancer/events/proc_matcher.rb +16 -0
- data/lib/cancer/events/xml_events.rb +44 -0
- data/lib/cancer/exceptions.rb +53 -0
- data/lib/cancer/jid.rb +215 -0
- data/lib/cancer/lock.rb +32 -0
- data/lib/cancer/spec.rb +35 -0
- data/lib/cancer/spec/error.rb +18 -0
- data/lib/cancer/spec/extentions.rb +79 -0
- data/lib/cancer/spec/matcher.rb +30 -0
- data/lib/cancer/spec/mock_adapter.rb +139 -0
- data/lib/cancer/spec/mock_stream.rb +15 -0
- data/lib/cancer/spec/transcript.rb +107 -0
- data/lib/cancer/stream.rb +182 -0
- data/lib/cancer/stream/builder.rb +20 -0
- data/lib/cancer/stream/controller.rb +36 -0
- data/lib/cancer/stream/event_helper.rb +12 -0
- data/lib/cancer/stream/xep.rb +52 -0
- data/lib/cancer/stream_parser.rb +144 -0
- data/lib/cancer/support.rb +27 -0
- data/lib/cancer/support/hash.rb +32 -0
- data/lib/cancer/support/string.rb +22 -0
- data/lib/cancer/synchronized_stanza.rb +79 -0
- data/lib/cancer/thread_pool.rb +118 -0
- data/lib/cancer/xep.rb +43 -0
- data/lib/cancer/xeps/core.rb +109 -0
- data/lib/cancer/xeps/core/bind.rb +33 -0
- data/lib/cancer/xeps/core/sasl.rb +113 -0
- data/lib/cancer/xeps/core/session.rb +22 -0
- data/lib/cancer/xeps/core/stream.rb +18 -0
- data/lib/cancer/xeps/core/terminator.rb +21 -0
- data/lib/cancer/xeps/core/tls.rb +34 -0
- data/lib/cancer/xeps/im.rb +323 -0
- data/lib/cancer/xeps/xep_0004_x_data.rb +692 -0
- data/lib/cancer/xeps/xep_0020_feature_neg.rb +35 -0
- data/lib/cancer/xeps/xep_0030_disco.rb +167 -0
- data/lib/cancer/xeps/xep_0047_ibb.rb +322 -0
- data/lib/cancer/xeps/xep_0050_commands.rb +256 -0
- data/lib/cancer/xeps/xep_0065_bytestreams.rb +306 -0
- data/lib/cancer/xeps/xep_0066_oob.rb +69 -0
- data/lib/cancer/xeps/xep_0095_si.rb +211 -0
- data/lib/cancer/xeps/xep_0096_si_filetransfer.rb +173 -0
- data/lib/cancer/xeps/xep_0114_component.rb +73 -0
- data/lib/cancer/xeps/xep_0115_caps.rb +180 -0
- data/lib/cancer/xeps/xep_0138_compress.rb +134 -0
- data/lib/cancer/xeps/xep_0144_rosterx.rb +250 -0
- data/lib/cancer/xeps/xep_0184_receipts.rb +40 -0
- data/lib/cancer/xeps/xep_0199_ping.rb +41 -0
- data/spec/spec.opts +2 -0
- data/spec/spec_helper.rb +14 -0
- data/spec/stream/stanza_errors_spec.rb +47 -0
- data/spec/stream/stream_errors_spec.rb +38 -0
- data/spec/stream/stream_initialization_spec.rb +160 -0
- data/spec/xep_0050/local_spec.rb +165 -0
- data/spec/xep_0050/remote_spec.rb +44 -0
- metadata +200 -0
@@ -0,0 +1,44 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/../spec_helper'
|
2
|
+
|
3
|
+
describe Cancer::XEP_0050, '#remote' do
|
4
|
+
|
5
|
+
it "sends commands" do
|
6
|
+
dialog_with(:xeps => %w( xep-0050 )) do |stream|
|
7
|
+
|
8
|
+
session = stream.command('knave@wonderland.lit', 'config')
|
9
|
+
session.execute!
|
10
|
+
session.status.should == :completed
|
11
|
+
|
12
|
+
end.should_produce_transcript do |t|
|
13
|
+
t.out %{<iq type="set" to="knave@wonderland.lit" id="cancer-3"><command xmlns='http://jabber.org/protocol/commands' node='config' action='execute'/></iq>}
|
14
|
+
|
15
|
+
t.in %{<iq type='result' from='knave@wonderland.lit' id='cancer-3'><command xmlns='http://jabber.org/protocol/commands' sessionid='config-1' node='config' status='completed'><note type='info'>Service 'httpd' has been configured.</note></command></iq>}
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
it "sends multistage commands" do
|
20
|
+
dialog_with(:xeps => %w( xep-0050 )) do |stream|
|
21
|
+
|
22
|
+
stream.command('knave@wonderland.lit', 'config') do |session|
|
23
|
+
|
24
|
+
session.execute!
|
25
|
+
session.status.should == :executing
|
26
|
+
|
27
|
+
session.complete!
|
28
|
+
session.status.should == :completed
|
29
|
+
|
30
|
+
end
|
31
|
+
|
32
|
+
|
33
|
+
end.should_produce_transcript do |t|
|
34
|
+
t.out %{<iq type="set" to="knave@wonderland.lit" id="cancer-3"><command xmlns='http://jabber.org/protocol/commands' node='config' action='execute'/></iq>}
|
35
|
+
|
36
|
+
t.in %{<iq type='result' from='knave@wonderland.lit' id='cancer-3'><command xmlns='http://jabber.org/protocol/commands' sessionid='config-1' node='config' status='executing'><note type='info'>Service 'httpd' has been configured.</note><actions execute="complete"><complete/></actions></command></iq>}
|
37
|
+
|
38
|
+
t.out %{<iq type="set" to="knave@wonderland.lit" id="cancer-4"><command xmlns='http://jabber.org/protocol/commands' sessionid='config-1' node='config' action='complete'/></iq>}
|
39
|
+
|
40
|
+
t.in %{<iq type='result' from='knave@wonderland.lit' id='cancer-4'><command xmlns='http://jabber.org/protocol/commands' sessionid='config-1' node='config' status='completed'><note type='info'>Service 'httpd' has been configured.</note></command></iq>}
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
end
|
metadata
ADDED
@@ -0,0 +1,200 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: cancer
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0.a1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Simon Menke
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
|
12
|
+
date: 2009-10-28 00:00:00 +01:00
|
13
|
+
default_executable:
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: nokogiri
|
17
|
+
type: :runtime
|
18
|
+
version_requirement:
|
19
|
+
version_requirements: !ruby/object:Gem::Requirement
|
20
|
+
requirements:
|
21
|
+
- - ">="
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: 1.3.3
|
24
|
+
version:
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: astro-ruby-sasl
|
27
|
+
type: :runtime
|
28
|
+
version_requirement:
|
29
|
+
version_requirements: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 0.0.3
|
34
|
+
version:
|
35
|
+
- !ruby/object:Gem::Dependency
|
36
|
+
name: openssl-nonblock
|
37
|
+
type: :runtime
|
38
|
+
version_requirement:
|
39
|
+
version_requirements: !ruby/object:Gem::Requirement
|
40
|
+
requirements:
|
41
|
+
- - ">="
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: 0.2.0
|
44
|
+
version:
|
45
|
+
- !ruby/object:Gem::Dependency
|
46
|
+
name: net-dns
|
47
|
+
type: :runtime
|
48
|
+
version_requirement:
|
49
|
+
version_requirements: !ruby/object:Gem::Requirement
|
50
|
+
requirements:
|
51
|
+
- - ">="
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: 0.5.3
|
54
|
+
version:
|
55
|
+
description: Building XMPP clients should be easy.
|
56
|
+
email: simon.menke@gmail.com
|
57
|
+
engine_dependencies: {}
|
58
|
+
|
59
|
+
executables: []
|
60
|
+
|
61
|
+
extensions: []
|
62
|
+
|
63
|
+
extra_rdoc_files:
|
64
|
+
- LICENSE.txt
|
65
|
+
files:
|
66
|
+
- .autotest
|
67
|
+
- .gitignore
|
68
|
+
- LICENSE.txt
|
69
|
+
- Rakefile
|
70
|
+
- VERSION
|
71
|
+
- cancer.gemspec
|
72
|
+
- documentation/STREAM_INITIATION.markdown
|
73
|
+
- examples/example.rb
|
74
|
+
- examples/example_2.rb
|
75
|
+
- examples/example_em.rb
|
76
|
+
- examples/example_em_helper.rb
|
77
|
+
- examples/example_im_roster.rb
|
78
|
+
- examples/example_xep_0004.rb
|
79
|
+
- examples/example_xep_0047.rb
|
80
|
+
- examples/example_xep_0050.rb
|
81
|
+
- examples/example_xep_0065.rb
|
82
|
+
- examples/example_xep_0096.dup.rb
|
83
|
+
- examples/example_xep_0096_xep_0047.rb
|
84
|
+
- examples/example_xep_0096_xep_0065.rb
|
85
|
+
- lib/cancer.rb
|
86
|
+
- lib/cancer/adapter.rb
|
87
|
+
- lib/cancer/adapters/em.rb
|
88
|
+
- lib/cancer/adapters/socket.rb
|
89
|
+
- lib/cancer/builder.rb
|
90
|
+
- lib/cancer/controller.rb
|
91
|
+
- lib/cancer/dependencies.rb
|
92
|
+
- lib/cancer/events/abstract_event.rb
|
93
|
+
- lib/cancer/events/base_matchers.rb
|
94
|
+
- lib/cancer/events/binary_matchers.rb
|
95
|
+
- lib/cancer/events/eventable.rb
|
96
|
+
- lib/cancer/events/exception_events.rb
|
97
|
+
- lib/cancer/events/handler.rb
|
98
|
+
- lib/cancer/events/manager.rb
|
99
|
+
- lib/cancer/events/named_events.rb
|
100
|
+
- lib/cancer/events/proc_matcher.rb
|
101
|
+
- lib/cancer/events/xml_events.rb
|
102
|
+
- lib/cancer/exceptions.rb
|
103
|
+
- lib/cancer/jid.rb
|
104
|
+
- lib/cancer/lock.rb
|
105
|
+
- lib/cancer/spec.rb
|
106
|
+
- lib/cancer/spec/error.rb
|
107
|
+
- lib/cancer/spec/extentions.rb
|
108
|
+
- lib/cancer/spec/matcher.rb
|
109
|
+
- lib/cancer/spec/mock_adapter.rb
|
110
|
+
- lib/cancer/spec/mock_stream.rb
|
111
|
+
- lib/cancer/spec/transcript.rb
|
112
|
+
- lib/cancer/stream.rb
|
113
|
+
- lib/cancer/stream/builder.rb
|
114
|
+
- lib/cancer/stream/controller.rb
|
115
|
+
- lib/cancer/stream/event_helper.rb
|
116
|
+
- lib/cancer/stream/xep.rb
|
117
|
+
- lib/cancer/stream_parser.rb
|
118
|
+
- lib/cancer/support.rb
|
119
|
+
- lib/cancer/support/hash.rb
|
120
|
+
- lib/cancer/support/string.rb
|
121
|
+
- lib/cancer/synchronized_stanza.rb
|
122
|
+
- lib/cancer/thread_pool.rb
|
123
|
+
- lib/cancer/xep.rb
|
124
|
+
- lib/cancer/xeps/core.rb
|
125
|
+
- lib/cancer/xeps/core/bind.rb
|
126
|
+
- lib/cancer/xeps/core/sasl.rb
|
127
|
+
- lib/cancer/xeps/core/session.rb
|
128
|
+
- lib/cancer/xeps/core/stream.rb
|
129
|
+
- lib/cancer/xeps/core/terminator.rb
|
130
|
+
- lib/cancer/xeps/core/tls.rb
|
131
|
+
- lib/cancer/xeps/im.rb
|
132
|
+
- lib/cancer/xeps/xep_0004_x_data.rb
|
133
|
+
- lib/cancer/xeps/xep_0020_feature_neg.rb
|
134
|
+
- lib/cancer/xeps/xep_0030_disco.rb
|
135
|
+
- lib/cancer/xeps/xep_0047_ibb.rb
|
136
|
+
- lib/cancer/xeps/xep_0050_commands.rb
|
137
|
+
- lib/cancer/xeps/xep_0065_bytestreams.rb
|
138
|
+
- lib/cancer/xeps/xep_0066_oob.rb
|
139
|
+
- lib/cancer/xeps/xep_0095_si.rb
|
140
|
+
- lib/cancer/xeps/xep_0096_si_filetransfer.rb
|
141
|
+
- lib/cancer/xeps/xep_0114_component.rb
|
142
|
+
- lib/cancer/xeps/xep_0115_caps.rb
|
143
|
+
- lib/cancer/xeps/xep_0138_compress.rb
|
144
|
+
- lib/cancer/xeps/xep_0144_rosterx.rb
|
145
|
+
- lib/cancer/xeps/xep_0184_receipts.rb
|
146
|
+
- lib/cancer/xeps/xep_0199_ping.rb
|
147
|
+
- spec/spec.opts
|
148
|
+
- spec/spec_helper.rb
|
149
|
+
- spec/stream/stanza_errors_spec.rb
|
150
|
+
- spec/stream/stream_errors_spec.rb
|
151
|
+
- spec/stream/stream_initialization_spec.rb
|
152
|
+
- spec/xep_0050/local_spec.rb
|
153
|
+
- spec/xep_0050/remote_spec.rb
|
154
|
+
has_rdoc: true
|
155
|
+
homepage: http://github.com/simonmenke/cancer
|
156
|
+
licenses: []
|
157
|
+
|
158
|
+
post_install_message:
|
159
|
+
rdoc_options:
|
160
|
+
- --charset=UTF-8
|
161
|
+
require_paths:
|
162
|
+
- lib
|
163
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
164
|
+
requirements:
|
165
|
+
- - ">="
|
166
|
+
- !ruby/object:Gem::Version
|
167
|
+
version: "0"
|
168
|
+
version:
|
169
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
170
|
+
requirements:
|
171
|
+
- - ">"
|
172
|
+
- !ruby/object:Gem::Version
|
173
|
+
version: 1.3.1
|
174
|
+
version:
|
175
|
+
requirements: []
|
176
|
+
|
177
|
+
rubyforge_project:
|
178
|
+
rubygems_version: 1.3.5
|
179
|
+
signing_key:
|
180
|
+
specification_version: 3
|
181
|
+
summary: A Nokogiri based XMPP client library
|
182
|
+
test_files:
|
183
|
+
- spec/spec_helper.rb
|
184
|
+
- spec/stream/stanza_errors_spec.rb
|
185
|
+
- spec/stream/stream_errors_spec.rb
|
186
|
+
- spec/stream/stream_initialization_spec.rb
|
187
|
+
- spec/xep_0050/local_spec.rb
|
188
|
+
- spec/xep_0050/remote_spec.rb
|
189
|
+
- examples/example.rb
|
190
|
+
- examples/example_2.rb
|
191
|
+
- examples/example_em.rb
|
192
|
+
- examples/example_em_helper.rb
|
193
|
+
- examples/example_im_roster.rb
|
194
|
+
- examples/example_xep_0004.rb
|
195
|
+
- examples/example_xep_0047.rb
|
196
|
+
- examples/example_xep_0050.rb
|
197
|
+
- examples/example_xep_0065.rb
|
198
|
+
- examples/example_xep_0096.dup.rb
|
199
|
+
- examples/example_xep_0096_xep_0047.rb
|
200
|
+
- examples/example_xep_0096_xep_0065.rb
|