cron_wrapper 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/Manifest +0 -2
- data/Rakefile +1 -1
- data/cron_wrapper.gemspec +3 -3
- data/spec/cron_wrapper_spec.rb +15 -0
- data.tar.gz.sig +0 -0
- metadata +3 -6
- metadata.gz.sig +0 -0
- data/lib/cron/awesome_script.rb +0 -2
- data/spec/ruby_forker.rb +0 -13
data/Manifest
CHANGED
data/Rakefile
CHANGED
@@ -2,7 +2,7 @@ require 'rubygems'
|
|
2
2
|
require 'rake'
|
3
3
|
require 'echoe'
|
4
4
|
|
5
|
-
Echoe.new('cron_wrapper', '0.0.
|
5
|
+
Echoe.new('cron_wrapper', '0.0.4') do |p|
|
6
6
|
p.description = "A gem that provides useful features for running ruby or Rails scripts with cron"
|
7
7
|
p.url = "http://rubyisbeautiful.com"
|
8
8
|
p.author = "Bryan Taylor"
|
data/cron_wrapper.gemspec
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{cron_wrapper}
|
5
|
-
s.version = "0.0.
|
5
|
+
s.version = "0.0.4"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Bryan Taylor"]
|
@@ -12,8 +12,8 @@ Gem::Specification.new do |s|
|
|
12
12
|
s.description = %q{A gem that provides useful features for running ruby or Rails scripts with cron}
|
13
13
|
s.email = %q{btaylor39 @nospam@ csc.com}
|
14
14
|
s.executables = ["cron_wrapper"]
|
15
|
-
s.extra_rdoc_files = ["bin/cron_wrapper", "lib/
|
16
|
-
s.files = ["Manifest", "Rakefile", "bin/cron_wrapper", "cron_wrapper.gemspec", "lib/
|
15
|
+
s.extra_rdoc_files = ["bin/cron_wrapper", "lib/cron_wrapper.rb"]
|
16
|
+
s.files = ["Manifest", "Rakefile", "bin/cron_wrapper", "cron_wrapper.gemspec", "lib/cron_wrapper.rb", "spec/cron_wrapper_spec.rb", "spec/spec_helper.rb"]
|
17
17
|
s.homepage = %q{http://rubyisbeautiful.com}
|
18
18
|
s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Cron_wrapper"]
|
19
19
|
s.require_paths = ["lib"]
|
data/spec/cron_wrapper_spec.rb
CHANGED
@@ -10,11 +10,26 @@ end
|
|
10
10
|
|
11
11
|
describe "cron_wrapper" do
|
12
12
|
|
13
|
+
before(:all) do
|
14
|
+
FileUtils.mkdir_p "#{root}/tmp/locks"
|
15
|
+
FileUtils.mkdir_p "#{root}/log"
|
16
|
+
FileUtils.mkdir_p "#{root}/lib/cron"
|
17
|
+
File.open("#{root}/lib/cron/awesome_script.rb", 'w') do |file|
|
18
|
+
file. << 'sleep(1); puts "awesome"'
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
13
22
|
before(:each) do
|
14
23
|
@pid = nil
|
15
24
|
remove_lock
|
16
25
|
end
|
17
26
|
|
27
|
+
after(:all) do
|
28
|
+
FileUtils.rm_rf "#{root}/tmp"
|
29
|
+
FileUtils.rm_rf "#{root}/log"
|
30
|
+
FileUtils.rm_rf "#{root}/lib/cron"
|
31
|
+
end
|
32
|
+
|
18
33
|
|
19
34
|
it "should create a lock file in lock_dir if no lock file exists" do
|
20
35
|
t = Thread.new { `#{cmd} awesome_script --wrap-verbose --wrap-skip-rails --wrap-root #{root} --wrap-log log/awesome_script.log` }
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cron_wrapper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 23
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 4
|
10
|
+
version: 0.0.4
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Bryan Taylor
|
@@ -48,17 +48,14 @@ extensions: []
|
|
48
48
|
|
49
49
|
extra_rdoc_files:
|
50
50
|
- bin/cron_wrapper
|
51
|
-
- lib/cron/awesome_script.rb
|
52
51
|
- lib/cron_wrapper.rb
|
53
52
|
files:
|
54
53
|
- Manifest
|
55
54
|
- Rakefile
|
56
55
|
- bin/cron_wrapper
|
57
56
|
- cron_wrapper.gemspec
|
58
|
-
- lib/cron/awesome_script.rb
|
59
57
|
- lib/cron_wrapper.rb
|
60
58
|
- spec/cron_wrapper_spec.rb
|
61
|
-
- spec/ruby_forker.rb
|
62
59
|
- spec/spec_helper.rb
|
63
60
|
has_rdoc: true
|
64
61
|
homepage: http://rubyisbeautiful.com
|
metadata.gz.sig
CHANGED
Binary file
|
data/lib/cron/awesome_script.rb
DELETED
data/spec/ruby_forker.rb
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
require 'rbconfig'
|
2
|
-
|
3
|
-
module RubyForker
|
4
|
-
# Forks a ruby interpreter with same type as ourself.
|
5
|
-
# jruby will fork jruby, ruby will fork ruby etc.
|
6
|
-
def ruby(args, stderr=nil)
|
7
|
-
config = ::RbConfig::CONFIG
|
8
|
-
interpreter = File::join(config['bindir'], config['ruby_install_name']) + config['EXEEXT']
|
9
|
-
cmd = "#{interpreter} #{args}"
|
10
|
-
cmd << " 2> #{stderr}" unless stderr.nil?
|
11
|
-
`#{cmd}`
|
12
|
-
end
|
13
|
-
end
|