headcount 0.7.0 → 0.7.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.
- data/Gemfile.lock +1 -1
- data/README.md +22 -2
- data/lib/headcount/version.rb +1 -1
- data/lib/tasks/headcount_tasks.rake +3 -1
- metadata +2 -2
data/Gemfile.lock
CHANGED
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/)
|
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)
|
data/lib/headcount/version.rb
CHANGED
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: headcount
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.7.
|
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-
|
13
|
+
date: 2012-04-08 00:00:00 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rails
|