ruby-clock 2.0.0.beta4 → 2.0.0.beta5

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: 8900519602f68a1eb7e0a5b49aa1752c5a42ffb65a16b409b8f12c003237c568
4
- data.tar.gz: bb9d30d35bafa38b970f061faa0416bffb66197f5fddd5d46a691c05e04fe82b
3
+ metadata.gz: 4030e34d3273a3b96cabaa879b0d52965ff35e9ad13afebcb8932b9244512836
4
+ data.tar.gz: dd6b624f190797e3daa9e1481ed27e1347d56df0df4a76a7e3855890eff51ef1
5
5
  SHA512:
6
- metadata.gz: 50482fd2178c9098bd8e2eb1218f56c56596d5983d82571246d5516cd977227a344598f056019027f2b97222ffc8a628eed503ed2d10defea116bfe5d6b953f1
7
- data.tar.gz: 5eb78d5f6dffb1d09d09e9d1ada59a0bae9646253f789affec38311237b74b937192b1f7a414b2a5ff3e8fc2b34a3beb6fe1e8fda8a6aeffedfac80941e8a5a5
6
+ metadata.gz: 052a4b986dc7ad4665b446ec5adb2c371aaddc4e503696b6127a977357ea2c3d6c9cd3e3a28b4cca4c8e90cfc0c3cae5c311d55c16f8d7ba11c0d130f7b2c4a2
7
+ data.tar.gz: 43eab7d34b9259380a9c5939fbca53d98cf17dcaa89ab10f9d57343f64fea9dccdd495554d144fef3929f48d561eb327d652e170476be184ea80de96c8d06bf1
data/CHANGELOG.md CHANGED
@@ -24,8 +24,7 @@
24
24
  * The top of every Clockfile must begin with `using RubyClock::DSL`
25
25
  * rake and shell runners must be invoked like so: `RubyClock::Runners.rake`, `RubyClock::Runners.shell`, etc.
26
26
  * If you have an existing `def schedule.around_trigger`, you will need to change it to use the new
27
- `around_action` method. Failure to change this will silently appear to keep working,
28
- but will break the rails reloader/executor implementation.
27
+ `around_action` method.
29
28
  * Your existing Clockfile will still work, but you now have the option to use
30
29
  `every`, `cron`, and `on_error` at the top-level, without referencing `schedule`.
31
30
  See the readme for examples.
@@ -52,3 +52,7 @@ every('2 seconds') do
52
52
  puts "💥 we do not expect runners to be available inside a job, but it is"
53
53
  end
54
54
  end
55
+
56
+ # def schedule.around_trigger(job_info, &job_proc)
57
+ # puts "ruby-clock 1-style around trigger!"
58
+ # end
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- ruby-clock (2.0.0.beta4)
4
+ ruby-clock (2.0.0.beta5)
5
5
  method_source
6
6
  rufus-scheduler (~> 3.8)
7
7
 
data/exe/clock CHANGED
@@ -18,5 +18,6 @@ rescue => clockfile_error
18
18
  raise
19
19
  end
20
20
 
21
+ RubyClock.instance.ensure_around_trigger_has_not_been_redefined
21
22
  RubyClock.instance.freeze_around_actions
22
23
  RubyClock.instance.run_jobs
@@ -15,6 +15,19 @@ module RubyClock::AroundActions
15
15
  job_info
16
16
  )
17
17
  end
18
+
19
+ self.around_trigger_code_location = schedule.method(:around_trigger).source_location
20
+ end
21
+
22
+ def ensure_around_trigger_has_not_been_redefined
23
+ if around_trigger_code_location != schedule.method(:around_trigger).source_location
24
+ raise <<~MESSAGE
25
+
26
+ You need to change your around_trigger definition to use around_actions instead.
27
+
28
+ It's easy and fun! https://github.com/jjb/ruby-clock/blob/main/CHANGELOG.md#migrating-from-ruby-clock-version-1-to-version-2
29
+ MESSAGE
30
+ end
18
31
  end
19
32
 
20
33
  def call_with_around_action_stack(wrappers, job_proc, job_info)
@@ -1,3 +1,3 @@
1
1
  class RubyClock
2
- VERSION = "2.0.0.beta4"
2
+ VERSION = "2.0.0.beta5"
3
3
  end
data/lib/ruby-clock.rb CHANGED
@@ -17,7 +17,7 @@ class RubyClock
17
17
  include RubyClock::Shell
18
18
  include RubyClock::AroundActions
19
19
 
20
- attr_accessor :on_error
20
+ attr_accessor :on_error, :around_trigger_code_location
21
21
 
22
22
  def initialize
23
23
  set_up_around_actions
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-clock
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0.beta4
4
+ version: 2.0.0.beta5
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Bachir