capistrano-cron 0.1.1 → 0.1.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 447afb4c20df962551203cba39d6235a017ad9169c6c56fb0f9a918af76dc459
4
- data.tar.gz: dc69b86c4b21c1160fba0c6ea1bf66f3ee8a171c9330f8f0cdb3018bdc592117
3
+ metadata.gz: 60b25f701480e517d7520903b802f80f272289e48331e87e6a9e933dbd11b964
4
+ data.tar.gz: 971a3a1fb90f42ea9c401957fc538368edfb4aeedb52821e3b7736d4651844d8
5
5
  SHA512:
6
- metadata.gz: d718d0a1d253cfde958f26dad75d3966a957196de929be7029e596eb5d6d017eb67506f5b7d4c667eb10caffac535f25e4cf152ce227de6ed27023bc8293fa9c
7
- data.tar.gz: 660b04970da9c6a3b3bbe0810a7b2a093ca9c06b427bca3ba866a226cf2df06d5775ec60be16738efa7049ef05d44750fbc78ce5b3d56019d03be27624b0baa7
6
+ metadata.gz: 20038c5d0cc153c391f8cc3ab40ddfa03e158e95c0b2edc6a69dbc4b5e6c3eef0d2e7a1ac11002aa58437cc8bdbbfcd8897fb751fd0760e9620c8671309d764c
7
+ data.tar.gz: 4986f10b45647300d4bfb0dcd1742169206b88853745a8d44d325176e6774ed9a328b1d92ab64d431f12c94da8d161879e72361a2235c5e04aa9c7fadc74971e
data/LICENSE.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2024 Brice TEXIER
3
+ Copyright (c) 2024 Codeur SAS
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -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..-1], $'[0..0]]
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 self.respond_to?(name, include_private = false)
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..-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..-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
@@ -48,7 +48,7 @@ class Capistrano::Cron
48
48
  end
49
49
 
50
50
  Numeric.class_eval do
51
- def respond_to?(method, include_private = false)
51
+ def respond_to_missing?(method, include_private = false)
52
52
  super || Capistrano::Cron::NumericSeconds.public_method_defined?(method)
53
53
  end
54
54
 
@@ -20,7 +20,7 @@ class Capistrano::Cron
20
20
  end
21
21
 
22
22
  def self.enumerate(item, detect_cron = true)
23
- if item and item.is_a?(String)
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 and items.respond_to?(:each)
32
+ items = [items] unless items&.respond_to?(:each)
33
33
  end
34
34
  items
35
35
  end
@@ -0,0 +1,5 @@
1
+ module Capistrano
2
+ class Cron
3
+ VERSION = "0.1.2"
4
+ end
5
+ end
@@ -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)[0..-1].join($/)
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.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: