rufus-scheduler 3.9.0 → 3.9.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ec5b405be33c70ef390f2d8c47be112c7cf05c32eda58a0a764bbf42fae1b5d6
4
- data.tar.gz: c03f4dc830c7041a530d899d69d91f7409ba481bbd12241152543b0eae20fc23
3
+ metadata.gz: 256656e17e60670dad5d075427c1b3b4326f6f5dac5f232107520c12ea5f32c7
4
+ data.tar.gz: 6d04177caae292158791d02e095b184bf6f2f888157ef6de1345f5841ed4a94f
5
5
  SHA512:
6
- metadata.gz: e5d992e7ad0a23530320731348c3c890b90d0184851d7faf807a36e4c6dd5d879579a478478055beab569e14603f129a7ad15022f2bf6b297a3e9f27cb31fb4c
7
- data.tar.gz: 85be36f54b76add7704907a3a7d43339a392d49fc05e03b62dc28e20a88eeb03cd132f64e1f3a1378f2e6e3128d57fb7fa4fe6f6ccd89fdd8b1d24fe93312583
6
+ metadata.gz: a8ebf970f2b6bc1d08202a8aa889fa00825ca086d8fb94d696b56703451af5591ac84111a512c9ede9ac54132f4ea73b59480746b005b093371de3284f82df0c
7
+ data.tar.gz: 0f811b3323c837bbe07f59d6988c92a911e0dfc1c8bd93da877a432ede76abbe5a0da724fd67ed3279ebba480d34a7e2b01b904d7946c8a5375e1929b65a2f35
data/CHANGELOG.md CHANGED
@@ -2,6 +2,16 @@
2
2
  # CHANGELOG.md
3
3
 
4
4
 
5
+ ### rufus-scheduler 3.9.2 - released 2024-09-04
6
+
7
+ * For fugit >= 1.11.1
8
+
9
+
10
+ ### rufus-scheduler 3.9.1 - released 2023-06-09
11
+
12
+ * Introduce :first_at_no_error option, austinarbor gh-342
13
+
14
+
5
15
  ### rufus-scheduler 3.9.0 - released 2023-06-02
6
16
 
7
17
  * Add note about Chronic and "Wed at 2pm", gh-340
data/CREDITS.md CHANGED
@@ -4,6 +4,8 @@
4
4
 
5
5
  ## Contributors
6
6
 
7
+ * Geremia Taglialatela, https://github.com/tagliala, mfa opt-in gh-347
8
+ * Austin Arbor https://github.com/austinarbor gh-342 first_at_error
7
9
  * Bence Monus https://github.com/cromega gh-337 on_error and friends
8
10
  * Talia Wong https://github.com/blowfishpro gh-335 on_error and friends
9
11
  * Konstantin https://github.com/fa11enangel gh-334 nodejitsu link
@@ -72,6 +74,7 @@
72
74
 
73
75
  ## Feedback
74
76
 
77
+ * jasonwbarnett (https://github.com/jaswonwbarnett) past time jobs, gh-339
75
78
  * aphel (https://github.com/itsaphel) #shutdown vs current thread, gh-304
76
79
  * aesyondu (https://github.com/aesyondu) Rails console 4.2.x, gh-186
77
80
  * Sasha Hoellger (https://github.com/mitnal) parse_cron and readme, gh-270
data/README.md CHANGED
@@ -72,17 +72,22 @@ It does not persist your schedules. When the process is gone and the scheduler i
72
72
 
73
73
  A rufus-scheduler instance will go on scheduling while it is present among the objects in a Ruby process. To make it stop scheduling you have to call its [`#shutdown` method](#schedulershutdown).
74
74
 
75
+ Please note: rufus-scheduler is not a cron replacement.
75
76
 
76
- ## related and similar gems
77
77
 
78
- * [Whenever](https://github.com/javan/whenever) - let cron call back your Ruby code, trusted and reliable cron drives your schedule
78
+ ## related gems
79
+
79
80
  * [ruby-clock](https://github.com/jjb/ruby-clock) - a clock process / job scheduler for Ruby
81
+ * [Puma-Rufus-Scheduler](https://github.com/javierav/puma-rufus-scheduler) - Puma plugin to run Rufus-Scheduler
82
+
83
+
84
+ ## similar gems
85
+
86
+ * [Whenever](https://github.com/javan/whenever) - let cron call back your Ruby code, trusted and reliable cron drives your schedule
80
87
  * [Clockwork](https://github.com/Rykian/clockwork) - rufus-scheduler inspired gem
81
88
  * [Crono](https://github.com/plashchynski/crono) - an in-Rails cron scheduler
82
89
  * [PerfectSched](https://github.com/treasure-data/perfectsched) - highly available distributed cron built on [Sequel](https://sequel.jeremyevans.net) and more
83
90
 
84
- (please note: rufus-scheduler is not a cron replacement)
85
-
86
91
 
87
92
  ## note about the 3.0 line
88
93
 
@@ -515,6 +520,18 @@ that'll output something like:
515
520
  ...
516
521
  ```
517
522
 
523
+ ### :first_at_no_error
524
+
525
+ In some heavy-duty configurations, the `:first_at` setting might be set on a point of time before the actual scheduling/triggering occurs and will result in an error `"cannot set first[_at|_in] in the past..."`. To prevent that, the `:first_at_no_error` option may be set to true.
526
+
527
+ ```ruby
528
+ scheduler.every '10h', first_at: Time.now + 10, first_at_no_error: true do
529
+ # ...
530
+ end
531
+ ```
532
+
533
+ As introduced in [gh-342](https://github.com/jmettraux/rufus-scheduler/pull/342).
534
+
518
535
  ### :last_at, :last_in, :last
519
536
 
520
537
  This option is for repeat jobs (cron / every) only.
@@ -1449,7 +1466,7 @@ The #confirm_lock method is called right before a job triggers (if it is provide
1449
1466
 
1450
1467
  (introduced in rufus-scheduler 3.0.9).
1451
1468
 
1452
- Another way of prodiving `#lock`, `#unlock` and `#confirm_lock` to a rufus-scheduler is by using the `:scheduler_lock` and `:trigger_lock` options.
1469
+ Another way of providing `#lock`, `#unlock` and `#confirm_lock` to a rufus-scheduler is by using the `:scheduler_lock` and `:trigger_lock` options.
1453
1470
 
1454
1471
  See [:trigger_lock](#trigger_lock) and [:scheduler_lock](#scheduler_lock).
1455
1472
 
@@ -1646,6 +1663,26 @@ require 'tzinfo/data'
1646
1663
  require 'rufus-scheduler'
1647
1664
  ```
1648
1665
 
1666
+ ### Timezone in the schedule thread
1667
+
1668
+ Currently (3.9.x), rufus-scheduler strives to trigger at the right time. The trigger thread might not yield a `Time.now` in the scheduled timezone.
1669
+
1670
+ ```ruby
1671
+ ENV['TZ'] = 'Asia/Tokyo'
1672
+
1673
+ require 'rufus-scheduler'
1674
+
1675
+ s = Rufus::Scheduler.new
1676
+
1677
+ s.cron('*/5 * * * * * Europe/Rome') do
1678
+ p Time.now # ==> the representation will indicate the time is UTC+0900...
1679
+ end
1680
+
1681
+ s.join
1682
+ ```
1683
+
1684
+ In the wake of [gh-341](https://github.com/jmettraux/rufus-scheduler/issues/341).
1685
+
1649
1686
 
1650
1687
  ## so Rails?
1651
1688
 
@@ -1747,7 +1784,7 @@ If, anyway, you need something like `rails server -d`, why not try `bundle exec
1747
1784
 
1748
1785
  ### executor / reloader
1749
1786
 
1750
- You might benefit from wraping your scheduled code in the executor or reloader. Read more here: https://guides.rubyonrails.org/threading_and_code_execution.html
1787
+ You might benefit from wrapping your scheduled code in the executor or reloader. Read more here: https://guides.rubyonrails.org/threading_and_code_execution.html
1751
1788
 
1752
1789
  ## support
1753
1790
 
@@ -15,6 +15,8 @@ class Rufus::Scheduler::RepeatJob < Rufus::Scheduler::Job
15
15
 
16
16
  @times = opts[:times]
17
17
 
18
+ @first_at_no_error = opts[:first_at_no_error] || false
19
+
18
20
  fail ArgumentError.new(
19
21
  "cannot accept :times => #{@times.inspect}, not nil or an int"
20
22
  ) unless @times == nil || @times.is_a?(Integer)
@@ -43,6 +45,7 @@ class Rufus::Scheduler::RepeatJob < Rufus::Scheduler::Job
43
45
 
44
46
  @first_at = (fdur && (EoTime.now + fdur)) || EoTime.make(first)
45
47
  @first_at = n1 if @first_at >= n0 && @first_at < n1
48
+ @first_at = n0 if @first_at < n0 && @first_at_no_error
46
49
 
47
50
  fail ArgumentError.new(
48
51
  "cannot set first[_at|_in] in the past: " +
@@ -319,4 +322,3 @@ class Rufus::Scheduler::CronJob < Rufus::Scheduler::RepeatJob
319
322
  end
320
323
  end
321
324
  end
322
-
@@ -9,7 +9,7 @@ module Rufus; end
9
9
 
10
10
  class Rufus::Scheduler
11
11
 
12
- VERSION = '3.9.0'
12
+ VERSION = '3.9.2'
13
13
 
14
14
  EoTime = ::EtOrbi::EoTime
15
15
 
@@ -26,12 +26,12 @@ Job scheduler for Ruby (at, cron, in and every jobs). Not a replacement for cron
26
26
  #'wiki_uri' => s.homepage + '/flor/wiki',
27
27
  #'documentation_uri' => s.homepage + '/tree/master/doc',
28
28
  #'mailing_list_uri' => 'https://groups.google.com/forum/#!forum/floraison',
29
+ 'rubygems_mfa_required' => 'true',
29
30
  }
30
31
 
31
32
  #s.files = `git ls-files`.split("\n")
32
33
  s.files = Dir[
33
- 'README.{md,txt}',
34
- 'CHANGELOG.{md,txt}', 'CREDITS.{md,txt}', 'LICENSE.{md,txt}',
34
+ '{README,CHANGELOG,CREDITS,LICENSE}.{md,txt}',
35
35
  'Makefile',
36
36
  'lib/**/*.rb', #'spec/**/*.rb', 'test/**/*.rb',
37
37
  "#{s.name}.gemspec",
@@ -39,7 +39,7 @@ Job scheduler for Ruby (at, cron, in and every jobs). Not a replacement for cron
39
39
 
40
40
  s.required_ruby_version = '>= 1.9'
41
41
 
42
- s.add_runtime_dependency 'fugit', '~> 1.1', '>= 1.1.6'
42
+ s.add_runtime_dependency 'fugit', '~> 1.1', '>= 1.11.1'
43
43
 
44
44
  s.add_development_dependency 'rspec', '~> 3.7'
45
45
  s.add_development_dependency 'chronic', '~> 0.10'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rufus-scheduler
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.9.0
4
+ version: 3.9.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Mettraux
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-06-02 00:00:00.000000000 Z
11
+ date: 2024-09-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fugit
@@ -19,7 +19,7 @@ dependencies:
19
19
  version: '1.1'
20
20
  - - ">="
21
21
  - !ruby/object:Gem::Version
22
- version: 1.1.6
22
+ version: 1.11.1
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
@@ -29,7 +29,7 @@ dependencies:
29
29
  version: '1.1'
30
30
  - - ">="
31
31
  - !ruby/object:Gem::Version
32
- version: 1.1.6
32
+ version: 1.11.1
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: rspec
35
35
  requirement: !ruby/object:Gem::Requirement
@@ -88,6 +88,7 @@ metadata:
88
88
  bug_tracker_uri: https://github.com/jmettraux/rufus-scheduler/issues
89
89
  homepage_uri: https://github.com/jmettraux/rufus-scheduler
90
90
  source_code_uri: https://github.com/jmettraux/rufus-scheduler
91
+ rubygems_mfa_required: 'true'
91
92
  post_install_message:
92
93
  rdoc_options: []
93
94
  require_paths:
@@ -103,7 +104,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
103
104
  - !ruby/object:Gem::Version
104
105
  version: '0'
105
106
  requirements: []
106
- rubygems_version: 3.2.33
107
+ rubygems_version: 3.4.19
107
108
  signing_key:
108
109
  specification_version: 4
109
110
  summary: job scheduler for Ruby (at, cron, in and every jobs)