skates 0.3.3 → 0.3.4
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/skates/router/dsl.rb +2 -2
- data/lib/skates/xmpp_connection.rb +17 -17
- data/lib/skates/xmpp_parser.rb +1 -1
- data/spec/spec_helper.rb +3 -0
- metadata +3 -3
data/lib/skates/router/dsl.rb
CHANGED
@@ -39,8 +39,8 @@ module Skates
|
|
39
39
|
protected
|
40
40
|
def disco_for(type, node = nil)
|
41
41
|
str = "//iq[@type='get']/*[namespace(., 'query', 'http://jabber.org/protocol/disco##{type.to_s}')"
|
42
|
-
str
|
43
|
-
str
|
42
|
+
str << " and @node = '#{node}'" if node
|
43
|
+
str << "]"
|
44
44
|
xpath(str)
|
45
45
|
end
|
46
46
|
end
|
@@ -149,26 +149,26 @@ module Skates
|
|
149
149
|
##
|
150
150
|
# Sends the Nokogiri::XML data (after converting to string) on the stream. Eventually it displays this data for debugging purposes.
|
151
151
|
def send_xml(xml)
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
152
|
+
begin
|
153
|
+
if xml.is_a? Nokogiri::XML::NodeSet
|
154
|
+
xml.each do |element|
|
155
|
+
send_chunk(element.to_s)
|
156
|
+
end
|
157
|
+
else
|
158
|
+
send_chunk(xml.to_s)
|
159
|
+
end
|
160
|
+
rescue
|
161
|
+
Skates.logger.error {
|
162
|
+
"SENDING FAILED: #{$!}"
|
163
|
+
}
|
164
|
+
end
|
165
165
|
end
|
166
|
-
|
166
|
+
|
167
167
|
private
|
168
|
-
|
169
|
-
def send_chunk(string)
|
168
|
+
|
169
|
+
def send_chunk(string = "")
|
170
170
|
raise NotConnected unless @connected
|
171
|
-
return if string
|
171
|
+
return if string == ""
|
172
172
|
raise StanzaTooBig, "Stanza Too Big (#{string.length} vs. #{XmppConnection.max_stanza_size})\n #{string}" if string.length > XmppConnection.max_stanza_size
|
173
173
|
Skates.logger.debug {
|
174
174
|
"SENDING : " + string
|
data/lib/skates/xmpp_parser.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 3
|
8
|
-
-
|
9
|
-
version: 0.3.
|
8
|
+
- 4
|
9
|
+
version: 0.3.4
|
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: 2010-
|
17
|
+
date: 2010-05-03 00:00:00 +02:00
|
18
18
|
default_executable: skates
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|