day_planner 0.0.2 → 0.0.3

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: 10c9508c60413ef45066187c3d30195fdba6558d
4
- data.tar.gz: c1906fc7b52276c336a8c5d2574e163ed27867e1
3
+ metadata.gz: 8e3db46fdb6f0e4d44bbb8cf35cc3a79e5a70591
4
+ data.tar.gz: 67ed162a83dc83baa7715518d81744a0102d7d73
5
5
  SHA512:
6
- metadata.gz: 73afb8d383eed1ffc5068d862150b7072765095e438321f9922f3f79fb5b358cc639746f34a6e6b646151b4eac9c9c117db2d8441df9a59622d6752638dd1934
7
- data.tar.gz: 4f4f46531e300cac86f05cdb1cd251705b4c9dc3d6e6588ae2e7157e889c6225e4459c8bd808940aedb3b84676b277d62ea5d4f01bc69c761d97acc28a415d09
6
+ metadata.gz: 6499ba96a636101542b4099a3fa5827516756cc1112e7cde358ef854e3579d59954171b125758515ac7e8c41459f0bffc23fc32334b03f817fc8fc31d3b1eae8
7
+ data.tar.gz: 072b2e04e07eb1e63a68fff4246899416a6a3af2c1a4c9067899c1b0d72e8f1f12a899b753d7e22b612817cbaade3e7209301579f4cce39b7db1e5e608fd2c80
data/README.md CHANGED
@@ -44,6 +44,8 @@ Or, like
44
44
 
45
45
  Note that if you try to schedule a task with an interval shorter than DayPlanner's interval, it'll complain and fail. If you shorten DayPlanner's interval to less than that of one of its tasks, it'll probably also complain and fail. Use your best judgment.
46
46
 
47
+ Specify these things in config/day_planner_tasks.rb. Note that you probably won't manage to precede that first minute-long wait. I may default to a shorter value in the future. I dunno.
48
+
47
49
  ## Contributing
48
50
 
49
51
  1. Fork it
@@ -28,24 +28,18 @@ module DayPlanner
28
28
  end
29
29
 
30
30
  def interval=(value)
31
- tasks.each do |t|
32
- Rails.logger.warn("DayPlanner: Check interval exceeds the interval of one of its tasks. The task will perform at most every #{value.inspect}.") if t.interval > value
33
- end
34
-
35
31
  @@interval = value
36
32
  end
37
33
 
38
34
  private
39
35
  def check_schedule
40
- # Rails.logger.debug("DayPlanner is checking for tasks to perform")
41
-
42
36
  tasks.each do |t|
43
37
  if Time.now > t.last_executed + t.interval
44
38
  begin
45
39
  t.perform
46
40
  rescue => e
47
- Rails.logger.warn("DayPlanner: Scheduled task threw an error! Behave yourselves!")
48
- Rails.logger.warn(e.inspect)
41
+ puts "DayPlanner: Scheduled task threw an error! Behave yourselves!"
42
+ puts e.inspect
49
43
  end
50
44
  end
51
45
  end
@@ -80,8 +74,8 @@ module DayPlanner
80
74
  begin
81
75
  perform
82
76
  rescue => e
83
- Rails.logger.warn("DayPlanner: Task caused error on first performance. There's no second chance for a good first impression!")
84
- Rails.logger.warn(e.inspect)
77
+ puts "DayPlanner: Task caused error on first performance. There's no second chance for a good first impression!"
78
+ puts e.inspect
85
79
  end
86
80
  end
87
81
  end
@@ -89,14 +83,4 @@ end
89
83
 
90
84
  DayPlanner.activate
91
85
 
92
- if defined?(Rails)
93
- module DayPlanner
94
- class Railtie < Rails::Railtie
95
- initializer "Include DayPlanner" do
96
- ActiveSupport.on_load(:action_controller) do
97
- include DayPlanner
98
- end
99
- end
100
- end
101
- end
102
- end
86
+ require File.expand_path('config/day_planner_tasks') if defined?(Rails)
@@ -1,7 +1,7 @@
1
1
  module DayPlanner
2
2
  MAJOR = 0
3
3
  MINOR = 0
4
- TINY = 2
4
+ TINY = 3
5
5
  BUILD = nil
6
6
 
7
7
  VERSION = [MAJOR, MINOR, TINY, BUILD].compact.join(".")
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: day_planner
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Damon Siefert