loop_dance 0.4.5 → 0.4.6

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -47,6 +47,14 @@ By the rake tasks (TODO):
47
47
  mute_log # mute redundant logging, just start, stop and errors
48
48
  enable_autostart # enable autostart at rails server startup
49
49
 
50
+ # Don't trap signals. True by default (trapped)
51
+ @trap_signals = false
52
+
53
+ # daemon_controller`s options
54
+ @start_timeout = 60 # 15 by default
55
+ @stop_timeout = 60 # 15 by default
56
+ @log_file_activity_timeout # 7 by default
57
+
50
58
 
51
59
  == Contributing to loop_dance
52
60
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.4.5
1
+ 0.4.6
@@ -1,12 +1,14 @@
1
1
  module LoopDance
2
2
 
3
3
  module Commands
4
+
5
+ # # options
6
+ attr_accessor :muted_log, :autostart, :trap_signals,
7
+ :start_timeout, :stop_timeout, :log_file_activity_timeout
4
8
 
5
- # internal vars
6
- attr_accessor :tasks, :timeout, :maximal_timeout
7
-
8
- # options
9
- attr_accessor :muted_log, :autostart, :start_timeout, :stop_timeout, :log_file_activity_timeout
9
+ def inherited(subclass)
10
+ subclass.trap_signals = true
11
+ end
10
12
 
11
13
  def enable_autostart
12
14
  @autostart = true
@@ -85,7 +87,8 @@ module LoopDance
85
87
  return true
86
88
  end
87
89
 
88
- def trap_signals
90
+ def do_trap_signals
91
+ log "Trap signals"
89
92
  sigtrap = proc {
90
93
  log "caught trapped signal, shutting down", true
91
94
  @run = false
@@ -99,9 +102,9 @@ module LoopDance
99
102
  # we don't want to delay output to sdtout until the program stops, we want feedback!
100
103
  $stdout.sync=true
101
104
  write_pid
102
- trap_signals
105
+ do_trap_signals if trap_signals
103
106
  @run = true
104
- log "Process started and sleep for #{timeout.inspect}. kill #{Process.pid} to stop", true
107
+ log "Process started and sleep for #{@timeout.inspect}. kill #{Process.pid} to stop", true
105
108
  end
106
109
 
107
110
  def write_pid
data/loop_dance.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{loop_dance}
8
- s.version = "0.4.5"
8
+ s.version = "0.4.6"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Danil Pismenny"]
12
- s.date = %q{2011-01-25}
12
+ s.date = %q{2011-01-26}
13
13
  s.description = %q{Really simple daemon builder and manager. Based on the looper and daemon_controller}
14
14
  s.email = %q{danil@orionet.ru}
15
15
  s.extra_rdoc_files = [
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: loop_dance
3
3
  version: !ruby/object:Gem::Version
4
- hash: 5
4
+ hash: 3
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 4
9
- - 5
10
- version: 0.4.5
9
+ - 6
10
+ version: 0.4.6
11
11
  platform: ruby
12
12
  authors:
13
13
  - Danil Pismenny
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-01-25 00:00:00 +03:00
18
+ date: 2011-01-26 00:00:00 +03:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency