new_data_notifier 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- data/README.mkd +8 -1
- data/VERSION +1 -1
- data/app/mailers/new_data_notifier/notifier.rb +2 -1
- data/new_data_notifier.gemspec +1 -1
- data/test/integration/new_data_notifier_test.rb +2 -0
- metadata +3 -3
data/README.mkd
CHANGED
@@ -18,7 +18,14 @@ Install
|
|
18
18
|
|
19
19
|
3. Add cron task.
|
20
20
|
|
21
|
-
*/20 * * * * sh -c "cd /home/michael.he/app/current && rake send_latest_data RAILS_ENV=production"
|
21
|
+
*/20 * * * * sh -c "cd /home/michael.he/app/current && rake new_data_notifier:send_latest_data RAILS_ENV=production"
|
22
|
+
|
23
|
+
TO-DO-LIST
|
24
|
+
==========
|
25
|
+
|
26
|
+
1. Monitored Models should be able to configured like below:
|
27
|
+
|
28
|
+
NewDataNotifier.be_monitored_models = ["Job.waiting_to_approve", "PaymentTransaction.waiting_to_process"]
|
22
29
|
|
23
30
|
|
24
31
|
Copyright
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.3
|
@@ -38,8 +38,9 @@ module NewDataNotifier
|
|
38
38
|
|
39
39
|
# used to deliver all notification mails
|
40
40
|
def send_all_notification
|
41
|
+
data_hash = get_latest_added_data
|
41
42
|
# send mail
|
42
|
-
unless
|
43
|
+
unless data_hash.select { |key, value| value.count > 0 }.blank?
|
43
44
|
NewDataNotifier::Notifier.notify(data_hash).deliver
|
44
45
|
end
|
45
46
|
end
|
data/new_data_notifier.gemspec
CHANGED
@@ -4,7 +4,9 @@ class NewDataNotifierTest < ActiveSupport::IntegrationCase
|
|
4
4
|
test "should send mail when there is new users" do
|
5
5
|
assert Time.now >= NewDataNotifier::Notifier.get_last_sent_at
|
6
6
|
assert NewDataNotifier::Notifier.get_latest_added_data.blank?
|
7
|
+
assert NewDataNotifier::Notifier.send_all_notification.blank?
|
7
8
|
User.create :email => "a@a.com"
|
8
9
|
assert !NewDataNotifier::Notifier.get_latest_added_data.blank?
|
10
|
+
assert !NewDataNotifier::Notifier.send_all_notification.blank?
|
9
11
|
end
|
10
12
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: new_data_notifier
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 29
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 3
|
10
|
+
version: 0.1.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- michael he
|