foreman-tasks 8.0.0 → 8.0.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 963f9bf0926c9f8a71b9aef3ace2e25e2b156210c3e4c7567e4282c44eb5632b
4
- data.tar.gz: 8b5596eab3ccc039c32f9a23278b54f526aac63546e546f8965314b80afcc7be
3
+ metadata.gz: c20057a80b1bb1d9bed71d8363714629ca6daeb5f7fab04a101096733e1af031
4
+ data.tar.gz: 3e8b4ac765c89c95961f2bb9bf62aa2fb5a957a0422b300523457d41f9514973
5
5
  SHA512:
6
- metadata.gz: 48072148a700c91b935f54983371ad5d47d31ead77429def7acde35e847e3a94c31a3d76930aa5540e8e00563285ae611c37c3a58d2a23b3eef5ee8de3d621fb
7
- data.tar.gz: 11861d32d797ecf6c1c44f2374cb81758d93c838f546014160c55d4f6d0606de69a5cb06e538d9c65cfd266838f1b976c2404ba1267d0fb07504ef9d9868feff
6
+ metadata.gz: 0dfabca75eaa8a0a1ac0cb2fab181643f8485095499b64b75f4d4bcdfec05497e97d436c83f0883ec8a95bf458a9f38e7459243f24e72c905dc114055f108831
7
+ data.tar.gz: 119368e5d1f23cac73a2ddccf37d5157113d4674bd7da1a61320195c8112d4321f15856a7d06580bbef032c2035c00cfef8732bfb5fcd09f400a5ce4e5cffde7
@@ -96,7 +96,7 @@ module ForemanTasks
96
96
  end
97
97
 
98
98
  def next_occurrence_time(time = Time.zone.now)
99
- @parser ||= Fugit.parse_cron(cron_line)
99
+ @parser ||= Fugit.do_parse_cron(cron_line)
100
100
  # @parser.next(start_time) is not inclusive of the start_time hence stepping back one run to include checking start_time for the first run.
101
101
  before_next = @parser.next_time(@parser.previous_time(time.iso8601))
102
102
  return before_next.utc.localtime if before_next >= time && tasks.count == 0
@@ -1,3 +1,3 @@
1
1
  module ForemanTasks
2
- VERSION = '8.0.0'.freeze
2
+ VERSION = '8.0.1'.freeze
3
3
  end
@@ -54,6 +54,17 @@ class RecurringLogicsTest < ActiveSupport::TestCase
54
54
  _(ForemanTasks::RecurringLogic.cronline_hash(:monthly, time_hash, days, days_of_week)).must_equal expected_result_monthly
55
55
  end
56
56
 
57
+ it 'validates cronline correctly' do
58
+ recurring_logic = ::ForemanTasks::RecurringLogic.new_from_cronline('* * * * abc')
59
+ assert_not recurring_logic.valid_cronline?
60
+ recurring_logic = ::ForemanTasks::RecurringLogic.new_from_cronline(nil)
61
+ assert_not recurring_logic.valid_cronline?
62
+ recurring_logic = ::ForemanTasks::RecurringLogic.new_from_cronline('* * * * *')
63
+ assert recurring_logic.valid_cronline?
64
+ recurring_logic = ::ForemanTasks::RecurringLogic.new_from_cronline('0 22 * * mon-fri')
65
+ assert recurring_logic.valid_cronline?
66
+ end
67
+
57
68
  it 'can have limited number of repeats' do
58
69
  parser = ForemanTasks::RecurringLogic.new_from_cronline('* * * * *')
59
70
  parser.state = 'active'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman-tasks
3
3
  version: !ruby/object:Gem::Version
4
- version: 8.0.0
4
+ version: 8.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ivan Nečas