xrc 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/lib/xrc/messages/base.rb +6 -0
- data/lib/xrc/version.rb +1 -1
- metadata +2 -4
- data/spec/xrc/client_spec.rb +0 -75
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2de0e6fa75cd6ef92723ae5e7afea87c23346914
|
4
|
+
data.tar.gz: fd1d3a03131848e896522e27334f4ec6fd797dd7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ef49feca2de3f5f528412aa5db31c88cb3b01abf097fb2581b59644ed7805adc659d178b07b5211aa3fb0bce2aa3a36f7d0928dcd7268804a502c6c22d264ed7
|
7
|
+
data.tar.gz: 90c77a1dc133024811f7fac90b6202ed0478b7a5ef830a51706ef8d45516defe1cb51060a7407d005884cb7bcffdf0c32e1907f127e6b310ca58bc68006a6742
|
data/CHANGELOG.md
CHANGED
data/lib/xrc/messages/base.rb
CHANGED
@@ -32,6 +32,12 @@ module Xrc
|
|
32
32
|
def type
|
33
33
|
@element.attribute("type").to_s
|
34
34
|
end
|
35
|
+
|
36
|
+
# @return [true, false] True if given message includes delay element
|
37
|
+
# @note See XEP-0203 for more details about Delayed Delivery
|
38
|
+
def delayed?
|
39
|
+
!!@element.elements["delay"]
|
40
|
+
end
|
35
41
|
end
|
36
42
|
end
|
37
43
|
end
|
data/lib/xrc/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: xrc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryo Nakamura
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-06-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -125,7 +125,6 @@ files:
|
|
125
125
|
- lib/xrc/user.rb
|
126
126
|
- lib/xrc/version.rb
|
127
127
|
- spec/spec_helper.rb
|
128
|
-
- spec/xrc/client_spec.rb
|
129
128
|
- spec/xrc/jid_spec.rb
|
130
129
|
- xrc.gemspec
|
131
130
|
homepage: https://github.com/r7kamura/xrc
|
@@ -154,6 +153,5 @@ specification_version: 4
|
|
154
153
|
summary: XMPP Ruby Client.
|
155
154
|
test_files:
|
156
155
|
- spec/spec_helper.rb
|
157
|
-
- spec/xrc/client_spec.rb
|
158
156
|
- spec/xrc/jid_spec.rb
|
159
157
|
has_rdoc:
|
data/spec/xrc/client_spec.rb
DELETED
@@ -1,75 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
require "active_support/core_ext/string/strip"
|
3
|
-
require "stringio"
|
4
|
-
|
5
|
-
describe Xrc::Client do
|
6
|
-
after do
|
7
|
-
server.close
|
8
|
-
end
|
9
|
-
|
10
|
-
let!(:server) do
|
11
|
-
TCPServer.new(port)
|
12
|
-
end
|
13
|
-
|
14
|
-
let(:instance) do
|
15
|
-
described_class.new(*args)
|
16
|
-
end
|
17
|
-
|
18
|
-
let(:args) do
|
19
|
-
[options]
|
20
|
-
end
|
21
|
-
|
22
|
-
let(:options) do
|
23
|
-
{
|
24
|
-
jid: jid,
|
25
|
-
port: port,
|
26
|
-
}
|
27
|
-
end
|
28
|
-
|
29
|
-
let(:port) do
|
30
|
-
5222
|
31
|
-
end
|
32
|
-
|
33
|
-
let(:jid) do
|
34
|
-
"#{node}@#{domain}/#{resource}"
|
35
|
-
end
|
36
|
-
|
37
|
-
let(:node) do
|
38
|
-
"alice"
|
39
|
-
end
|
40
|
-
|
41
|
-
let(:domain) do
|
42
|
-
"localhost"
|
43
|
-
end
|
44
|
-
|
45
|
-
let(:resource) do
|
46
|
-
"bot"
|
47
|
-
end
|
48
|
-
|
49
|
-
let(:socket) do
|
50
|
-
StringIO.new <<-EOS.strip_heredoc
|
51
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
52
|
-
<stream:stream
|
53
|
-
from='#{domain}'
|
54
|
-
id='5d29a171a9472e73'
|
55
|
-
xmlns:stream='http://etherx.jabber.org/streams'
|
56
|
-
version='1.0'
|
57
|
-
xmlns='jabber:client'>
|
58
|
-
<stream:features>
|
59
|
-
<starttls xmlns='#{Namespaces::TLS}'/>
|
60
|
-
<required/>
|
61
|
-
</stream:features>
|
62
|
-
EOS
|
63
|
-
end
|
64
|
-
|
65
|
-
describe "#run" do
|
66
|
-
before do
|
67
|
-
pending
|
68
|
-
instance.stub(socket: socket)
|
69
|
-
end
|
70
|
-
|
71
|
-
it "parses received XML message" do
|
72
|
-
instance.run
|
73
|
-
end
|
74
|
-
end
|
75
|
-
end
|