capistrano-cron 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE.txt +1 -1
- data/lib/capistrano/cron/job.rb +1 -1
- data/lib/capistrano/cron/job_list.rb +3 -3
- data/lib/capistrano/cron/numeric_ext.rb +1 -1
- data/lib/capistrano/cron/output/cron.rb +2 -2
- data/lib/capistrano/cron/version.rb +5 -0
- data/lib/capistrano/cron.rb +1 -3
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 60b25f701480e517d7520903b802f80f272289e48331e87e6a9e933dbd11b964
|
4
|
+
data.tar.gz: 971a3a1fb90f42ea9c401957fc538368edfb4aeedb52821e3b7736d4651844d8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 20038c5d0cc153c391f8cc3ab40ddfa03e158e95c0b2edc6a69dbc4b5e6c3eef0d2e7a1ac11002aa58437cc8bdbbfcd8897fb751fd0760e9620c8671309d764c
|
7
|
+
data.tar.gz: 4986f10b45647300d4bfb0dcd1742169206b88853745a8d44d325176e6774ed9a328b1d92ab64d431f12c94da8d161879e72361a2235c5e04aa9c7fadc74971e
|
data/LICENSE.txt
CHANGED
data/lib/capistrano/cron/job.rb
CHANGED
@@ -31,7 +31,7 @@ class Capistrano::Cron
|
|
31
31
|
|
32
32
|
def process_template(template, options)
|
33
33
|
template.gsub(/:\w+/) do |key|
|
34
|
-
before_and_after = [$`[-1
|
34
|
+
before_and_after = [$`[-1..], $'[0..0]]
|
35
35
|
option = options[key.sub(":", "").to_sym] || key
|
36
36
|
|
37
37
|
if before_and_after.all? { |c| c == "'" }
|
@@ -45,7 +45,7 @@ class Capistrano::Cron
|
|
45
45
|
@set_variables.has_key?(name) ? @set_variables[name] : super
|
46
46
|
end
|
47
47
|
|
48
|
-
def
|
48
|
+
def respond_to_missing?(name, include_private = false)
|
49
49
|
@set_variables.has_key?(name) || super
|
50
50
|
end
|
51
51
|
|
@@ -128,10 +128,10 @@ class Capistrano::Cron
|
|
128
128
|
0.upto(4) do |f|
|
129
129
|
(entries.length - 1).downto(1) do |i|
|
130
130
|
next if entries[i][f] == "*"
|
131
|
-
comparison = entries[i][0...f] + entries[i][f + 1
|
131
|
+
comparison = entries[i][0...f] + entries[i][f + 1..]
|
132
132
|
(i - 1).downto(0) do |j|
|
133
133
|
next if entries[j][f] == "*"
|
134
|
-
if comparison == entries[j][0...f] + entries[j][f + 1
|
134
|
+
if comparison == entries[j][0...f] + entries[j][f + 1..]
|
135
135
|
entries[j][f] += "," + entries[i][f]
|
136
136
|
entries.delete_at(i)
|
137
137
|
break
|
@@ -20,7 +20,7 @@ class Capistrano::Cron
|
|
20
20
|
end
|
21
21
|
|
22
22
|
def self.enumerate(item, detect_cron = true)
|
23
|
-
if item
|
23
|
+
if item&.is_a?(String)
|
24
24
|
items =
|
25
25
|
if detect_cron && item =~ REGEX
|
26
26
|
[item]
|
@@ -29,7 +29,7 @@ class Capistrano::Cron
|
|
29
29
|
end
|
30
30
|
else
|
31
31
|
items = item
|
32
|
-
items = [items] unless items
|
32
|
+
items = [items] unless items&.respond_to?(:each)
|
33
33
|
end
|
34
34
|
items
|
35
35
|
end
|
data/lib/capistrano/cron.rb
CHANGED
@@ -4,8 +4,6 @@ require "capistrano/plugin"
|
|
4
4
|
|
5
5
|
module Capistrano
|
6
6
|
class Cron < Capistrano::Plugin
|
7
|
-
VERSION = "0.1.1"
|
8
|
-
|
9
7
|
def set_defaults
|
10
8
|
set_if_empty :cron_roles, %w[db]
|
11
9
|
set_if_empty :cron_identifier, -> { "#{fetch(:application)}_#{fetch(:stage)}" }
|
@@ -43,7 +41,7 @@ module Capistrano
|
|
43
41
|
# Strip n lines from the top of the file as specified by the :cut option.
|
44
42
|
# Use split with a -1 limit option to ensure the join is able to rebuild
|
45
43
|
# the file with all of the original seperators in-tact.
|
46
|
-
stripped_contents = contents.split($/, -1)
|
44
|
+
stripped_contents = contents.split($/, -1).join($/)
|
47
45
|
|
48
46
|
# Some cron implementations require all non-comment lines to be newline-
|
49
47
|
# terminated. (issue #95) Strip all newlines and replace with the default
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capistrano-cron
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Codeur SAS
|
@@ -59,6 +59,7 @@ files:
|
|
59
59
|
- lib/capistrano/cron/output/cron.rb
|
60
60
|
- lib/capistrano/cron/output/redirection.rb
|
61
61
|
- lib/capistrano/cron/setup.rb
|
62
|
+
- lib/capistrano/cron/version.rb
|
62
63
|
- lib/capistrano/tasks/cron.rake
|
63
64
|
homepage: https://github.com/codeur/capistrano-cron
|
64
65
|
licenses:
|