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 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.2
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 get_latest_added_data.select { |key, value| value.count > 0 }.blank?
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
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{new_data_notifier}
8
- s.version = "0.1.2"
8
+ s.version = "0.1.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["michael he"]
@@ -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: 31
4
+ hash: 29
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 2
10
- version: 0.1.2
9
+ - 3
10
+ version: 0.1.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - michael he