cron_helper 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 372b20bb27ec6bdf2c9a13d0e32aae2316900bd0
4
- data.tar.gz: 8473dd142f60526c66b2068c7125b2e0693fcef9
3
+ metadata.gz: 5ad71ac9b1e0eba052393b6d409d93fa2897c4c2
4
+ data.tar.gz: 9c54b7da97fb794a2945c33d6da3c5efb3d93ea5
5
5
  SHA512:
6
- metadata.gz: d470faf4c791ad0a5f413a83bb1fec8f25c61e8a7503700053e3f3c112fed7211991d2d9339f31623b12743f8d42765e35592fd9f3d7b99cc7563a7ea6a0892c
7
- data.tar.gz: ecbf6a555d6e9c4d7c9bc1b81c39dfee08ec302ef8ba81fc0de3a5566d9589da2b4a425c0beec3d85916b3d4e8ba470dfd0b9e27ab3ad643c94905498ecaa69b
6
+ metadata.gz: af20cfff02647a8ac93cf66cc40856a674359d9645fc346a21fe88d10c2f5658652c1de9e2c7305782f31f6afebd88916e5d07be24e10c6c9931f6cd08b55762
7
+ data.tar.gz: 310249043eeb0ea50df02be23871c3d4c453dd236f22bde9205e45ca021f5ee10b9ea4e853dd6aad59c4d61c747efbe9af375b20895b44c839b881a754116af9
data/README.md CHANGED
@@ -61,7 +61,7 @@ class HourlyJob < ApplicationJob
61
61
  end
62
62
  end
63
63
  ```
64
- Finally you will schedule your jobs using the [Whenever](https://github.com/javan/whenever]) gem.
64
+ Finally you will schedule your jobs using the [Whenever](https://github.com/javan/whenever) gem.
65
65
  Below is an example config/schedule.rb that also forces your jobs to run at a low priority.
66
66
  Running jobs at a low priority is recommended when your server has other roles (web, app, db, etc).
67
67
 
@@ -69,7 +69,7 @@ Running jobs at a low priority is recommended when your server has other roles (
69
69
  job_type :runner, "cd :path && nice -n 20 script/rails runner -e :environment ':task' :output"
70
70
 
71
71
  every 1.hour do
72
- runner('Cron::Hourly.new.run')
72
+ runner('HourlyJob.new.run')
73
73
  end
74
74
  ```
75
75
 
@@ -79,6 +79,19 @@ Tasks are guaranteed to run in the order you register them.
79
79
  They are also guaranteed to run even if a previous task encountered an exception.
80
80
  This gives you control over creating new tasks without having to worry about breaking old ones.
81
81
 
82
+ ## Customization
83
+ You can customize where stdout/stderr are sent to by overriding the ````output_handler```` method.
84
+ Normally you will want to put this in ```ApplicationJob```.
85
+
86
+ ```ruby
87
+ class ApplicationJob < CronHelper::Job
88
+ private
89
+ output_handler(output)
90
+ # Log the output to your custom destination (email, DB, SMS alerts, etc).
91
+ end
92
+ end
93
+ ```
94
+
82
95
  ## Development
83
96
 
84
97
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
@@ -40,7 +40,7 @@ module CronHelper
40
40
  private
41
41
 
42
42
  def output_handler(output)
43
- puts output
43
+ puts output if output.length > 0
44
44
  end
45
45
 
46
46
  def cron_methods
@@ -1,3 +1,3 @@
1
1
  module CronHelper
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cron_helper
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
  - Chad Remesch
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-01-13 00:00:00.000000000 Z
11
+ date: 2016-01-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler