chrono_trigger 0.2.0 → 0.2.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/.project +11 -0
- data/History.txt +4 -0
- data/Manifest.txt +1 -0
- data/README.rdoc +3 -3
- data/Rakefile +26 -25
- data/VERSION.yml +2 -2
- data/chrono_trigger.gemspec +49 -46
- data/lib/chrono_trigger.rb +6 -3
- data/lib/chrono_trigger/process.rb +4 -4
- data/lib/chrono_trigger/runner.rb +1 -0
- data/lib/chrono_trigger/version.rb +6 -0
- data/test/test_helper.rb +3 -3
- data/test/test_trigger.rb +0 -2
- metadata +135 -27
data/.project
ADDED
data/History.txt
CHANGED
data/Manifest.txt
CHANGED
data/README.rdoc
CHANGED
@@ -28,12 +28,12 @@ Other available options are:
|
|
28
28
|
|
29
29
|
== REQUIREMENTS:
|
30
30
|
|
31
|
-
* ActiveSupport >= 3.
|
32
|
-
* Ruby >= 1.
|
31
|
+
* ActiveSupport >= 2.3.4
|
32
|
+
* Ruby >= 1.8.6
|
33
33
|
|
34
34
|
== INSTALL:
|
35
35
|
|
36
|
-
*
|
36
|
+
* gem install chrono_trigger
|
37
37
|
|
38
38
|
== LICENSE:
|
39
39
|
|
data/Rakefile
CHANGED
@@ -1,25 +1,26 @@
|
|
1
|
-
# %w[rubygems rake rake/clean fileutils newgem rubigen rake/testtask].each { |f| require f }
|
2
|
-
# require File.dirname(__FILE__) + '/lib/chrono_trigger'
|
3
|
-
|
4
|
-
require 'rake/testtask'
|
5
|
-
|
6
|
-
Rake::TestTask.new do |t|
|
7
|
-
t.libs << 'test'
|
8
|
-
end
|
9
|
-
|
10
|
-
desc "Run tests"
|
11
|
-
task :default => :test
|
12
|
-
|
13
|
-
begin
|
14
|
-
require 'jeweler'
|
15
|
-
Jeweler::Tasks.new do |s|
|
16
|
-
s.name = "chrono_trigger"
|
17
|
-
s.
|
18
|
-
s.
|
19
|
-
s.
|
20
|
-
s.description = "
|
21
|
-
s.
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
1
|
+
# %w[rubygems rake rake/clean fileutils newgem rubigen rake/testtask].each { |f| require f }
|
2
|
+
# require File.dirname(__FILE__) + '/lib/chrono_trigger'
|
3
|
+
|
4
|
+
require 'rake/testtask'
|
5
|
+
|
6
|
+
Rake::TestTask.new do |t|
|
7
|
+
t.libs << 'test'
|
8
|
+
end
|
9
|
+
|
10
|
+
desc "Run tests"
|
11
|
+
task :default => :test
|
12
|
+
|
13
|
+
begin
|
14
|
+
require 'jeweler'
|
15
|
+
Jeweler::Tasks.new do |s|
|
16
|
+
s.name = "chrono_trigger"
|
17
|
+
s.authors = ["Jon Ciccone"]
|
18
|
+
s.date = "2013-01-10"
|
19
|
+
s.summary = "Rails cron jobs."
|
20
|
+
s.description = "This gem allows you to write, deploy, and maintain cron jobs withing the rails framework."
|
21
|
+
s.email = "darful@gmail.com"
|
22
|
+
s.homepage = "https://github.com/darful/chrono_trigger"
|
23
|
+
end
|
24
|
+
rescue LoadError
|
25
|
+
puts "Jeweler not available. Install it with: gem install technicalpickles-jeweler -s http://gems.github.com"
|
26
|
+
end
|
data/VERSION.yml
CHANGED
data/chrono_trigger.gemspec
CHANGED
@@ -1,64 +1,67 @@
|
|
1
1
|
# Generated by jeweler
|
2
2
|
# DO NOT EDIT THIS FILE
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run `rake gemspec`
|
4
|
+
|
4
5
|
# -*- encoding: utf-8 -*-
|
5
6
|
|
6
7
|
Gem::Specification.new do |s|
|
7
|
-
s.name = "chrono_trigger"
|
8
|
-
s.version = "0.2.0"
|
9
8
|
|
10
|
-
s.
|
9
|
+
s.name = "chrono_trigger"
|
11
10
|
s.authors = ["Jon Ciccone"]
|
12
11
|
s.date = "2013-01-10"
|
13
|
-
s.
|
12
|
+
s.summary = "Rails cron jobs."
|
13
|
+
s.description = "This gem allows you to write, deploy, and maintain cron jobs withing the rails framework."
|
14
14
|
s.email = "darful@gmail.com"
|
15
|
-
s.
|
16
|
-
s.
|
17
|
-
|
18
|
-
]
|
15
|
+
s.homepage = "https://github.com/darful/chrono_trigger"
|
16
|
+
s.version = '0.2.1'
|
17
|
+
|
19
18
|
s.files = [
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
19
|
+
".project",
|
20
|
+
"History.txt",
|
21
|
+
"Manifest.txt",
|
22
|
+
"PostInstall.txt",
|
23
|
+
"README.rdoc",
|
24
|
+
"Rakefile",
|
25
|
+
"VERSION.yml",
|
26
|
+
"bin/chrono_trigger",
|
27
|
+
"chrono_trigger.gemspec",
|
28
|
+
"lib/chrono_trigger.rb",
|
29
|
+
"lib/chrono_trigger/cron_entry.rb",
|
30
|
+
"lib/chrono_trigger/process.rb",
|
31
|
+
"lib/chrono_trigger/runner.rb",
|
32
|
+
"lib/chrono_trigger/shell.rb",
|
33
|
+
"lib/chrono_trigger/tasks.rb",
|
34
|
+
"lib/chrono_trigger/trigger.rb",
|
35
|
+
"lib/chrono_trigger/version.rb",
|
36
|
+
"lib/tasks/chrono_trigger.rake",
|
37
|
+
"lib/triggers/test_triggers.rb",
|
38
|
+
"script/console",
|
39
|
+
"script/destroy",
|
40
|
+
"script/generate",
|
41
|
+
"test/test_chrono_trigger.rb",
|
42
|
+
"test/test_cron_entry.rb",
|
43
|
+
"test/test_helper.rb",
|
44
|
+
"test/test_shell.rb",
|
45
|
+
"test/test_trigger.rb",
|
46
|
+
"test/triggers.rb"
|
46
47
|
]
|
47
|
-
s.
|
48
|
-
s.
|
48
|
+
s.executables = s.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
49
|
+
s.test_files = s.files.grep(%r{^(test)/})
|
49
50
|
s.require_paths = ["lib"]
|
50
|
-
s.
|
51
|
-
|
52
|
-
s.
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
51
|
+
s.extra_rdoc_files = ["README.rdoc"]
|
52
|
+
|
53
|
+
s.add_dependency "activesupport", ">= 2.3.4"
|
54
|
+
#s.add_dependency "activerecord", ">= 2.3.4"
|
55
|
+
|
56
|
+
s.add_development_dependency "shoulda", ">= 2.10"
|
57
|
+
s.add_development_dependency "mocha", ">= 0.9.5"
|
58
|
+
|
59
|
+
s.add_development_dependency "rubyforge"
|
60
|
+
s.add_development_dependency "git"
|
61
|
+
s.add_development_dependency "technicalpickles-jeweler"
|
60
62
|
|
61
63
|
if s.respond_to? :specification_version then
|
64
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
62
65
|
s.specification_version = 3
|
63
66
|
|
64
67
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
data/lib/chrono_trigger.rb
CHANGED
@@ -1,11 +1,14 @@
|
|
1
1
|
$:.unshift(File.dirname(__FILE__)) unless
|
2
2
|
$:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
|
3
3
|
|
4
|
-
|
5
|
-
|
4
|
+
if RUBY_VERSION =~ /1\.8\.6/
|
5
|
+
require "activerecord"
|
6
|
+
else
|
7
|
+
require "active_record"
|
6
8
|
end
|
7
9
|
|
8
|
-
require
|
10
|
+
require 'active_support/all'
|
11
|
+
require "chrono_trigger/version"
|
9
12
|
require "chrono_trigger/shell"
|
10
13
|
require "chrono_trigger/trigger"
|
11
14
|
require "chrono_trigger/cron_entry"
|
@@ -3,7 +3,7 @@ module ChronoTrigger
|
|
3
3
|
class Process
|
4
4
|
|
5
5
|
def run(options={})
|
6
|
-
@
|
6
|
+
@thread = Thread.new do
|
7
7
|
setup(options)
|
8
8
|
|
9
9
|
shell = ChronoTrigger::Shell.new
|
@@ -14,11 +14,11 @@ module ChronoTrigger
|
|
14
14
|
end
|
15
15
|
end
|
16
16
|
|
17
|
-
@
|
17
|
+
@thread.join
|
18
18
|
end
|
19
19
|
|
20
20
|
def stop
|
21
|
-
@
|
21
|
+
@thread.exit
|
22
22
|
end
|
23
23
|
|
24
24
|
private
|
@@ -27,7 +27,7 @@ module ChronoTrigger
|
|
27
27
|
ENV['RAILS_ENV'] = options[:env] || "development"
|
28
28
|
|
29
29
|
application_path = File.join(application_context, 'config', 'environment')
|
30
|
-
STDOUT.puts "Loading application environment at #{File.join(application_context, 'config', 'environment')} for '#{ENV['RAILS_ENV']}'
|
30
|
+
STDOUT.puts "Loading application environment at #{File.join(application_context, 'config', 'environment')} for '#{ENV['RAILS_ENV']}' environment."
|
31
31
|
require(application_path)
|
32
32
|
end
|
33
33
|
|
data/test/test_helper.rb
CHANGED
@@ -1,9 +1,9 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'chrono_trigger'
|
1
3
|
require 'stringio'
|
2
4
|
require 'test/unit'
|
3
|
-
require File.dirname(__FILE__) + '/../lib/chrono_trigger'
|
4
5
|
require 'shoulda'
|
5
|
-
require 'mocha
|
6
|
-
require 'active_support/all'
|
6
|
+
require 'mocha'
|
7
7
|
|
8
8
|
|
9
9
|
def quietly
|
data/test/test_trigger.rb
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
class TestTrigger < Test::Unit::TestCase
|
2
|
-
|
3
2
|
context "A Trigger, @trigger," do
|
4
3
|
setup do
|
5
4
|
@trigger = ChronoTrigger::Trigger.new("test trigger")
|
@@ -155,7 +154,6 @@ class TestTrigger < Test::Unit::TestCase
|
|
155
154
|
end
|
156
155
|
|
157
156
|
should "raise an exception, which is caught, then retry the call method" do
|
158
|
-
require "active_record"
|
159
157
|
ActiveRecord::Base.stubs(:connection).returns(mock({:reconnect! => true}))
|
160
158
|
assert_equal @value, @trigger.execute
|
161
159
|
end
|
metadata
CHANGED
@@ -1,24 +1,122 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: chrono_trigger
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 21
|
5
5
|
prerelease:
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 2
|
9
|
+
- 1
|
10
|
+
version: 0.2.1
|
6
11
|
platform: ruby
|
7
|
-
authors:
|
12
|
+
authors:
|
8
13
|
- Jon Ciccone
|
9
14
|
autorequire:
|
10
15
|
bindir: bin
|
11
16
|
cert_chain: []
|
12
|
-
|
13
|
-
|
14
|
-
|
17
|
+
|
18
|
+
date: 2013-01-10 00:00:00 -05:00
|
19
|
+
default_executable:
|
20
|
+
dependencies:
|
21
|
+
- !ruby/object:Gem::Dependency
|
22
|
+
name: activesupport
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: &id001 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
hash: 11
|
30
|
+
segments:
|
31
|
+
- 2
|
32
|
+
- 3
|
33
|
+
- 4
|
34
|
+
version: 2.3.4
|
35
|
+
type: :runtime
|
36
|
+
requirement: *id001
|
37
|
+
- !ruby/object:Gem::Dependency
|
38
|
+
name: shoulda
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: &id002 !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ">="
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
hash: 23
|
46
|
+
segments:
|
47
|
+
- 2
|
48
|
+
- 10
|
49
|
+
version: "2.10"
|
50
|
+
type: :development
|
51
|
+
requirement: *id002
|
52
|
+
- !ruby/object:Gem::Dependency
|
53
|
+
name: mocha
|
54
|
+
prerelease: false
|
55
|
+
version_requirements: &id003 !ruby/object:Gem::Requirement
|
56
|
+
none: false
|
57
|
+
requirements:
|
58
|
+
- - ">="
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
hash: 49
|
61
|
+
segments:
|
62
|
+
- 0
|
63
|
+
- 9
|
64
|
+
- 5
|
65
|
+
version: 0.9.5
|
66
|
+
type: :development
|
67
|
+
requirement: *id003
|
68
|
+
- !ruby/object:Gem::Dependency
|
69
|
+
name: rubyforge
|
70
|
+
prerelease: false
|
71
|
+
version_requirements: &id004 !ruby/object:Gem::Requirement
|
72
|
+
none: false
|
73
|
+
requirements:
|
74
|
+
- - ">="
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
hash: 3
|
77
|
+
segments:
|
78
|
+
- 0
|
79
|
+
version: "0"
|
80
|
+
type: :development
|
81
|
+
requirement: *id004
|
82
|
+
- !ruby/object:Gem::Dependency
|
83
|
+
name: git
|
84
|
+
prerelease: false
|
85
|
+
version_requirements: &id005 !ruby/object:Gem::Requirement
|
86
|
+
none: false
|
87
|
+
requirements:
|
88
|
+
- - ">="
|
89
|
+
- !ruby/object:Gem::Version
|
90
|
+
hash: 3
|
91
|
+
segments:
|
92
|
+
- 0
|
93
|
+
version: "0"
|
94
|
+
type: :development
|
95
|
+
requirement: *id005
|
96
|
+
- !ruby/object:Gem::Dependency
|
97
|
+
name: technicalpickles-jeweler
|
98
|
+
prerelease: false
|
99
|
+
version_requirements: &id006 !ruby/object:Gem::Requirement
|
100
|
+
none: false
|
101
|
+
requirements:
|
102
|
+
- - ">="
|
103
|
+
- !ruby/object:Gem::Version
|
104
|
+
hash: 3
|
105
|
+
segments:
|
106
|
+
- 0
|
107
|
+
version: "0"
|
108
|
+
type: :development
|
109
|
+
requirement: *id006
|
110
|
+
description: This gem allows you to write, deploy, and maintain cron jobs withing the rails framework.
|
15
111
|
email: darful@gmail.com
|
16
|
-
executables:
|
112
|
+
executables:
|
17
113
|
- chrono_trigger
|
18
114
|
extensions: []
|
19
|
-
|
115
|
+
|
116
|
+
extra_rdoc_files:
|
20
117
|
- README.rdoc
|
21
|
-
files:
|
118
|
+
files:
|
119
|
+
- .project
|
22
120
|
- History.txt
|
23
121
|
- Manifest.txt
|
24
122
|
- PostInstall.txt
|
@@ -34,6 +132,7 @@ files:
|
|
34
132
|
- lib/chrono_trigger/shell.rb
|
35
133
|
- lib/chrono_trigger/tasks.rb
|
36
134
|
- lib/chrono_trigger/trigger.rb
|
135
|
+
- lib/chrono_trigger/version.rb
|
37
136
|
- lib/tasks/chrono_trigger.rake
|
38
137
|
- lib/triggers/test_triggers.rb
|
39
138
|
- script/console
|
@@ -45,32 +144,41 @@ files:
|
|
45
144
|
- test/test_shell.rb
|
46
145
|
- test/test_trigger.rb
|
47
146
|
- test/triggers.rb
|
48
|
-
|
147
|
+
has_rdoc: true
|
148
|
+
homepage: https://github.com/darful/chrono_trigger
|
49
149
|
licenses: []
|
150
|
+
|
50
151
|
post_install_message:
|
51
|
-
rdoc_options:
|
52
|
-
|
53
|
-
require_paths:
|
152
|
+
rdoc_options: []
|
153
|
+
|
154
|
+
require_paths:
|
54
155
|
- lib
|
55
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
156
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
56
157
|
none: false
|
57
|
-
requirements:
|
58
|
-
- -
|
59
|
-
- !ruby/object:Gem::Version
|
60
|
-
|
61
|
-
|
158
|
+
requirements:
|
159
|
+
- - ">="
|
160
|
+
- !ruby/object:Gem::Version
|
161
|
+
hash: 3
|
162
|
+
segments:
|
163
|
+
- 0
|
164
|
+
version: "0"
|
165
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
62
166
|
none: false
|
63
|
-
requirements:
|
64
|
-
- -
|
65
|
-
- !ruby/object:Gem::Version
|
66
|
-
|
167
|
+
requirements:
|
168
|
+
- - ">="
|
169
|
+
- !ruby/object:Gem::Version
|
170
|
+
hash: 3
|
171
|
+
segments:
|
172
|
+
- 0
|
173
|
+
version: "0"
|
67
174
|
requirements: []
|
175
|
+
|
68
176
|
rubyforge_project:
|
69
|
-
rubygems_version: 1.
|
177
|
+
rubygems_version: 1.4.2
|
70
178
|
signing_key:
|
71
179
|
specification_version: 3
|
72
|
-
summary:
|
73
|
-
test_files:
|
180
|
+
summary: Rails cron jobs.
|
181
|
+
test_files:
|
74
182
|
- test/test_chrono_trigger.rb
|
75
183
|
- test/test_cron_entry.rb
|
76
184
|
- test/test_helper.rb
|