converse 1.0.15 → 1.0.16
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/converse/rest/rest_broker.rb +11 -3
- data/lib/converse/version.rb +1 -1
- metadata +3 -3
@@ -2,7 +2,8 @@ require "converse/broker"
|
|
2
2
|
|
3
3
|
module Converse
|
4
4
|
class RESTBroker < Broker
|
5
|
-
attr_accessor :
|
5
|
+
attr_accessor :host
|
6
|
+
attr_accessor :port
|
6
7
|
attr_accessor :username
|
7
8
|
attr_accessor :password
|
8
9
|
|
@@ -15,12 +16,19 @@ module Converse
|
|
15
16
|
|
16
17
|
def open_topic(concern, action)
|
17
18
|
if (concern.nil? == true or concern == "")
|
18
|
-
"http://#{
|
19
|
+
"http://#{host_and_port()}/#{action}"
|
19
20
|
else
|
20
|
-
"http://#{
|
21
|
+
"http://#{host_and_port()}/#{concern}/#{action}"
|
21
22
|
end
|
22
23
|
end
|
23
24
|
|
25
|
+
def host_and_port
|
26
|
+
u = ""
|
27
|
+
u = u + @host if not @host.nil?
|
28
|
+
u = u + ":" + @port if not @port.nil?
|
29
|
+
u
|
30
|
+
end
|
31
|
+
|
24
32
|
def authenticated_by(username)
|
25
33
|
@username = username
|
26
34
|
self
|
data/lib/converse/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: converse
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 55
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 1.0.
|
9
|
+
- 16
|
10
|
+
version: 1.0.16
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Ernst van Graan
|