daemonizer 0.4.1 → 0.4.2

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/VERSION CHANGED
@@ -1 +1 @@
1
- 0.4.1
1
+ 0.4.2
data/daemonizer.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{daemonizer}
8
- s.version = "0.4.1"
8
+ s.version = "0.4.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Gleb Pomykalov"]
@@ -29,7 +29,8 @@ class Daemonizer::Dsl
29
29
  def set_callback(callback, &block)
30
30
  return unless CALLBACKS.include?(callback.to_sym)
31
31
  @options[:callbacks] ||= {}
32
- @options[:callbacks][callback.to_sym] = block
32
+ @options[:callbacks][callback.to_sym] ||= []
33
+ @options[:callbacks][callback.to_sym] << block
33
34
  end
34
35
 
35
36
  CALLBACKS.each do |callback|
@@ -8,9 +8,11 @@ module Daemonizer
8
8
  end
9
9
 
10
10
  def run_callback(callback, *args)
11
- if block = @config.callbacks[callback.to_sym]
12
- Daemonizer.logger.info "Running :#{callback} callback"
13
- block.call(*args)
11
+ if callbacks = @config.callbacks[callback.to_sym] and callbacks.any?
12
+ Daemonizer.logger.info "Running :#{callback} callbacks"
13
+ callbacks.each do |callback|
14
+ callback.call(*args)
15
+ end
14
16
  end
15
17
  end
16
18
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: daemonizer
3
3
  version: !ruby/object:Gem::Version
4
- hash: 13
4
+ hash: 11
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 4
9
- - 1
10
- version: 0.4.1
9
+ - 2
10
+ version: 0.4.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Gleb Pomykalov