tobias-actionmailer_host_autoset 0.2.1 → 0.3.0
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.
- data/README.rdoc +16 -1
- data/VERSION +1 -1
- data/actionmailer_host_autoset.gemspec +2 -2
- data/lib/actionmailer_host_autoset/actionmailer_host_autoset.rb +3 -3
- metadata +2 -2
data/README.rdoc
CHANGED
@@ -10,9 +10,24 @@ In the cases when the request object is not available, for example, when
|
|
10
10
|
running tests, default values are set instead.
|
11
11
|
|
12
12
|
This is basically a repackaging of retardase_inhibitor
|
13
|
-
(http://github.com/luke0x/retardase_inhibitor), with
|
13
|
+
(http://github.com/luke0x/retardase_inhibitor), with more descriptive name and
|
14
14
|
a gemspec that will actually build on github (yay for jeweler!).
|
15
15
|
|
16
|
+
=Installation
|
17
|
+
|
18
|
+
# if you haven't already:
|
19
|
+
gem sources -a http://gems.github.com
|
20
|
+
|
21
|
+
gem install tobias-actioncontroller_host_autoset
|
22
|
+
|
23
|
+
Or, in environment.rb:
|
24
|
+
|
25
|
+
config.gem 'tobias-actionmailer_host_autoset', :source => 'http://gems.github.com', :lib => 'actionmailer_host_autoset'
|
26
|
+
|
27
|
+
Then:
|
28
|
+
|
29
|
+
rake gems:install
|
30
|
+
|
16
31
|
=Usage
|
17
32
|
|
18
33
|
Add the around_filter to the ApplicationController to set the
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.3.0
|
@@ -2,11 +2,11 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{actionmailer_host_autoset}
|
5
|
-
s.version = "0.
|
5
|
+
s.version = "0.3.0"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Tobias Crawley"]
|
9
|
-
s.date = %q{2009-
|
9
|
+
s.date = %q{2009-07-03}
|
10
10
|
s.email = %q{tcrawley@gmail.com}
|
11
11
|
s.extra_rdoc_files = [
|
12
12
|
"LICENSE",
|
@@ -8,7 +8,7 @@ module ActionmailerHostAutoset
|
|
8
8
|
def actionmailer_host_autoset
|
9
9
|
begin
|
10
10
|
request = self.request
|
11
|
-
::
|
11
|
+
::ActionMailer::Base.class_eval do
|
12
12
|
@old_default_url_options = default_url_options.clone
|
13
13
|
default_url_options[:host] = request.host
|
14
14
|
default_url_options[:port] = request.port unless [80, 443].include?(request.port)
|
@@ -17,7 +17,7 @@ module ActionmailerHostAutoset
|
|
17
17
|
end
|
18
18
|
yield
|
19
19
|
ensure
|
20
|
-
::
|
20
|
+
::ActionMailer::Base.class_eval do
|
21
21
|
default_url_options[:host] = @old_default_url_options[:host]
|
22
22
|
default_url_options[:port] = @old_default_url_options[:port] unless @old_default_url_options[:port].nil?
|
23
23
|
default_url_options[:protocol] = @old_default_url_options[:protocol]
|
@@ -30,7 +30,7 @@ module ActionmailerHostAutoset
|
|
30
30
|
module ActionMailer
|
31
31
|
def self.included(am)
|
32
32
|
am.send(:include, ::ActionController::UrlWriter)
|
33
|
-
|
33
|
+
am.class_eval do
|
34
34
|
if ENV['RAILS_ENV'] == 'test'
|
35
35
|
default_url_options[:host] = 'test.host'
|
36
36
|
default_url_options[:protocol] = 'http'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tobias-actionmailer_host_autoset
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tobias Crawley
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-07-03 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|