servolux 0.7.0 → 0.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/History.txt CHANGED
@@ -1,3 +1,8 @@
1
+ == 0.7.1 / 2009-11-06
2
+
3
+ * 1 Bug Fix
4
+ * Server shutdown would hang in Ruby 1.9.1
5
+
1
6
  == 0.7.0 / 2009-11-06
2
7
 
3
8
  * 1 Minor Enhancement
data/Rakefile CHANGED
@@ -22,6 +22,7 @@ Bones {
22
22
  spec.opts << '--color'
23
23
 
24
24
  use_gmail
25
+ enable_sudo
25
26
 
26
27
  depend_on 'bones-extras', :development => true
27
28
  depend_on 'logging', :development => true
@@ -61,20 +61,19 @@ module Servolux::Threaded
61
61
  end
62
62
 
63
63
  # Stop the activity thread. If already stopped this method will return
64
- # without taking any action. Otherwise, this method does not return until
65
- # the activity thread has died or until _limit_ seconds have passed.
64
+ # without taking any action.
66
65
  #
67
66
  # If the including class defines a 'before_stopping' method, it will be
68
67
  # called before the thread is stopped. Likewise, if the including class
69
68
  # defines an 'after_stopping' method, it will be called after the thread
70
69
  # has stopped.
71
70
  #
72
- def stop( limit = nil )
71
+ def stop
73
72
  return self unless _activity_thread.running?
74
73
  logger.debug "Stopping"
75
74
 
76
75
  before_stopping if self.respond_to?(:before_stopping)
77
- @_activity_thread.stop limit
76
+ @_activity_thread.stop
78
77
  after_stopping if self.respond_to?(:after_stopping)
79
78
  self
80
79
  end
@@ -201,10 +200,10 @@ module Servolux::Threaded
201
200
  # :stopdoc:
202
201
 
203
202
  def _activity_thread
204
- @_activity_thread ||= ::Servolux::Threaded::ThreadContainer.new(nil, false, 60, 0, nil, false);
203
+ @_activity_thread ||= ::Servolux::Threaded::ThreadContainer.new(60, 0, nil, false);
205
204
  end
206
205
 
207
- ThreadContainer = Struct.new( :thread, :running, :interval, :iterations, :maximum_iterations, :continue_on_error ) {
206
+ ThreadContainer = Struct.new( :interval, :iterations, :maximum_iterations, :continue_on_error, :thread, :running ) {
208
207
  def start( threaded )
209
208
  self.running = true
210
209
  self.iterations = 0
@@ -212,11 +211,9 @@ module Servolux::Threaded
212
211
  Thread.pass
213
212
  end
214
213
 
215
- def stop( limit )
214
+ def stop
216
215
  self.running = false
217
216
  thread.wakeup
218
- join limit
219
- self.thread = nil
220
217
  end
221
218
 
222
219
  def run( threaded )
data/lib/servolux.rb CHANGED
@@ -2,7 +2,7 @@
2
2
  module Servolux
3
3
 
4
4
  # :stopdoc:
5
- VERSION = '0.7.0'
5
+ VERSION = '0.7.1'
6
6
  LIBPATH = ::File.expand_path(::File.dirname(__FILE__)) + ::File::SEPARATOR
7
7
  PATH = ::File.dirname(LIBPATH) + ::File::SEPARATOR
8
8
  # :startdoc:
@@ -20,13 +20,13 @@ describe Servolux::Threaded do
20
20
 
21
21
  obj = klass.new
22
22
  obj.interval = 0
23
- obj.running?.should be_false
23
+ obj.running?.should be_nil
24
24
 
25
25
  obj.start
26
26
  obj.running?.should be_true
27
27
  obj.pass
28
28
 
29
- obj.stop(2)
29
+ obj.stop.join(2)
30
30
  obj.running?.should be_false
31
31
  end
32
32
 
@@ -46,7 +46,7 @@ describe Servolux::Threaded do
46
46
  obj.stopped.should be_false
47
47
  obj.pass
48
48
 
49
- obj.stop(2)
49
+ obj.stop.join(2)
50
50
  obj.stopped.should be_true
51
51
  end
52
52
 
@@ -68,7 +68,7 @@ describe Servolux::Threaded do
68
68
  obj.ary.should == [1,2]
69
69
  obj.pass
70
70
 
71
- obj.stop(2)
71
+ obj.stop.join(2)
72
72
  obj.ary.should == [1,2,3,4]
73
73
  end
74
74
 
@@ -111,7 +111,7 @@ describe Servolux::Threaded do
111
111
  @log_output.readline
112
112
  @log_output.readline.chomp.should == "ERROR Object : <RuntimeError> ni"
113
113
 
114
- obj.stop(2)
114
+ obj.stop.join(2)
115
115
  obj.running?.should be_false
116
116
  end
117
117
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: servolux
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tim Pease
@@ -66,7 +66,6 @@ extra_rdoc_files:
66
66
  - History.txt
67
67
  - README.rdoc
68
68
  files:
69
- - .gitignore
70
69
  - History.txt
71
70
  - README.rdoc
72
71
  - Rakefile
data/.gitignore DELETED
@@ -1,17 +0,0 @@
1
- # The list of files that should be ignored by Mr Bones.
2
- # Lines that start with '#' are comments.
3
- #
4
- # A .gitignore file can be used instead by setting it as the ignore
5
- # file in your Rakefile:
6
- #
7
- # PROJ.ignore_file = '.gitignore'
8
- #
9
- # For a project with a C extension, the following would be a good set of
10
- # exclude patterns (uncomment them if you want to use them):
11
- # *.[oa]
12
- *~
13
- *.sw[op]
14
- announcement.txt
15
- coverage
16
- doc
17
- pkg