foreverb 0.1.9 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -9,7 +9,8 @@ end
9
9
 
10
10
  desc "Bump version on github"
11
11
  task :bump do
12
- version = Bundler.load_gemspec(Dir[File.expand_path('../*.gemspec', __FILE__)].first).version
12
+ puts "Nothing to commit (working directory clean)" and return if `git status -s`.strip == ""
13
+ version = Bundler.load_gemspec(Dir[File.expand_path('../*.gemspec', __FILE__)].first).version
13
14
  sh "git add .; git commit -m \"Bump to version #{version}\""
14
15
  end
15
16
 
data/lib/forever/base.rb CHANGED
@@ -33,7 +33,7 @@ module Forever
33
33
  STDERR.reopen(STDOUT)
34
34
 
35
35
  threads = []
36
- threads << Thread.new { safe_call(on_ready) } if on_ready
36
+ safe_call(on_ready) if on_ready
37
37
  jobs.each do |job|
38
38
  threads << Thread.new do
39
39
  loop { safe_call(job) if job.time?(Time.now); sleep 1 }
@@ -112,7 +112,7 @@ module Forever
112
112
  end
113
113
 
114
114
  ##
115
- # Callback to fire when the daemon start
115
+ # Callback to fire when the daemon start (blocking, not in thread)
116
116
  #
117
117
  def on_ready(&block)
118
118
  block_given? ? @_on_ready = block : @_on_ready
@@ -137,8 +137,8 @@ module Forever
137
137
  begin
138
138
  block.call
139
139
  rescue Exception => e
140
- on_error[e] if on_error
141
140
  puts "\n\n%s\n %s\n\n" % [e.message, e.backtrace.join("\n ")]
141
+ on_error[e] if on_error
142
142
  sleep 30
143
143
  retry
144
144
  end
@@ -1,3 +1,3 @@
1
1
  module Forever
2
- VERSION = "0.1.9"
2
+ VERSION = "0.2.0"
3
3
  end
metadata CHANGED
@@ -1,12 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreverb
3
3
  version: !ruby/object:Gem::Version
4
- prerelease: false
4
+ hash: 23
5
+ prerelease:
5
6
  segments:
6
7
  - 0
7
- - 1
8
- - 9
9
- version: 0.1.9
8
+ - 2
9
+ - 0
10
+ version: 0.2.0
10
11
  platform: ruby
11
12
  authors:
12
13
  - DAddYE
@@ -14,16 +15,18 @@ autorequire:
14
15
  bindir: bin
15
16
  cert_chain: []
16
17
 
17
- date: 2011-07-12 00:00:00 +02:00
18
+ date: 2011-07-13 00:00:00 +02:00
18
19
  default_executable:
19
20
  dependencies:
20
21
  - !ruby/object:Gem::Dependency
21
22
  name: thor
22
23
  prerelease: false
23
24
  requirement: &id001 !ruby/object:Gem::Requirement
25
+ none: false
24
26
  requirements:
25
27
  - - ~>
26
28
  - !ruby/object:Gem::Version
29
+ hash: 43
27
30
  segments:
28
31
  - 0
29
32
  - 14
@@ -63,23 +66,27 @@ rdoc_options: []
63
66
  require_paths:
64
67
  - lib
65
68
  required_ruby_version: !ruby/object:Gem::Requirement
69
+ none: false
66
70
  requirements:
67
71
  - - ">="
68
72
  - !ruby/object:Gem::Version
73
+ hash: 3
69
74
  segments:
70
75
  - 0
71
76
  version: "0"
72
77
  required_rubygems_version: !ruby/object:Gem::Requirement
78
+ none: false
73
79
  requirements:
74
80
  - - ">="
75
81
  - !ruby/object:Gem::Version
82
+ hash: 3
76
83
  segments:
77
84
  - 0
78
85
  version: "0"
79
86
  requirements: []
80
87
 
81
88
  rubyforge_project: foreverb
82
- rubygems_version: 1.3.6
89
+ rubygems_version: 1.6.2
83
90
  signing_key:
84
91
  specification_version: 3
85
92
  summary: Small daemon framework for ruby