headcount 0.7.0 → 0.7.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- headcount (0.6.0)
4
+ headcount (0.7.0)
5
5
  rails (~> 3.2.2)
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -77,15 +77,35 @@ Headcount.seed!(2.years.ago, 1.day) # WARNING: this will overwrite any existing
77
77
 
78
78
  ## Scheduling
79
79
 
80
- Your options are open as far as scheduling goes. If you like [crontab](http://crontab.org/), use crontab. If you prefer [clockwork](https://github.com/tomykaira/clockwork), use clockwork.
80
+ Your options are open as far as scheduling goes. If you like crontab, use [crontab](http://crontab.org/) or [whenever](https://github.com/javan/whenever). If you prefer something else, give [clockwork](https://github.com/tomykaira/clockwork) a shot.
81
81
 
82
82
  You have two options for triggering a headcount.
83
83
 
84
84
  1. Call it directly: `Headcount.count!`
85
- 2. Use the rake task: `rake headcount`
85
+ 2. Use the rake task: `rake headcount` (executes headcount via `script/rails runner`)
86
86
 
87
87
  In the future I may write a daemon to simplify the scheduling process with an upstart script to boot, but for now you're on your own.
88
88
 
89
+ ### Crontab example
90
+
91
+ ```
92
+ # run daily at midnight
93
+ 0 0 * * * bash --login -c 'cd [YOUR RAILS APP DIR] && script/rails runner -e production "Headcount.count!"'
94
+ ```
95
+
96
+ ### Whenever example
97
+
98
+ ```
99
+ # schedule.rb
100
+ every 1.day do
101
+ runner "Headcount.count!"
102
+ end
103
+ ```
104
+
105
+ ### Clockwork example
106
+
107
+ TODO
108
+
89
109
  # Credit
90
110
 
91
111
  Headcount was created for use at Kumu (http://kumupowered.com)
@@ -1,3 +1,3 @@
1
1
  module Headcount
2
- VERSION = "0.7.0"
2
+ VERSION = "0.7.1"
3
3
  end
@@ -1,4 +1,6 @@
1
+ RAILS_ENV ||= 'development'
2
+
1
3
  desc "Takes a headcount"
2
4
  task :headcount do
3
- Headcount.count!
5
+ sh "script/rails runner -e #{RAILS_ENV} \"Headcount.count!\""
4
6
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: headcount
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.7.0
5
+ version: 0.7.1
6
6
  platform: ruby
7
7
  authors:
8
8
  - Ryan Mohr
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2012-04-07 00:00:00 Z
13
+ date: 2012-04-08 00:00:00 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rails