new_data_notifier 0.0.2 → 0.0.3

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.
@@ -1,12 +1,13 @@
1
1
  # NewDataNotifier
2
2
  require 'action_mailer'
3
+ require 'railtie'
3
4
 
4
5
  ##
5
6
  # Mail template
6
7
  #
7
8
  class NewDataNotifier < ActionMailer::Base
8
9
  self.mailer_name = 'new_dat_notifier'
9
- self.append_view_path "#{File.dirname(__FILE__)}/views"
10
+ self.append_view_path "#{File.dirname(__FILE__)}/../app/views"
10
11
 
11
12
  class << self
12
13
  def default_recipients=(recipients)
@@ -24,11 +25,11 @@ class NewDataNotifier < ActionMailer::Base
24
25
  def be_monitored_models
25
26
  @@models ||= []
26
27
  end
27
-
28
+
28
29
  def sender_address=(address)
29
30
  @@sender_address = address
30
31
  end
31
-
32
+
32
33
  def sender_address
33
34
  @@sender_address ||= %("New Data Notifier" <newdata.notifier@example.com>)
34
35
  end
data/lib/railtie.rb ADDED
@@ -0,0 +1,7 @@
1
+ require 'rails'
2
+
3
+ class Railtie < ::Rails::Railtie
4
+ rake_tasks do
5
+ load 'tasks/notifier.rake'
6
+ end
7
+ end
@@ -1,4 +1,4 @@
1
- desc "Send mail to tell admin the latest added data."
1
+ desc "send latest data"
2
2
  task :send_latest_data => :environment do
3
3
  time_mark_file_path = File.join(Rails.root, 'tmp', 'last_notification_send_at')
4
4
 
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: 27
4
+ hash: 25
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 2
10
- version: 0.0.2
9
+ - 3
10
+ version: 0.0.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Michael He
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-12-03 00:00:00 +08:00
18
+ date: 2010-12-04 00:00:00 +08:00
19
19
  default_executable:
20
20
  dependencies: []
21
21
 
@@ -30,8 +30,8 @@ extra_rdoc_files: []
30
30
  files:
31
31
  - README.rdoc
32
32
  - lib/new_data_notifier.rb
33
+ - lib/railtie.rb
33
34
  - lib/tasks/notifier.rake
34
- - lib/views/new_data_notifier/notification.text.erb
35
35
  has_rdoc: true
36
36
  homepage: http://hlxwell.github.com/new_data_notifier
37
37
  licenses: []
@@ -1,8 +0,0 @@
1
- <% @data_hash.each do |key, value| %>
2
-
3
- ============ New <%= key %>(s) (<%= value.size %>) ================
4
- <% value.each do |obj| %>
5
- <%= object_name(obj) %> --- created at: <%= obj.created_at.to_s(:db) %>
6
- <% end %>
7
-
8
- <% end %>