auto_cron 0.1.7 → 0.1.8
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 +1 -1
- data/auto_cron.gemspec +1 -1
- data/lib/auto_cron.rb +6 -4
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.8
|
data/auto_cron.gemspec
CHANGED
data/lib/auto_cron.rb
CHANGED
@@ -21,7 +21,7 @@ class AutoCron
|
|
21
21
|
|
22
22
|
# If an existing identier block is found, replace it with the new cron entries
|
23
23
|
if read_crontab.index(comment_open) && read_crontab.index(comment_close)
|
24
|
-
read_crontab.gsub(Regexp.
|
24
|
+
read_crontab.gsub(Regexp.n#ew("#{comment_open}.+#{comment_close}", Regexp::MULTILINE), auto_cron_wrapped.chomp)
|
25
25
|
else # Otherwise, append the new cron entries after any existing ones
|
26
26
|
[read_crontab, auto_cron_wrapped].join("\n\n")
|
27
27
|
end
|
@@ -47,9 +47,11 @@ protected
|
|
47
47
|
def read_crontab
|
48
48
|
return @current_crontab if @current_crontab
|
49
49
|
|
50
|
-
command = ['crontab -l']
|
51
|
-
command_results = %x[#{command.join(' ')} 2> /dev/null]
|
52
|
-
@current_crontab = $?.exitstatus.zero? ? command_results : ''
|
50
|
+
# command = ['crontab -l']
|
51
|
+
# command_results = %x[#{command.join(' ')} 2> /dev/null]
|
52
|
+
# @current_crontab = $?.exitstatus.zero? ? command_results : ''
|
53
|
+
|
54
|
+
@current_crontab = %x[crontab -l 2> /dev/null]
|
53
55
|
end
|
54
56
|
|
55
57
|
def comment_base
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: auto_cron
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 11
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 8
|
10
|
+
version: 0.1.8
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Alex Farrill
|