stomper 0.3.2 → 0.4

Sign up to get free protection for your applications and to get access to all the features.
data/AUTHORS CHANGED
@@ -11,7 +11,7 @@ for this project. Please do not contact them with questions regarding Stomper.
11
11
 
12
12
  The following people have contributed to Stomp (ordered by commits):
13
13
 
14
- Brian McCaliister
14
+ Brian McCallister
15
15
  Glenn Rempe <glenn@rempe.us>
16
16
  jstrachan
17
17
  Marius Mathiesen <marius.mathiesen@gmail.com>
data/CHANGELOG CHANGED
@@ -1,3 +1,13 @@
1
+ == 0.4 2010-04-23
2
+
3
+ * Incremented minor version, beginning expansion.
4
+
5
+ == 0.3 2010-03-04
6
+
7
+ * Added sleep to receive loop to prevent it from running "too tightly", not ideal.
8
+ * Bit of cleanup in response to reek report.
9
+
10
+
1
11
  == 0.2 2009-11-20
2
12
 
3
13
  * Officially moved to "stomper" library.
@@ -273,18 +273,17 @@ module Stomper
273
273
  msg
274
274
  end
275
275
 
276
- # Toying with an idea, probably a very bad one!
277
- def each # :nodoc:
278
- while connected?
279
- yield receive
280
- end
281
- end
282
-
283
276
  # Returns true if the client is connected, false otherwise.
284
277
  def connected?
285
278
  @connection.connected?
286
279
  end
287
280
 
281
+ # Establishes a socket connection to the stomp broker and transmits
282
+ # the initial "CONNECT" frame requred per the Stomp protocol.
283
+ def connect
284
+ @connection.connect
285
+ end
286
+
288
287
  # Disconnects from the stomp broker politely by first transmitting
289
288
  # a Stomper::Frames::Disconnect frame to the broker.
290
289
  def disconnect
@@ -304,5 +303,13 @@ module Stomper
304
303
  @connection.transmit(frame)
305
304
  end
306
305
  end
306
+
307
+ private
308
+ # Toying with an idea, probably a very bad one!
309
+ def each # :nodoc:
310
+ while connected?
311
+ yield receive
312
+ end
313
+ end
307
314
  end
308
315
  end
@@ -76,7 +76,7 @@ module Stomper
76
76
  #
77
77
  # See also: disconnect
78
78
  def close
79
- @socket.close
79
+ @socket.close if @socket
80
80
  ensure
81
81
  @connected = false
82
82
  end
data/spec/client_spec.rb CHANGED
@@ -66,6 +66,9 @@ module Stomper
66
66
  it "should provide a connectivity test" do
67
67
  @client.should respond_to(:connected?)
68
68
  end
69
+ it "should provide a connect method" do
70
+ @client.should respond_to(:connect)
71
+ end
69
72
  end
70
73
 
71
74
  describe "threaded receiver" do
metadata CHANGED
@@ -4,9 +4,8 @@ version: !ruby/object:Gem::Version
4
4
  prerelease: false
5
5
  segments:
6
6
  - 0
7
- - 3
8
- - 2
9
- version: 0.3.2
7
+ - 4
8
+ version: "0.4"
10
9
  platform: ruby
11
10
  authors:
12
11
  - Ian D. Eccles
@@ -14,7 +13,7 @@ autorequire:
14
13
  bindir: bin
15
14
  cert_chain: []
16
15
 
17
- date: 2010-03-05 00:00:00 -05:00
16
+ date: 2010-04-23 00:00:00 -04:00
18
17
  default_executable:
19
18
  dependencies: []
20
19