xrc 0.1.1 → 0.1.2
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/README.md +1 -0
- data/lib/xrc/client.rb +5 -1
- data/lib/xrc/connection.rb +3 -2
- data/lib/xrc/connection/connector.rb +1 -1
- data/lib/xrc/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 623e48f93776eca276667f03ee7830b090d0c944
|
4
|
+
data.tar.gz: 6337c2e1aa912e42b241e085ccb6b538bacafefd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2082dc713972a5e5737461c22286f0db35fab8010600c6db937b97b88d83ef14aaf0a7333e00a62a4402d8ba918d9dde397e2438fe79d693d29cb5492a136b82
|
7
|
+
data.tar.gz: f4cb58ec4f87312d03f533a0670fa9a286af53130c4d97c78f0efb8d81c61ef17baaea91e6695e162e223637a728dba9bc6249129781c9043ec19e944079cb0f
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -11,6 +11,7 @@ client = Xrc::Client.new(
|
|
11
11
|
jid: "foo@example.com", # required
|
12
12
|
nickname: "bot" # optional
|
13
13
|
password: "xxx", # optional
|
14
|
+
hosts: [ "example.com" ], # optional, automatically determined from JID in absence
|
14
15
|
port: 5222, # optional, default: 5222
|
15
16
|
room_jid: "bar@example.com", # optional, you can pass comma-separated multi room JIDs
|
16
17
|
)
|
data/lib/xrc/client.rb
CHANGED
@@ -180,6 +180,10 @@ module Xrc
|
|
180
180
|
@options[:nickname]
|
181
181
|
end
|
182
182
|
|
183
|
+
def hosts
|
184
|
+
@options[:hosts]
|
185
|
+
end
|
186
|
+
|
183
187
|
def port
|
184
188
|
@options[:port] || DEFAULT_PORT
|
185
189
|
end
|
@@ -194,7 +198,7 @@ module Xrc
|
|
194
198
|
end
|
195
199
|
|
196
200
|
def connection
|
197
|
-
@connection ||= Connection.new(domain: jid.domain, port: port) do |element|
|
201
|
+
@connection ||= Connection.new(domain: jid.domain, hosts: hosts, port: port) do |element|
|
198
202
|
on_received(element)
|
199
203
|
end
|
200
204
|
end
|
data/lib/xrc/connection.rb
CHANGED
@@ -1,15 +1,16 @@
|
|
1
1
|
module Xrc
|
2
2
|
class Connection
|
3
|
-
attr_reader :block, :domain, :port, :socket
|
3
|
+
attr_reader :block, :domain, :hosts, :port, :socket
|
4
4
|
|
5
5
|
def initialize(options, &block)
|
6
6
|
@domain = options[:domain]
|
7
|
+
@hosts = options[:hosts]
|
7
8
|
@port = options[:port]
|
8
9
|
@block = block
|
9
10
|
end
|
10
11
|
|
11
12
|
def connect
|
12
|
-
@socket = Connector.connect(domain: domain, port: port)
|
13
|
+
@socket = Connector.connect(domain: domain, hosts: hosts, port: port)
|
13
14
|
start
|
14
15
|
end
|
15
16
|
|
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.1.
|
4
|
+
version: 0.1.2
|
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-08-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|