active_wrapper 0.2.6 → 0.2.7
Sign up to get free protection for your applications and to get access to all the features.
- data/gemspec.rb +1 -1
- data/lib/active_wrapper/mail.rb +4 -0
- data/spec/active_wrapper/mail_spec.rb +1 -0
- data/spec/example_project/config/mail.yml +2 -1
- metadata +2 -2
data/gemspec.rb
CHANGED
data/lib/active_wrapper/mail.rb
CHANGED
@@ -7,6 +7,7 @@ module ActiveWrapper
|
|
7
7
|
@base = options[:base]
|
8
8
|
@config = {
|
9
9
|
:smtp => options[:smtp] || {},
|
10
|
+
:sendmail => options[:sendmail] || nil,
|
10
11
|
:imap => options[:imap] || {}
|
11
12
|
}
|
12
13
|
@env = options[:env].to_s
|
@@ -18,11 +19,14 @@ module ActiveWrapper
|
|
18
19
|
if yaml && yaml[@env]
|
19
20
|
yaml = yaml[@env].to_options
|
20
21
|
@config[:imap] = yaml[:imap].to_options if yaml[:imap]
|
22
|
+
@config[:sendmail] = yaml[:sendmail] if !yaml[:sendmail].nil?
|
21
23
|
@config[:smtp] = yaml[:smtp].to_options if yaml[:smtp]
|
22
24
|
end
|
23
25
|
end
|
24
26
|
if @env == 'test'
|
25
27
|
ActionMailer::Base.delivery_method = :test
|
28
|
+
elsif @config[:sendmail]
|
29
|
+
ActionMailer::Base.delivery_method = :sendmail
|
26
30
|
elsif @config[:smtp]
|
27
31
|
ActionMailer::Base.delivery_method = :smtp
|
28
32
|
ActionMailer::Base.smtp_settings = @config[:smtp]
|
@@ -12,6 +12,7 @@ describe ActiveWrapper::Db do
|
|
12
12
|
it "should set instance variables" do
|
13
13
|
$mail.base.should =~ %r{active_wrapper/spec/example_project}
|
14
14
|
$mail.config.should == {
|
15
|
+
:sendmail => false,
|
15
16
|
:smtp => {
|
16
17
|
:address => "smtp.gmail.com",
|
17
18
|
:authentication => :plain,
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_wrapper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Winton Welsh
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2010-04-
|
12
|
+
date: 2010-04-19 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|