jzimmek-reportme 0.5.1 → 0.5.2
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/reportme/report_factory.rb +20 -0
- metadata +1 -1
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.5.
|
1
|
+
0.5.2
|
@@ -148,6 +148,26 @@ module Reportme
|
|
148
148
|
end
|
149
149
|
end
|
150
150
|
|
151
|
+
def force_notification(report_name, period_name, since = Date.today)
|
152
|
+
|
153
|
+
loop do
|
154
|
+
|
155
|
+
period = Period.calc(since, [period_name]).first
|
156
|
+
von = period[:von]
|
157
|
+
|
158
|
+
puts "force notification: #{report_name}, #{period_name}"
|
159
|
+
|
160
|
+
(@@subscribtions[report_name] || []).each do |subscription|
|
161
|
+
puts "notify subscriber of report '#{report_name}' - period: '#{period_name}', von: '#{von}'"
|
162
|
+
subscription.call(period_name, von, report_name)
|
163
|
+
end
|
164
|
+
|
165
|
+
since += 1.day
|
166
|
+
break if since.future?
|
167
|
+
end
|
168
|
+
|
169
|
+
end
|
170
|
+
|
151
171
|
def run(opts={})
|
152
172
|
|
153
173
|
opts = __opts(opts)
|