totalizer 0.1.2 → 0.1.3
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.
- checksums.yaml +4 -4
- data/README.md +16 -0
- data/lib/tasks/totalizer.rake +6 -1
- data/lib/totalizer/base.rb +8 -0
- data/lib/totalizer/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7e2ecb903857aa2c383d1cbf1b73faa7fbde1849
|
4
|
+
data.tar.gz: cb093ae0bbe5957961644821b9c21f492a9cabc8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2e532b1f38e433cc55a514e9731bdc93e14fb4667d0a8ee5e8f1f82f7932d392c55efe697ece238b000c86e4f845231ba6f95ccf3d631a8819ff06f614f4c585
|
7
|
+
data.tar.gz: 35f353bfe7d244f7aafdb36f90c6e04c2350eeaca5d0a8276ead0cb3d204dcc8ea16a6df2cf60ac983357f0a00488d0145ac47cb969997866770af18f309b9fc
|
data/README.md
CHANGED
@@ -179,6 +179,22 @@ Churn
|
|
179
179
|
Last 30 days: 3.29% (34/1032)
|
180
180
|
```
|
181
181
|
|
182
|
+
### Combined
|
183
|
+
|
184
|
+
You can also run a single rake task every day which will run execute the daily
|
185
|
+
task each time and execute the weekly task on a defined week day which by
|
186
|
+
default is Monday.
|
187
|
+
|
188
|
+
```
|
189
|
+
$ rake totalizer:combined
|
190
|
+
```
|
191
|
+
|
192
|
+
To change the week day add the following line to your initializer:
|
193
|
+
|
194
|
+
```ruby
|
195
|
+
Totalizer.weekly_day = 0 #(0-6, Sunday is zero)
|
196
|
+
```
|
197
|
+
|
182
198
|
***
|
183
199
|
|
184
200
|
In addition to Metric, you can also use the following underlying objects.
|
data/lib/tasks/totalizer.rake
CHANGED
@@ -14,7 +14,7 @@ namespace :totalizer do
|
|
14
14
|
end
|
15
15
|
|
16
16
|
task weekly: :validate do
|
17
|
-
Totalizer.logger.info "Totalizer:
|
17
|
+
Totalizer.logger.info "Totalizer: Weekly"
|
18
18
|
messages = {
|
19
19
|
activation: [Totalizer.generate(:activation, 7), Totalizer.generate(:activation, 30)],
|
20
20
|
engagement: [Totalizer.generate(:engagement, 7), Totalizer.generate(:engagement, 30)],
|
@@ -23,4 +23,9 @@ namespace :totalizer do
|
|
23
23
|
}
|
24
24
|
Totalizer.notify messages
|
25
25
|
end
|
26
|
+
|
27
|
+
task combined: :validate do
|
28
|
+
Rake::Task["daily"].invoke
|
29
|
+
Rake::Task["weekly"].invoke if DateTime.now.wday == Totalizer.weekly_day
|
30
|
+
end
|
26
31
|
end
|
data/lib/totalizer/base.rb
CHANGED
data/lib/totalizer/version.rb
CHANGED