new_data_notifier 0.0.3 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. data/Gemfile +23 -0
  2. data/Gemfile.lock +109 -0
  3. data/MIT-LICENSE +20 -0
  4. data/README.mkd +26 -0
  5. data/Rakefile +53 -0
  6. data/VERSION +1 -0
  7. data/app/.DS_Store +0 -0
  8. data/app/mailers/new_data_notifier/notifier.rb +97 -0
  9. data/app/views/new_data_notifier/notifier/notification.text.erb +8 -0
  10. data/lib/.DS_Store +0 -0
  11. data/lib/new_data_notifier/engine.rb +11 -0
  12. data/lib/new_data_notifier/generators/create_config.rb +10 -0
  13. data/lib/new_data_notifier/generators/templates/new_data_notifier.rb +3 -0
  14. data/lib/new_data_notifier/tasks/notifier.rake +6 -0
  15. data/lib/new_data_notifier.rb +1 -68
  16. data/new_data_notifier.gemspec +130 -0
  17. data/test/dummy/Rakefile +7 -0
  18. data/test/dummy/app/controllers/application_controller.rb +3 -0
  19. data/test/dummy/app/helpers/application_helper.rb +2 -0
  20. data/test/dummy/app/models/user.rb +2 -0
  21. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  22. data/test/dummy/config/application.rb +45 -0
  23. data/test/dummy/config/boot.rb +10 -0
  24. data/test/dummy/config/database.yml +22 -0
  25. data/test/dummy/config/environment.rb +5 -0
  26. data/test/dummy/config/environments/development.rb +26 -0
  27. data/test/dummy/config/environments/production.rb +49 -0
  28. data/test/dummy/config/environments/test.rb +35 -0
  29. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  30. data/test/dummy/config/initializers/inflections.rb +10 -0
  31. data/test/dummy/config/initializers/mime_types.rb +5 -0
  32. data/test/dummy/config/initializers/new_data_notifier.rb +3 -0
  33. data/test/dummy/config/initializers/secret_token.rb +7 -0
  34. data/test/dummy/config/initializers/session_store.rb +8 -0
  35. data/test/dummy/config/locales/en.yml +5 -0
  36. data/test/dummy/config/routes.rb +58 -0
  37. data/test/dummy/config.ru +4 -0
  38. data/test/dummy/db/migrate/20110317034437_create_users.rb +13 -0
  39. data/test/dummy/db/schema.rb +21 -0
  40. data/test/dummy/public/404.html +26 -0
  41. data/test/dummy/public/422.html +26 -0
  42. data/test/dummy/public/500.html +26 -0
  43. data/test/dummy/public/favicon.ico +0 -0
  44. data/test/dummy/public/javascripts/application.js +2 -0
  45. data/test/dummy/public/javascripts/controls.js +965 -0
  46. data/test/dummy/public/javascripts/dragdrop.js +974 -0
  47. data/test/dummy/public/javascripts/effects.js +1123 -0
  48. data/test/dummy/public/javascripts/prototype.js +6001 -0
  49. data/test/dummy/public/javascripts/rails.js +191 -0
  50. data/test/dummy/public/stylesheets/.gitkeep +0 -0
  51. data/test/dummy/script/rails +6 -0
  52. data/test/integration/new_data_notifier_test.rb +10 -0
  53. data/test/support/integration_case.rb +4 -0
  54. data/test/test_helper.rb +18 -0
  55. metadata +180 -27
  56. data/README.rdoc +0 -19
  57. data/lib/railtie.rb +0 -7
  58. data/lib/tasks/notifier.rake +0 -30
data/Gemfile ADDED
@@ -0,0 +1,23 @@
1
+ source "http://rubygems.org"
2
+
3
+ gem "rails", ">= 3.0.0"
4
+
5
+ # To use debugger (ruby-debug for Ruby 1.8.7+, ruby-debug19 for Ruby 1.9.2+)
6
+ # gem 'ruby-debug'
7
+ # gem 'ruby-debug19'
8
+
9
+ group :development do
10
+ gem "sqlite3-ruby", :require => "sqlite3"
11
+ gem "bundler"
12
+ gem "jeweler"
13
+ gem "rcov"
14
+ gem "reek"
15
+ end
16
+
17
+ group :test do
18
+ gem "timecop"
19
+ gem "factory_girl", :require => "factory_girl", :git => "git://github.com/thoughtbot/factory_girl.git"
20
+ gem "shoulda", :require => "shoulda"
21
+ gem "test_benchmarker"
22
+ gem "rack-test", :require => "rack/test"
23
+ end
data/Gemfile.lock ADDED
@@ -0,0 +1,109 @@
1
+ GIT
2
+ remote: git://github.com/thoughtbot/factory_girl.git
3
+ revision: 4f5f5df39a1b565160ad7138a1f7d7a7c836664d
4
+ specs:
5
+ factory_girl (2.0.0.beta2)
6
+
7
+ GEM
8
+ remote: http://rubygems.org/
9
+ specs:
10
+ abstract (1.0.0)
11
+ actionmailer (3.0.5)
12
+ actionpack (= 3.0.5)
13
+ mail (~> 2.2.15)
14
+ actionpack (3.0.5)
15
+ activemodel (= 3.0.5)
16
+ activesupport (= 3.0.5)
17
+ builder (~> 2.1.2)
18
+ erubis (~> 2.6.6)
19
+ i18n (~> 0.4)
20
+ rack (~> 1.2.1)
21
+ rack-mount (~> 0.6.13)
22
+ rack-test (~> 0.5.7)
23
+ tzinfo (~> 0.3.23)
24
+ activemodel (3.0.5)
25
+ activesupport (= 3.0.5)
26
+ builder (~> 2.1.2)
27
+ i18n (~> 0.4)
28
+ activerecord (3.0.5)
29
+ activemodel (= 3.0.5)
30
+ activesupport (= 3.0.5)
31
+ arel (~> 2.0.2)
32
+ tzinfo (~> 0.3.23)
33
+ activeresource (3.0.5)
34
+ activemodel (= 3.0.5)
35
+ activesupport (= 3.0.5)
36
+ activesupport (3.0.5)
37
+ arel (2.0.9)
38
+ builder (2.1.2)
39
+ erubis (2.6.6)
40
+ abstract (>= 1.0.0)
41
+ git (1.2.5)
42
+ i18n (0.5.0)
43
+ jeweler (1.5.2)
44
+ bundler (~> 1.0.0)
45
+ git (>= 1.2.5)
46
+ rake
47
+ mail (2.2.15)
48
+ activesupport (>= 2.3.6)
49
+ i18n (>= 0.4.0)
50
+ mime-types (~> 1.16)
51
+ treetop (~> 1.4.8)
52
+ mime-types (1.16)
53
+ polyglot (0.3.1)
54
+ rack (1.2.2)
55
+ rack-mount (0.6.13)
56
+ rack (>= 1.0.0)
57
+ rack-test (0.5.7)
58
+ rack (>= 1.0)
59
+ rails (3.0.5)
60
+ actionmailer (= 3.0.5)
61
+ actionpack (= 3.0.5)
62
+ activerecord (= 3.0.5)
63
+ activeresource (= 3.0.5)
64
+ activesupport (= 3.0.5)
65
+ bundler (~> 1.0)
66
+ railties (= 3.0.5)
67
+ railties (3.0.5)
68
+ actionpack (= 3.0.5)
69
+ activesupport (= 3.0.5)
70
+ rake (>= 0.8.7)
71
+ thor (~> 0.14.4)
72
+ rake (0.8.7)
73
+ rcov (0.9.9)
74
+ reek (1.2.8)
75
+ ruby2ruby (~> 1.2)
76
+ ruby_parser (~> 2.0)
77
+ sexp_processor (~> 3.0)
78
+ ruby2ruby (1.2.5)
79
+ ruby_parser (~> 2.0)
80
+ sexp_processor (~> 3.0)
81
+ ruby_parser (2.0.6)
82
+ sexp_processor (~> 3.0)
83
+ sexp_processor (3.0.5)
84
+ shoulda (2.11.3)
85
+ sqlite3 (1.3.3)
86
+ sqlite3-ruby (1.3.3)
87
+ sqlite3 (>= 1.3.3)
88
+ test_benchmarker (1.2.1)
89
+ thor (0.14.6)
90
+ timecop (0.3.5)
91
+ treetop (1.4.9)
92
+ polyglot (>= 0.3.1)
93
+ tzinfo (0.3.25)
94
+
95
+ PLATFORMS
96
+ ruby
97
+
98
+ DEPENDENCIES
99
+ bundler
100
+ factory_girl!
101
+ jeweler
102
+ rack-test
103
+ rails (>= 3.0.0)
104
+ rcov
105
+ reek
106
+ shoulda
107
+ sqlite3-ruby
108
+ test_benchmarker
109
+ timecop
data/MIT-LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright 2011 YOURNAME
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.mkd ADDED
@@ -0,0 +1,26 @@
1
+ New Data Notifier
2
+ ===============
3
+
4
+ If there is some new users signed up on your site or some new articles been added by some other user, If you hope been notified, please execute "gem install new_data_notifier"
5
+
6
+ Install
7
+ =======
8
+
9
+ 1. Execute "rails generate new_data_notifier:config"
10
+
11
+ 2. Change the config in new_data_notifier.rb which placed in initializers dir, below is a sample:
12
+
13
+ NewDataNotifier.default_recipients = ["hlxwell@gmail.com"]
14
+
15
+ NewDataNotifier.be_monitored_models = ["Job", "Partner"]
16
+
17
+ NewDataNotifier.sender_address = ["new_data@gmail.com"]
18
+
19
+ 3. Add cron task.
20
+
21
+ */20 * * * * sh -c "cd /home/michael.he/app/current && rake send_latest_data RAILS_ENV=production"
22
+
23
+
24
+ Copyright
25
+ =========
26
+ Copyright (c) 2010 Michael He, released under the MIT license
data/Rakefile ADDED
@@ -0,0 +1,53 @@
1
+ # encoding: UTF-8
2
+ require 'rubygems'
3
+ begin
4
+ require 'bundler/setup'
5
+ rescue LoadError
6
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
7
+ end
8
+
9
+ require 'rake'
10
+ require 'rake/rdoctask'
11
+ require 'rake/testtask'
12
+
13
+ # jeweler
14
+ require 'jeweler'
15
+ Jeweler::Tasks.new do |gem|
16
+ # gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
17
+ gem.name = "new_data_notifier"
18
+ gem.homepage = "http://github.com/hlxwell/new_data_notifier"
19
+ gem.license = "MIT"
20
+ gem.summary = %Q{If there is some new users signed up on your site or some new articles been added by some other user, If you hope been notified, please execute "gem install new_data_notifier}
21
+ gem.description = %Q{If there is some new users signed up on your site or some new articles been added by some other user, If you hope been notified, please execute "gem install new_data_notifier}
22
+ gem.email = "hlxwell@gmail.com"
23
+ gem.authors = ["michael he"]
24
+ # Include your dependencies below. Runtime dependencies are required when using your gem,
25
+ # and development dependencies are only needed for development (ie running rake tasks, tests, etc)
26
+ # gem.add_runtime_dependency 'jabber4r', '> 0.1'
27
+ # gem.add_development_dependency 'rspec', '> 1.2.3'
28
+ end
29
+ Jeweler::RubygemsDotOrgTasks.new
30
+
31
+ # Rcov
32
+ require 'rcov/rcovtask'
33
+ Rcov::RcovTask.new do |test|
34
+ test.libs << 'test'
35
+ test.pattern = 'test/**/test_*.rb'
36
+ test.verbose = true
37
+ end
38
+
39
+ # Reek tasks
40
+ require 'reek/rake/task'
41
+ Reek::Rake::Task.new do |t|
42
+ t.fail_on_error = true
43
+ t.verbose = false
44
+ t.source_files = 'lib/**/*.rb'
45
+ end
46
+
47
+ # test tasks
48
+ Rake::TestTask.new(:test) do |t|
49
+ t.libs << 'lib' << 'test'
50
+ t.pattern = 'test/**/*_test.rb'
51
+ t.verbose = false
52
+ end
53
+ task :default => :test
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.1.2
data/app/.DS_Store ADDED
Binary file
@@ -0,0 +1,97 @@
1
+ module NewDataNotifier
2
+ class NoFileFound < StandardError; end
3
+
4
+ class Notifier < ActionMailer::Base
5
+ # methods for setting configs
6
+ class << self
7
+ def default_recipients=(recipients)
8
+ @@recipients = recipients
9
+ end
10
+
11
+ def default_recipients
12
+ @@recipients ||= []
13
+ end
14
+
15
+ def be_monitored_models=(models)
16
+ @@models = models
17
+ end
18
+
19
+ def be_monitored_models
20
+ @@models ||= []
21
+ end
22
+
23
+ def sender_address=(address)
24
+ @@sender_address = address
25
+ end
26
+
27
+ def sender_address
28
+ @@sender_address ||= %("New Data Notifier" <newdata.notifier@example.com>)
29
+ end
30
+
31
+ def default_options
32
+ {
33
+ :sender_address => sender_address,
34
+ :recipients => default_recipients,
35
+ :subject => "[New Data Notification]"
36
+ }
37
+ end
38
+
39
+ # used to deliver all notification mails
40
+ def send_all_notification
41
+ # send mail
42
+ unless get_latest_added_data.select { |key, value| value.count > 0 }.blank?
43
+ NewDataNotifier::Notifier.notify(data_hash).deliver
44
+ end
45
+ end
46
+
47
+ def get_latest_added_data
48
+ # find data
49
+ data_hash = {}
50
+ NewDataNotifier::Notifier.be_monitored_models.each do |model|
51
+ data_hash[model.downcase.to_sym] = model.constantize.where("created_at >= ?", get_last_sent_at).order("created_at DESC")
52
+ end
53
+ data_hash.delete_if { |key, value| value.count == 0 }
54
+ data_hash
55
+ end
56
+
57
+ def get_last_sent_at
58
+ time_mark_file_path = File.join(Rails.root, 'tmp', 'last_notification_send_at')
59
+ # read last sent time, if blank, set current time.
60
+ begin
61
+ last_sent_at = Time.parse( File.read(time_mark_file_path) )
62
+ raise "tmp/last_notification_send_at not found" if last_sent_at.blank?
63
+ rescue
64
+ last_sent_at = Time.now
65
+ ensure
66
+ # have to ensure each time after finish send mail should change the last_notification_send_at
67
+ File.open(time_mark_file_path, "w") do |f|
68
+ f.write(Time.now)
69
+ end
70
+ end
71
+ last_sent_at
72
+ end
73
+
74
+ end
75
+
76
+ # notification event.
77
+ def notify(data_hash)
78
+ @data_hash = data_hash
79
+ options = self.class.default_options
80
+ mail(:to => options[:recipients], :from => options[:sender_address], :subject => options[:subject])
81
+ end
82
+
83
+ protected
84
+
85
+ helper_method :object_name
86
+ def object_name(obj)
87
+ if obj.respond_to?(:title) and obj.try(:title).present?
88
+ obj.title
89
+ elsif obj.respond_to?(:name) and obj.try(:name).present?
90
+ obj.name
91
+ else
92
+ "#{obj.class}##{obj.id}"
93
+ end
94
+ end
95
+ end
96
+
97
+ end
@@ -0,0 +1,8 @@
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 %>
data/lib/.DS_Store ADDED
Binary file
@@ -0,0 +1,11 @@
1
+ module NewDataNotifier
2
+ class Engine < Rails::Engine
3
+ rake_tasks do
4
+ load 'new_data_notifier/tasks/notifier.rake'
5
+ end
6
+
7
+ generators do
8
+ require 'new_data_notifier/generators/create_config.rb'
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,10 @@
1
+ module NewDataNotifier
2
+ class CreateConfig < Rails::Generators::Base
3
+ desc "Add a config file."
4
+ source_root File.expand_path("../templates", __FILE__)
5
+
6
+ def create_config_file
7
+ template "new_data_notifier.rb", "config/initializers/new_data_notifier.rb"
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,3 @@
1
+ NewDataNotifier::Notifier.default_recipients = ["you_email@example.com"]
2
+ NewDataNotifier::Notifier.be_monitored_models = ["User"]
3
+ NewDataNotifier::Notifier.sender_address = ["you_email@example.com"]
@@ -0,0 +1,6 @@
1
+ namespace :new_data_notifier do
2
+ desc "send latest data"
3
+ task :send_latest_data => :environment do
4
+ NewDataNotifier::Notifier.send_all_notification
5
+ end
6
+ end
@@ -1,68 +1 @@
1
- # NewDataNotifier
2
- require 'action_mailer'
3
- require 'railtie'
4
-
5
- ##
6
- # Mail template
7
- #
8
- class NewDataNotifier < ActionMailer::Base
9
- self.mailer_name = 'new_dat_notifier'
10
- self.append_view_path "#{File.dirname(__FILE__)}/../app/views"
11
-
12
- class << self
13
- def default_recipients=(recipients)
14
- @@recipients = recipients
15
- end
16
-
17
- def default_recipients
18
- @@recipients ||= []
19
- end
20
-
21
- def be_monitored_models=(models)
22
- @@models = models
23
- end
24
-
25
- def be_monitored_models
26
- @@models ||= []
27
- end
28
-
29
- def sender_address=(address)
30
- @@sender_address = address
31
- end
32
-
33
- def sender_address
34
- @@sender_address ||= %("New Data Notifier" <newdata.notifier@example.com>)
35
- end
36
-
37
- def default_options
38
- {
39
- :sender_address => sender_address,
40
- :recipients => default_recipients,
41
- :subject => "[New Data Notification]"
42
- }
43
- end
44
- end
45
-
46
- # notification event.
47
- def notification(data_hash)
48
- @data_hash = data_hash
49
- options = self.class.default_options
50
- mail(:to => options[:recipients], :from => options[:sender_address], :subject => options[:subject]) do |format|
51
- format.text { render "new_data_notifier/notification" }
52
- end
53
- end
54
-
55
- protected
56
-
57
- helper_method :object_name
58
- def object_name(obj)
59
- if obj.respond_to?(:title) and obj.try(:title).present?
60
- obj.title
61
- elsif obj.respond_to?(:name) and obj.try(:name).present?
62
- obj.name
63
- else
64
- "#{obj.class}##{obj.id}"
65
- end
66
- end
67
-
68
- end
1
+ require 'new_data_notifier/engine'
@@ -0,0 +1,130 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = %q{new_data_notifier}
8
+ s.version = "0.1.2"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["michael he"]
12
+ s.date = %q{2011-03-17}
13
+ s.description = %q{If there is some new users signed up on your site or some new articles been added by some other user, If you hope been notified, please execute "gem install new_data_notifier}
14
+ s.email = %q{hlxwell@gmail.com}
15
+ s.extra_rdoc_files = [
16
+ "README.mkd"
17
+ ]
18
+ s.files = [
19
+ "Gemfile",
20
+ "Gemfile.lock",
21
+ "MIT-LICENSE",
22
+ "README.mkd",
23
+ "Rakefile",
24
+ "VERSION",
25
+ "app/.DS_Store",
26
+ "app/mailers/new_data_notifier/notifier.rb",
27
+ "app/views/new_data_notifier/notifier/notification.text.erb",
28
+ "lib/.DS_Store",
29
+ "lib/new_data_notifier.rb",
30
+ "lib/new_data_notifier/engine.rb",
31
+ "lib/new_data_notifier/generators/create_config.rb",
32
+ "lib/new_data_notifier/generators/templates/new_data_notifier.rb",
33
+ "lib/new_data_notifier/tasks/notifier.rake",
34
+ "new_data_notifier.gemspec",
35
+ "test/dummy/Rakefile",
36
+ "test/dummy/app/controllers/application_controller.rb",
37
+ "test/dummy/app/helpers/application_helper.rb",
38
+ "test/dummy/app/models/user.rb",
39
+ "test/dummy/app/views/layouts/application.html.erb",
40
+ "test/dummy/config.ru",
41
+ "test/dummy/config/application.rb",
42
+ "test/dummy/config/boot.rb",
43
+ "test/dummy/config/database.yml",
44
+ "test/dummy/config/environment.rb",
45
+ "test/dummy/config/environments/development.rb",
46
+ "test/dummy/config/environments/production.rb",
47
+ "test/dummy/config/environments/test.rb",
48
+ "test/dummy/config/initializers/backtrace_silencers.rb",
49
+ "test/dummy/config/initializers/inflections.rb",
50
+ "test/dummy/config/initializers/mime_types.rb",
51
+ "test/dummy/config/initializers/new_data_notifier.rb",
52
+ "test/dummy/config/initializers/secret_token.rb",
53
+ "test/dummy/config/initializers/session_store.rb",
54
+ "test/dummy/config/locales/en.yml",
55
+ "test/dummy/config/routes.rb",
56
+ "test/dummy/db/migrate/20110317034437_create_users.rb",
57
+ "test/dummy/db/schema.rb",
58
+ "test/dummy/public/404.html",
59
+ "test/dummy/public/422.html",
60
+ "test/dummy/public/500.html",
61
+ "test/dummy/public/favicon.ico",
62
+ "test/dummy/public/javascripts/application.js",
63
+ "test/dummy/public/javascripts/controls.js",
64
+ "test/dummy/public/javascripts/dragdrop.js",
65
+ "test/dummy/public/javascripts/effects.js",
66
+ "test/dummy/public/javascripts/prototype.js",
67
+ "test/dummy/public/javascripts/rails.js",
68
+ "test/dummy/public/stylesheets/.gitkeep",
69
+ "test/dummy/script/rails",
70
+ "test/integration/new_data_notifier_test.rb",
71
+ "test/support/integration_case.rb",
72
+ "test/test_helper.rb"
73
+ ]
74
+ s.homepage = %q{http://github.com/hlxwell/new_data_notifier}
75
+ s.licenses = ["MIT"]
76
+ s.require_paths = ["lib"]
77
+ s.rubygems_version = %q{1.4.1}
78
+ s.summary = %q{If there is some new users signed up on your site or some new articles been added by some other user, If you hope been notified, please execute "gem install new_data_notifier}
79
+ s.test_files = [
80
+ "test/dummy/app/controllers/application_controller.rb",
81
+ "test/dummy/app/helpers/application_helper.rb",
82
+ "test/dummy/app/models/user.rb",
83
+ "test/dummy/config/application.rb",
84
+ "test/dummy/config/boot.rb",
85
+ "test/dummy/config/environment.rb",
86
+ "test/dummy/config/environments/development.rb",
87
+ "test/dummy/config/environments/production.rb",
88
+ "test/dummy/config/environments/test.rb",
89
+ "test/dummy/config/initializers/backtrace_silencers.rb",
90
+ "test/dummy/config/initializers/inflections.rb",
91
+ "test/dummy/config/initializers/mime_types.rb",
92
+ "test/dummy/config/initializers/new_data_notifier.rb",
93
+ "test/dummy/config/initializers/secret_token.rb",
94
+ "test/dummy/config/initializers/session_store.rb",
95
+ "test/dummy/config/routes.rb",
96
+ "test/dummy/db/migrate/20110317034437_create_users.rb",
97
+ "test/dummy/db/schema.rb",
98
+ "test/integration/new_data_notifier_test.rb",
99
+ "test/support/integration_case.rb",
100
+ "test/test_helper.rb"
101
+ ]
102
+
103
+ if s.respond_to? :specification_version then
104
+ s.specification_version = 3
105
+
106
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
107
+ s.add_runtime_dependency(%q<rails>, [">= 3.0.0"])
108
+ s.add_development_dependency(%q<sqlite3-ruby>, [">= 0"])
109
+ s.add_development_dependency(%q<bundler>, [">= 0"])
110
+ s.add_development_dependency(%q<jeweler>, [">= 0"])
111
+ s.add_development_dependency(%q<rcov>, [">= 0"])
112
+ s.add_development_dependency(%q<reek>, [">= 0"])
113
+ else
114
+ s.add_dependency(%q<rails>, [">= 3.0.0"])
115
+ s.add_dependency(%q<sqlite3-ruby>, [">= 0"])
116
+ s.add_dependency(%q<bundler>, [">= 0"])
117
+ s.add_dependency(%q<jeweler>, [">= 0"])
118
+ s.add_dependency(%q<rcov>, [">= 0"])
119
+ s.add_dependency(%q<reek>, [">= 0"])
120
+ end
121
+ else
122
+ s.add_dependency(%q<rails>, [">= 3.0.0"])
123
+ s.add_dependency(%q<sqlite3-ruby>, [">= 0"])
124
+ s.add_dependency(%q<bundler>, [">= 0"])
125
+ s.add_dependency(%q<jeweler>, [">= 0"])
126
+ s.add_dependency(%q<rcov>, [">= 0"])
127
+ s.add_dependency(%q<reek>, [">= 0"])
128
+ end
129
+ end
130
+
@@ -0,0 +1,7 @@
1
+ # Add your own tasks in files placed in lib/tasks ending in .rake,
2
+ # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3
+
4
+ require File.expand_path('../config/application', __FILE__)
5
+ require 'rake'
6
+
7
+ Dummy::Application.load_tasks
@@ -0,0 +1,3 @@
1
+ class ApplicationController < ActionController::Base
2
+ protect_from_forgery
3
+ end
@@ -0,0 +1,2 @@
1
+ module ApplicationHelper
2
+ end
@@ -0,0 +1,2 @@
1
+ class User < ActiveRecord::Base
2
+ end
@@ -0,0 +1,14 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Dummy</title>
5
+ <%= stylesheet_link_tag :all %>
6
+ <%= javascript_include_tag :defaults %>
7
+ <%= csrf_meta_tag %>
8
+ </head>
9
+ <body>
10
+
11
+ <%= yield %>
12
+
13
+ </body>
14
+ </html>
@@ -0,0 +1,45 @@
1
+ require File.expand_path('../boot', __FILE__)
2
+
3
+ require "active_model/railtie"
4
+ require "active_record/railtie"
5
+ require "action_controller/railtie"
6
+ require "action_view/railtie"
7
+ require "action_mailer/railtie"
8
+
9
+ Bundler.require
10
+ require "new_data_notifier"
11
+
12
+ module Dummy
13
+ class Application < Rails::Application
14
+ # Settings in config/environments/* take precedence over those specified here.
15
+ # Application configuration should go into files in config/initializers
16
+ # -- all .rb files in that directory are automatically loaded.
17
+
18
+ # Custom directories with classes and modules you want to be autoloadable.
19
+ # config.autoload_paths += %W(#{config.root}/extras)
20
+
21
+ # Only load the plugins named here, in the order given (default is alphabetical).
22
+ # :all can be used as a placeholder for all plugins not explicitly named.
23
+ # config.plugins = [ :exception_notification, :ssl_requirement, :all ]
24
+
25
+ # Activate observers that should always be running.
26
+ # config.active_record.observers = :cacher, :garbage_collector, :forum_observer
27
+
28
+ # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
29
+ # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
30
+ config.time_zone = 'Beijing'
31
+
32
+ # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
33
+ # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
34
+ # config.i18n.default_locale = :de
35
+
36
+ # JavaScript files you want as :defaults (application.js is always included).
37
+ # config.action_view.javascript_expansions[:defaults] = %w(jquery rails)
38
+
39
+ # Configure the default encoding used in templates for Ruby 1.9.
40
+ config.encoding = "utf-8"
41
+
42
+ # Configure sensitive parameters which will be filtered from the log file.
43
+ config.filter_parameters += [:password]
44
+ end
45
+ end