servolux 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
data/History.txt CHANGED
@@ -1,4 +1,11 @@
1
+ == 0.2.0 / 2009-06-19
2
+
3
+ * 1 Minor Enhancement
4
+ * Added a signal method to the Piper class for signaling the child
5
+ * 1 bug fix
6
+ * Fixed a race condition in the Threaded#stop method
7
+
1
8
  == 0.1.0 / 2009-06-18
2
9
 
3
- * 1 major enhancement
10
+ * 1 Major Enhancement
4
11
  * Birthday!
@@ -269,6 +269,18 @@ class Servolux::Piper
269
269
  bytes
270
270
  end
271
271
 
272
+ # Send the given signal to the child process. The signal may be an integer
273
+ # signal number or a POSIX signal name (either with or without a +SIG+
274
+ # prefix).
275
+ #
276
+ # This method does nothing when called from the child process.
277
+ #
278
+ def signal( sig )
279
+ return if @child_pid.nil?
280
+ sig = Signal.list.invert[sig] if sig.is_a?(Integer)
281
+ Process.kill(sig, @child_pid)
282
+ end
283
+
272
284
  end # class Servolux::Piper
273
285
 
274
286
  # EOF
@@ -60,7 +60,7 @@ module Servolux::Threaded
60
60
  @activity_thread = Thread.new {
61
61
  begin
62
62
  loop {
63
- sleep interval
63
+ sleep interval if running?
64
64
  break unless running?
65
65
  run
66
66
  }
@@ -84,8 +84,8 @@ module Servolux::Threaded
84
84
  return self unless running?
85
85
  logger.debug "Stopping"
86
86
 
87
- before_stopping if self.respond_to?(:before_stopping)
88
87
  @activity_thread_running = false
88
+ before_stopping if self.respond_to?(:before_stopping)
89
89
  @activity_thread.wakeup
90
90
  @activity_thread.join
91
91
  @activity_thread = nil
data/lib/servolux.rb CHANGED
@@ -4,7 +4,7 @@ require 'logging'
4
4
  module Servolux
5
5
 
6
6
  # :stopdoc:
7
- VERSION = '0.1.0'
7
+ VERSION = '0.2.0'
8
8
  LIBPATH = ::File.expand_path(::File.dirname(__FILE__)) + ::File::SEPARATOR
9
9
  PATH = ::File.dirname(LIBPATH) + ::File::SEPARATOR
10
10
  # :startdoc:
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.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tim Pease
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-06-18 00:00:00 -06:00
12
+ date: 2009-06-19 00:00:00 -06:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency