stomp 1.0.3 → 1.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/stomp.rb +18 -4
  2. metadata +2 -2
@@ -24,7 +24,7 @@ module Stomp
24
24
  class Connection
25
25
 
26
26
  def Connection.open(login = "", passcode = "", host='localhost', port=61613, reliable=FALSE, reconnectDelay=5)
27
- Connection.new login, passcode, host, port, reliable, reconnectDelay
27
+ Connection.new login, passcode, host, port, reliable, reconnectDelay
28
28
  end
29
29
 
30
30
  # Create a connection, requires a login and passcode.
@@ -260,7 +260,21 @@ module Stomp
260
260
 
261
261
  # Accepts a username (default ""), password (default ""),
262
262
  # host (default localhost), and port (default 61613)
263
- def initialize user="", pass="", host="localhost", port=61613, reliable=FALSE
263
+ def initialize user="", pass="", host="localhost", port=61613, reliable=false
264
+ if user =~ /stomp:\/\/(\w+):(\d+)/
265
+ user = ""
266
+ pass = ""
267
+ host = $1
268
+ port = $2
269
+ reliable = false
270
+ elsif user =~ /stomp:\/\/(\w+):(\w+)@(\w+):(\d+)/
271
+ user = $1
272
+ pass = $2
273
+ host = $3
274
+ port = $4
275
+ reliable = false
276
+ end
277
+
264
278
  @id_mutex = Mutex.new
265
279
  @ids = 1
266
280
  @connection = Connection.open user, pass, host, port, reliable
@@ -295,8 +309,8 @@ module Stomp
295
309
 
296
310
  # Accepts a username (default ""), password (default ""),
297
311
  # host (default localhost), and port (default 61613)
298
- def self.open user="", pass="", host="localhost", port=61613
299
- Client.new user, pass, host, port
312
+ def self.open user="", pass="", host="localhost", port=61613, reliable=false
313
+ Client.new user, pass, host, port, reliable
300
314
  end
301
315
 
302
316
  # Begin a transaction by name
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.0
3
3
  specification_version: 1
4
4
  name: stomp
5
5
  version: !ruby/object:Gem::Version
6
- version: 1.0.3
7
- date: 2007-01-04 00:00:00 -08:00
6
+ version: 1.0.4
7
+ date: 2007-01-15 00:00:00 -08:00
8
8
  summary: Ruby client for the Stomp messaging protocol
9
9
  require_paths:
10
10
  - lib