mail_envi 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +5 -0
- data/Gemfile +16 -0
- data/Gemfile.lock +91 -0
- data/LICENSE.txt +20 -0
- data/README.md +102 -0
- data/Rakefile +55 -0
- data/VERSION +1 -0
- data/lib/mail_envi/config.rb +23 -0
- data/lib/mail_envi.rb +38 -0
- data/mail_envi.gemspec +108 -0
- data/test/dummy/.gitignore +4 -0
- data/test/dummy/Rakefile +7 -0
- data/test/dummy/app/controllers/application_controller.rb +3 -0
- data/test/dummy/app/helpers/application_helper.rb +2 -0
- data/test/dummy/app/mailers/user_mailer.rb +12 -0
- data/test/dummy/app/views/layouts/application.html.erb +14 -0
- data/test/dummy/config/application.rb +48 -0
- data/test/dummy/config/boot.rb +9 -0
- data/test/dummy/config/database.yml +22 -0
- data/test/dummy/config/environment.rb +5 -0
- data/test/dummy/config/environments/development.rb +26 -0
- data/test/dummy/config/environments/production.rb +49 -0
- data/test/dummy/config/environments/test.rb +35 -0
- data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/test/dummy/config/initializers/inflections.rb +10 -0
- data/test/dummy/config/initializers/mail_envi.rb +3 -0
- data/test/dummy/config/initializers/mime_types.rb +5 -0
- data/test/dummy/config/initializers/secret_token.rb +7 -0
- data/test/dummy/config/initializers/session_store.rb +8 -0
- data/test/dummy/config/locales/en.yml +5 -0
- data/test/dummy/config/routes.rb +58 -0
- data/test/dummy/config.ru +4 -0
- data/test/dummy/db/seeds.rb +7 -0
- data/test/dummy/public/404.html +26 -0
- data/test/dummy/public/422.html +26 -0
- data/test/dummy/public/500.html +26 -0
- data/test/dummy/public/favicon.ico +0 -0
- data/test/dummy/public/images/rails.png +0 -0
- data/test/dummy/public/index.html +239 -0
- data/test/dummy/public/javascripts/application.js +2 -0
- data/test/dummy/public/javascripts/controls.js +965 -0
- data/test/dummy/public/javascripts/dragdrop.js +974 -0
- data/test/dummy/public/javascripts/effects.js +1123 -0
- data/test/dummy/public/javascripts/prototype.js +6001 -0
- data/test/dummy/public/javascripts/rails.js +191 -0
- data/test/dummy/public/robots.txt +5 -0
- data/test/dummy/public/stylesheets/.gitkeep +0 -0
- data/test/dummy/script/rails +6 -0
- data/test/mail_envi/test_config.rb +55 -0
- data/test/mailer/test_user_mailer.rb +18 -0
- data/test/test_helper.rb +26 -0
- data/test/test_mail_envi.rb +45 -0
- metadata +184 -0
data/.document
ADDED
data/Gemfile
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
source "http://rubygems.org"
|
2
|
+
# Add dependencies required to use your gem here.
|
3
|
+
# Example:
|
4
|
+
# gem "activesupport", ">= 2.3.5"
|
5
|
+
gem "rails", "~> 3.0.0"
|
6
|
+
|
7
|
+
# Add dependencies to develop your gem here.
|
8
|
+
# Include everything needed to run rake, tests, features, etc.
|
9
|
+
group :development do
|
10
|
+
gem "shoulda", ">= 0"
|
11
|
+
gem "bundler", "~> 1.0.0"
|
12
|
+
gem "jeweler", "~> 1.6.2"
|
13
|
+
gem "rcov", ">= 0"
|
14
|
+
gem "turn"
|
15
|
+
gem "rr"
|
16
|
+
end
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,91 @@
|
|
1
|
+
GEM
|
2
|
+
remote: http://rubygems.org/
|
3
|
+
specs:
|
4
|
+
abstract (1.0.0)
|
5
|
+
actionmailer (3.0.10)
|
6
|
+
actionpack (= 3.0.10)
|
7
|
+
mail (~> 2.2.19)
|
8
|
+
actionpack (3.0.10)
|
9
|
+
activemodel (= 3.0.10)
|
10
|
+
activesupport (= 3.0.10)
|
11
|
+
builder (~> 2.1.2)
|
12
|
+
erubis (~> 2.6.6)
|
13
|
+
i18n (~> 0.5.0)
|
14
|
+
rack (~> 1.2.1)
|
15
|
+
rack-mount (~> 0.6.14)
|
16
|
+
rack-test (~> 0.5.7)
|
17
|
+
tzinfo (~> 0.3.23)
|
18
|
+
activemodel (3.0.10)
|
19
|
+
activesupport (= 3.0.10)
|
20
|
+
builder (~> 2.1.2)
|
21
|
+
i18n (~> 0.5.0)
|
22
|
+
activerecord (3.0.10)
|
23
|
+
activemodel (= 3.0.10)
|
24
|
+
activesupport (= 3.0.10)
|
25
|
+
arel (~> 2.0.10)
|
26
|
+
tzinfo (~> 0.3.23)
|
27
|
+
activeresource (3.0.10)
|
28
|
+
activemodel (= 3.0.10)
|
29
|
+
activesupport (= 3.0.10)
|
30
|
+
activesupport (3.0.10)
|
31
|
+
ansi (1.3.0)
|
32
|
+
arel (2.0.10)
|
33
|
+
builder (2.1.2)
|
34
|
+
erubis (2.6.6)
|
35
|
+
abstract (>= 1.0.0)
|
36
|
+
git (1.2.5)
|
37
|
+
i18n (0.5.0)
|
38
|
+
jeweler (1.6.4)
|
39
|
+
bundler (~> 1.0)
|
40
|
+
git (>= 1.2.5)
|
41
|
+
rake
|
42
|
+
mail (2.2.19)
|
43
|
+
activesupport (>= 2.3.6)
|
44
|
+
i18n (>= 0.4.0)
|
45
|
+
mime-types (~> 1.16)
|
46
|
+
treetop (~> 1.4.8)
|
47
|
+
mime-types (1.16)
|
48
|
+
polyglot (0.3.2)
|
49
|
+
rack (1.2.3)
|
50
|
+
rack-mount (0.6.14)
|
51
|
+
rack (>= 1.0.0)
|
52
|
+
rack-test (0.5.7)
|
53
|
+
rack (>= 1.0)
|
54
|
+
rails (3.0.10)
|
55
|
+
actionmailer (= 3.0.10)
|
56
|
+
actionpack (= 3.0.10)
|
57
|
+
activerecord (= 3.0.10)
|
58
|
+
activeresource (= 3.0.10)
|
59
|
+
activesupport (= 3.0.10)
|
60
|
+
bundler (~> 1.0)
|
61
|
+
railties (= 3.0.10)
|
62
|
+
railties (3.0.10)
|
63
|
+
actionpack (= 3.0.10)
|
64
|
+
activesupport (= 3.0.10)
|
65
|
+
rake (>= 0.8.7)
|
66
|
+
rdoc (~> 3.4)
|
67
|
+
thor (~> 0.14.4)
|
68
|
+
rake (0.9.2)
|
69
|
+
rcov (0.9.10)
|
70
|
+
rdoc (3.9.4)
|
71
|
+
rr (1.0.4)
|
72
|
+
shoulda (2.11.3)
|
73
|
+
thor (0.14.6)
|
74
|
+
treetop (1.4.10)
|
75
|
+
polyglot
|
76
|
+
polyglot (>= 0.3.1)
|
77
|
+
turn (0.8.2)
|
78
|
+
ansi (>= 1.2.2)
|
79
|
+
tzinfo (0.3.29)
|
80
|
+
|
81
|
+
PLATFORMS
|
82
|
+
ruby
|
83
|
+
|
84
|
+
DEPENDENCIES
|
85
|
+
bundler (~> 1.0.0)
|
86
|
+
jeweler (~> 1.6.2)
|
87
|
+
rails (~> 3.0.0)
|
88
|
+
rcov
|
89
|
+
rr
|
90
|
+
shoulda
|
91
|
+
turn
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2011 Yung Hwa Kwon
|
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.md
ADDED
@@ -0,0 +1,102 @@
|
|
1
|
+
# MailEnvi, :require => "mail_envi"
|
2
|
+
|
3
|
+
A basic Mail interceptor gem for (Rails 3) development/test and other environments.
|
4
|
+
|
5
|
+
### Basic Usage
|
6
|
+
|
7
|
+
**Install**
|
8
|
+
|
9
|
+
gem "mail_envi"
|
10
|
+
|
11
|
+
That is about it.
|
12
|
+
|
13
|
+
group :development do
|
14
|
+
gem "mail_envi"
|
15
|
+
end
|
16
|
+
|
17
|
+
While, you can configure the MailEnvi to work within any environment. For most basic uses, I recommend you keep this gem under your `development` group in your `Gemfile`.
|
18
|
+
|
19
|
+
Intercepted mail will, by default, change the `to` address to `root@localhost` and will prefix the subject to identify it was intercepted.
|
20
|
+
|
21
|
+
Ex:
|
22
|
+
|
23
|
+
# original mail
|
24
|
+
to: foo@bar.com
|
25
|
+
subject: Hello World
|
26
|
+
|
27
|
+
# intercepted mail
|
28
|
+
to: root@localhost
|
29
|
+
subject: (#{Rails.env} Intercepted) Hello World
|
30
|
+
|
31
|
+
---
|
32
|
+
|
33
|
+
**Configuration**
|
34
|
+
|
35
|
+
There are a few configuration options you can provide to extend/customize the functionality of MailEnvi.
|
36
|
+
|
37
|
+
In your `initializer/mail_envi.rb`
|
38
|
+
|
39
|
+
MailEnvi.config do |config|
|
40
|
+
config.interceptor = CustomInterceptorClass
|
41
|
+
config.default_to = "person@company.com"
|
42
|
+
config.include_environments [:beta, :alpha]
|
43
|
+
end
|
44
|
+
|
45
|
+
|
46
|
+
<table border="1" cellspacing="0">
|
47
|
+
<col align="left" />
|
48
|
+
<col align="left" />
|
49
|
+
<col align="left" />
|
50
|
+
<thead>
|
51
|
+
<tr>
|
52
|
+
<th>key</th>
|
53
|
+
<th>accepted value</th>
|
54
|
+
<th>description</th>
|
55
|
+
</tr>
|
56
|
+
</thead>
|
57
|
+
<tbody>
|
58
|
+
<tr>
|
59
|
+
<td>interceptor</td>
|
60
|
+
<td>Class</td>
|
61
|
+
<td>You can provide a custom interceptor class to provide customized interception “your way”.</td>
|
62
|
+
</tr>
|
63
|
+
<tr>
|
64
|
+
<td>default_to</td>
|
65
|
+
<td>String</td>
|
66
|
+
<td>Replace the <code>DefaultInterceptor</code>’s <code>to</code> address, to one set in the config. <strong>Only works through the <code>DefaultInterceptor</code></strong></td>
|
67
|
+
</tr>
|
68
|
+
<tr>
|
69
|
+
<td>include_environments</td>
|
70
|
+
<td>Array</td>
|
71
|
+
<td>Adds the array, to the list of included environments that should register the interceptor</td>
|
72
|
+
</tr>
|
73
|
+
</tbody>
|
74
|
+
</table>
|
75
|
+
|
76
|
+
### Inspirations
|
77
|
+
|
78
|
+
* Ryan Bates' [Action Mailer in Rails 3][0] railscast. Thanks!
|
79
|
+
|
80
|
+
[0]: http://railscasts.com/episodes/206-action-mailer-in-rails-3
|
81
|
+
|
82
|
+
|
83
|
+
## TODO
|
84
|
+
|
85
|
+
* Test helpers
|
86
|
+
* Multi-environment configurations
|
87
|
+
|
88
|
+
### Contributing to mail_envi
|
89
|
+
|
90
|
+
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
|
91
|
+
* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
|
92
|
+
* Fork the project
|
93
|
+
* Start a feature/bugfix branch
|
94
|
+
* Commit and push until you are happy with your contribution
|
95
|
+
* Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
|
96
|
+
* Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
|
97
|
+
|
98
|
+
### Copyright
|
99
|
+
|
100
|
+
Copyright (c) 2011 Yung Hwa Kwon. See LICENSE.txt for
|
101
|
+
further details.
|
102
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1,55 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require 'rubygems'
|
4
|
+
require 'bundler'
|
5
|
+
begin
|
6
|
+
Bundler.setup(:default, :development)
|
7
|
+
rescue Bundler::BundlerError => e
|
8
|
+
$stderr.puts e.message
|
9
|
+
$stderr.puts "Run `bundle install` to install missing gems"
|
10
|
+
exit e.status_code
|
11
|
+
end
|
12
|
+
require 'rake'
|
13
|
+
|
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 = "mail_envi"
|
18
|
+
gem.homepage = "http://github.com/nowk/mail_envi"
|
19
|
+
gem.license = "MIT"
|
20
|
+
gem.summary = %Q{Mail interceptor for different environments}
|
21
|
+
gem.description = %Q{}
|
22
|
+
gem.email = "yung.kwon@damncarousel.com"
|
23
|
+
gem.authors = ["Yung Hwa Kwon"]
|
24
|
+
# dependencies defined in Gemfile
|
25
|
+
gem.extra_rdoc_files = ['README.md']
|
26
|
+
gem.files.exclude '.rvmrc'
|
27
|
+
end
|
28
|
+
Jeweler::RubygemsDotOrgTasks.new
|
29
|
+
|
30
|
+
require 'rake/testtask'
|
31
|
+
Rake::TestTask.new(:test) do |test|
|
32
|
+
test.libs << 'lib' << 'test'
|
33
|
+
test.pattern = 'test/**/test_*.rb'
|
34
|
+
test.verbose = true
|
35
|
+
end
|
36
|
+
|
37
|
+
require 'rcov/rcovtask'
|
38
|
+
Rcov::RcovTask.new do |test|
|
39
|
+
test.libs << 'test'
|
40
|
+
test.pattern = 'test/**/test_*.rb'
|
41
|
+
test.verbose = true
|
42
|
+
test.rcov_opts << '--exclude "gems/*"'
|
43
|
+
end
|
44
|
+
|
45
|
+
task :default => :test
|
46
|
+
|
47
|
+
require 'rake/rdoctask'
|
48
|
+
Rake::RDocTask.new do |rdoc|
|
49
|
+
version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
50
|
+
|
51
|
+
rdoc.rdoc_dir = 'rdoc'
|
52
|
+
rdoc.title = "mail_envi #{version}"
|
53
|
+
rdoc.rdoc_files.include('README*')
|
54
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
55
|
+
end
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.1.0
|
@@ -0,0 +1,23 @@
|
|
1
|
+
module MailEnvi
|
2
|
+
class Config
|
3
|
+
def initialize &block
|
4
|
+
@environments = ['development', 'test']
|
5
|
+
|
6
|
+
instance_eval(&block) if block_given?
|
7
|
+
end
|
8
|
+
|
9
|
+
attr_accessor :interceptor, :environments, :default_to
|
10
|
+
|
11
|
+
def interceptor
|
12
|
+
@interceptor || MailEnvi::DefaultInterceptor
|
13
|
+
end
|
14
|
+
|
15
|
+
def include_environments(envs = [])
|
16
|
+
@environments+= envs.map(&:to_s) if envs && envs.any?
|
17
|
+
end
|
18
|
+
|
19
|
+
def default_to
|
20
|
+
@default_to || 'root@localhost'
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
data/lib/mail_envi.rb
ADDED
@@ -0,0 +1,38 @@
|
|
1
|
+
require 'rails/railtie'
|
2
|
+
require 'mail'
|
3
|
+
require 'mail_envi/config'
|
4
|
+
|
5
|
+
module MailEnvi
|
6
|
+
@config = nil
|
7
|
+
|
8
|
+
module Rails
|
9
|
+
class Railtie < ::Rails::Railtie
|
10
|
+
initializer "mail_envi.register_interceptor" do
|
11
|
+
if MailEnvi.config.environments.include?(MailEnvi.ronment.to_s)
|
12
|
+
::Mail.register_interceptor(MailEnvi.config.interceptor)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
|
19
|
+
def self.ronment
|
20
|
+
::Rails.env
|
21
|
+
end
|
22
|
+
|
23
|
+
def self.config &block
|
24
|
+
if block_given?
|
25
|
+
@config = MailEnvi::Config.new &block
|
26
|
+
else
|
27
|
+
@config ||= MailEnvi::Config.new
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
|
32
|
+
class DefaultInterceptor
|
33
|
+
def self.delivering_email(msg)
|
34
|
+
msg.to = MailEnvi.config.default_to
|
35
|
+
msg.subject = "(#{MailEnvi.ronment} Interception) #{msg.subject}"
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
data/mail_envi.gemspec
ADDED
@@ -0,0 +1,108 @@
|
|
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{mail_envi}
|
8
|
+
s.version = "0.1.0"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = [%q{Yung Hwa Kwon}]
|
12
|
+
s.date = %q{2011-09-13}
|
13
|
+
s.description = %q{}
|
14
|
+
s.email = %q{yung.kwon@damncarousel.com}
|
15
|
+
s.extra_rdoc_files = [
|
16
|
+
"README.md"
|
17
|
+
]
|
18
|
+
s.files = [
|
19
|
+
".document",
|
20
|
+
"Gemfile",
|
21
|
+
"Gemfile.lock",
|
22
|
+
"LICENSE.txt",
|
23
|
+
"README.md",
|
24
|
+
"Rakefile",
|
25
|
+
"VERSION",
|
26
|
+
"lib/mail_envi.rb",
|
27
|
+
"lib/mail_envi/config.rb",
|
28
|
+
"mail_envi.gemspec",
|
29
|
+
"test/dummy/.gitignore",
|
30
|
+
"test/dummy/Rakefile",
|
31
|
+
"test/dummy/app/controllers/application_controller.rb",
|
32
|
+
"test/dummy/app/helpers/application_helper.rb",
|
33
|
+
"test/dummy/app/mailers/user_mailer.rb",
|
34
|
+
"test/dummy/app/views/layouts/application.html.erb",
|
35
|
+
"test/dummy/config.ru",
|
36
|
+
"test/dummy/config/application.rb",
|
37
|
+
"test/dummy/config/boot.rb",
|
38
|
+
"test/dummy/config/database.yml",
|
39
|
+
"test/dummy/config/environment.rb",
|
40
|
+
"test/dummy/config/environments/development.rb",
|
41
|
+
"test/dummy/config/environments/production.rb",
|
42
|
+
"test/dummy/config/environments/test.rb",
|
43
|
+
"test/dummy/config/initializers/backtrace_silencers.rb",
|
44
|
+
"test/dummy/config/initializers/inflections.rb",
|
45
|
+
"test/dummy/config/initializers/mail_envi.rb",
|
46
|
+
"test/dummy/config/initializers/mime_types.rb",
|
47
|
+
"test/dummy/config/initializers/secret_token.rb",
|
48
|
+
"test/dummy/config/initializers/session_store.rb",
|
49
|
+
"test/dummy/config/locales/en.yml",
|
50
|
+
"test/dummy/config/routes.rb",
|
51
|
+
"test/dummy/db/seeds.rb",
|
52
|
+
"test/dummy/public/404.html",
|
53
|
+
"test/dummy/public/422.html",
|
54
|
+
"test/dummy/public/500.html",
|
55
|
+
"test/dummy/public/favicon.ico",
|
56
|
+
"test/dummy/public/images/rails.png",
|
57
|
+
"test/dummy/public/index.html",
|
58
|
+
"test/dummy/public/javascripts/application.js",
|
59
|
+
"test/dummy/public/javascripts/controls.js",
|
60
|
+
"test/dummy/public/javascripts/dragdrop.js",
|
61
|
+
"test/dummy/public/javascripts/effects.js",
|
62
|
+
"test/dummy/public/javascripts/prototype.js",
|
63
|
+
"test/dummy/public/javascripts/rails.js",
|
64
|
+
"test/dummy/public/robots.txt",
|
65
|
+
"test/dummy/public/stylesheets/.gitkeep",
|
66
|
+
"test/dummy/script/rails",
|
67
|
+
"test/mail_envi/test_config.rb",
|
68
|
+
"test/mailer/test_user_mailer.rb",
|
69
|
+
"test/test_helper.rb",
|
70
|
+
"test/test_mail_envi.rb"
|
71
|
+
]
|
72
|
+
s.homepage = %q{http://github.com/nowk/mail_envi}
|
73
|
+
s.licenses = [%q{MIT}]
|
74
|
+
s.require_paths = [%q{lib}]
|
75
|
+
s.rubygems_version = %q{1.8.5}
|
76
|
+
s.summary = %q{Mail interceptor for different environments}
|
77
|
+
|
78
|
+
if s.respond_to? :specification_version then
|
79
|
+
s.specification_version = 3
|
80
|
+
|
81
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
82
|
+
s.add_runtime_dependency(%q<rails>, ["~> 3.0.0"])
|
83
|
+
s.add_development_dependency(%q<shoulda>, [">= 0"])
|
84
|
+
s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
|
85
|
+
s.add_development_dependency(%q<jeweler>, ["~> 1.6.2"])
|
86
|
+
s.add_development_dependency(%q<rcov>, [">= 0"])
|
87
|
+
s.add_development_dependency(%q<turn>, [">= 0"])
|
88
|
+
s.add_development_dependency(%q<rr>, [">= 0"])
|
89
|
+
else
|
90
|
+
s.add_dependency(%q<rails>, ["~> 3.0.0"])
|
91
|
+
s.add_dependency(%q<shoulda>, [">= 0"])
|
92
|
+
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
|
93
|
+
s.add_dependency(%q<jeweler>, ["~> 1.6.2"])
|
94
|
+
s.add_dependency(%q<rcov>, [">= 0"])
|
95
|
+
s.add_dependency(%q<turn>, [">= 0"])
|
96
|
+
s.add_dependency(%q<rr>, [">= 0"])
|
97
|
+
end
|
98
|
+
else
|
99
|
+
s.add_dependency(%q<rails>, ["~> 3.0.0"])
|
100
|
+
s.add_dependency(%q<shoulda>, [">= 0"])
|
101
|
+
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
|
102
|
+
s.add_dependency(%q<jeweler>, ["~> 1.6.2"])
|
103
|
+
s.add_dependency(%q<rcov>, [">= 0"])
|
104
|
+
s.add_dependency(%q<turn>, [">= 0"])
|
105
|
+
s.add_dependency(%q<rr>, [">= 0"])
|
106
|
+
end
|
107
|
+
end
|
108
|
+
|
data/test/dummy/Rakefile
ADDED
@@ -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,12 @@
|
|
1
|
+
class UserMailer < ActionMailer::Base
|
2
|
+
default :from => "default@company.com"
|
3
|
+
|
4
|
+
def registration_complete(user)
|
5
|
+
@user = user
|
6
|
+
mail(:to => @user.email,
|
7
|
+
:subject => "Your registration has been completed") do |format|
|
8
|
+
format.html { render :text => "Hello World!" }
|
9
|
+
format.text { render :text => "Hello World!" }
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,48 @@
|
|
1
|
+
require File.expand_path('../boot', __FILE__)
|
2
|
+
|
3
|
+
# http://stackoverflow.com/questions/3954307/rails-3-how-do-i-avoid-database-altogether
|
4
|
+
# require 'rails/all'
|
5
|
+
require "action_controller/railtie"
|
6
|
+
require "action_mailer/railtie"
|
7
|
+
require "active_resource/railtie"
|
8
|
+
require "rails/test_unit/railtie"
|
9
|
+
|
10
|
+
# If you have a Gemfile, require the gems listed there, including any gems
|
11
|
+
# you've limited to :test, :development, or :production.
|
12
|
+
Bundler.require(:default, Rails.env) if defined?(Bundler)
|
13
|
+
require "mail_envi"
|
14
|
+
|
15
|
+
module Dummy
|
16
|
+
class Application < Rails::Application
|
17
|
+
# Settings in config/environments/* take precedence over those specified here.
|
18
|
+
# Application configuration should go into files in config/initializers
|
19
|
+
# -- all .rb files in that directory are automatically loaded.
|
20
|
+
|
21
|
+
# Custom directories with classes and modules you want to be autoloadable.
|
22
|
+
# config.autoload_paths += %W(#{config.root}/extras)
|
23
|
+
|
24
|
+
# Only load the plugins named here, in the order given (default is alphabetical).
|
25
|
+
# :all can be used as a placeholder for all plugins not explicitly named.
|
26
|
+
# config.plugins = [ :exception_notification, :ssl_requirement, :all ]
|
27
|
+
|
28
|
+
# Activate observers that should always be running.
|
29
|
+
# config.active_record.observers = :cacher, :garbage_collector, :forum_observer
|
30
|
+
|
31
|
+
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
|
32
|
+
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
|
33
|
+
# config.time_zone = 'Central Time (US & Canada)'
|
34
|
+
|
35
|
+
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
|
36
|
+
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
|
37
|
+
# config.i18n.default_locale = :de
|
38
|
+
|
39
|
+
# JavaScript files you want as :defaults (application.js is always included).
|
40
|
+
# config.action_view.javascript_expansions[:defaults] = %w(jquery rails)
|
41
|
+
|
42
|
+
# Configure the default encoding used in templates for Ruby 1.9.
|
43
|
+
config.encoding = "utf-8"
|
44
|
+
|
45
|
+
# Configure sensitive parameters which will be filtered from the log file.
|
46
|
+
config.filter_parameters += [:password]
|
47
|
+
end
|
48
|
+
end
|
@@ -0,0 +1,9 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
|
3
|
+
# Set up gems listed in the Gemfile.
|
4
|
+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
|
5
|
+
|
6
|
+
require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
|
7
|
+
|
8
|
+
# add in the gem lib/
|
9
|
+
$:.unshift File.expand_path('../../../../lib', __FILE__)
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# SQLite version 3.x
|
2
|
+
# gem install sqlite3
|
3
|
+
development:
|
4
|
+
adapter: sqlite3
|
5
|
+
database: db/development.sqlite3
|
6
|
+
pool: 5
|
7
|
+
timeout: 5000
|
8
|
+
|
9
|
+
# Warning: The database defined as "test" will be erased and
|
10
|
+
# re-generated from your development database when you run "rake".
|
11
|
+
# Do not set this db to the same as development or production.
|
12
|
+
test:
|
13
|
+
adapter: sqlite3
|
14
|
+
database: db/test.sqlite3
|
15
|
+
pool: 5
|
16
|
+
timeout: 5000
|
17
|
+
|
18
|
+
production:
|
19
|
+
adapter: sqlite3
|
20
|
+
database: db/production.sqlite3
|
21
|
+
pool: 5
|
22
|
+
timeout: 5000
|
@@ -0,0 +1,26 @@
|
|
1
|
+
Dummy::Application.configure do
|
2
|
+
# Settings specified here will take precedence over those in config/application.rb
|
3
|
+
|
4
|
+
# In the development environment your application's code is reloaded on
|
5
|
+
# every request. This slows down response time but is perfect for development
|
6
|
+
# since you don't have to restart the webserver when you make code changes.
|
7
|
+
config.cache_classes = false
|
8
|
+
|
9
|
+
# Log error messages when you accidentally call methods on nil.
|
10
|
+
config.whiny_nils = true
|
11
|
+
|
12
|
+
# Show full error reports and disable caching
|
13
|
+
config.consider_all_requests_local = true
|
14
|
+
config.action_view.debug_rjs = true
|
15
|
+
config.action_controller.perform_caching = false
|
16
|
+
|
17
|
+
# Don't care if the mailer can't send
|
18
|
+
config.action_mailer.raise_delivery_errors = false
|
19
|
+
|
20
|
+
# Print deprecation notices to the Rails logger
|
21
|
+
config.active_support.deprecation = :log
|
22
|
+
|
23
|
+
# Only use best-standards-support built into browsers
|
24
|
+
config.action_dispatch.best_standards_support = :builtin
|
25
|
+
end
|
26
|
+
|