day_planner 0.1.0.pre17 → 0.1.0.pre18
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 54e7c7defa992590f7a9b23bace79f15a9932957
|
4
|
+
data.tar.gz: fed59fdc0ca7b46285c0c866b1385478af633135
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a3cb492de98bb9ab46479c2bff385a436555c79a645e2c6a047458d418dea65af7e8371ca8b64fd49610a17ef6bee5b049963676ebacd8a04583119511e609c8
|
7
|
+
data.tar.gz: d70c9739ba2ec643cfc8958cfe0d8d9e9787e3bda1b980c66692c1d045fd1e905ee15f9005603a16cd0474f48c1ee1d65cac16e47e9f77aca9bc30b32979f010
|
data/README.md
CHANGED
@@ -73,6 +73,15 @@ Note that if you try to schedule a task with an interval shorter than DayPlanner
|
|
73
73
|
|
74
74
|
Specify your preferred interval (and whatever other settings which may be implemented one day) in config/scheduled_tasks.rb. As long as you set your interval before DayPlanner is activated, you won't have to wait for it to cycle through an interval to change the setting. If you alter this value while DayPlanner is already running, it won't take effect until the current interval ends.
|
75
75
|
|
76
|
+
### Logging
|
77
|
+
|
78
|
+
If you'd like to log your tasks, go for it. Add logging thusly:
|
79
|
+
|
80
|
+
rails generate day_planner:log
|
81
|
+
rake db:migrate
|
82
|
+
|
83
|
+
This just adds an extra table entitled 'day_planner_log'. As long as the table's there, it'll log each task execution, as well as every instance in which DayPlanner activates. Clear the log as the spirit takes you. Do what you do best.
|
84
|
+
|
76
85
|
## Contributing
|
77
86
|
|
78
87
|
1. Fork it
|
@@ -21,9 +21,14 @@ module DayPlanner
|
|
21
21
|
task = DayPlanner::Task.create(fields)
|
22
22
|
end
|
23
23
|
|
24
|
-
def log
|
24
|
+
def log(last, now)
|
25
25
|
if ActiveRecord::Base.connection.table_exists?('day_planner_log')
|
26
|
-
|
26
|
+
if now < last + interval
|
27
|
+
early = last + interval - now
|
28
|
+
else
|
29
|
+
early = nil
|
30
|
+
end
|
31
|
+
DayPlanner::Log.create(name: name, interval: interval, datetime: Time.now, early: early)
|
27
32
|
end
|
28
33
|
end
|
29
34
|
|
data/lib/day_planner/base.rb
CHANGED
data/lib/day_planner/version.rb
CHANGED