actionmailer-with-request 0.3.0 → 0.4.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/{LICENSE → LICENSE.txt} +1 -1
- data/README.md +38 -0
- data/Rakefile +4 -0
- data/actionmailer-with-request.gemspec +1 -3
- data/lib/actionmailer_with_request.rb +3 -7
- metadata +43 -41
- data/README +0 -36
data/{LICENSE → LICENSE.txt}
RENAMED
data/README.md
ADDED
@@ -0,0 +1,38 @@
|
|
1
|
+
# ActionMailer with Request
|
2
|
+
|
3
|
+
This is a simple plugin that aims to solve the problem to pass a dynamic host for generating URLs in ActionMailer.
|
4
|
+
|
5
|
+
For more information, read my blog post at
|
6
|
+
http://www.simonecarletti.com/blog/2009/10/actionmailer-and-host-value/
|
7
|
+
|
8
|
+
|
9
|
+
## Requirements
|
10
|
+
|
11
|
+
- Rails 3
|
12
|
+
|
13
|
+
Please note
|
14
|
+
|
15
|
+
- ActionMailerWithRequest >= 0.3 requires Rails 3.
|
16
|
+
- Use ActionMailerWithRequest 0.2.x with Rails 2.
|
17
|
+
|
18
|
+
|
19
|
+
## Installation
|
20
|
+
|
21
|
+
$ gem install actionmailer-with-request
|
22
|
+
|
23
|
+
|
24
|
+
## Author
|
25
|
+
|
26
|
+
- [Simone Carletti](http://www.simonecarletti.com/) <weppos@weppos.net>
|
27
|
+
|
28
|
+
|
29
|
+
## Contributors
|
30
|
+
|
31
|
+
- Eric Anderson
|
32
|
+
- Didier Lafforgue
|
33
|
+
|
34
|
+
|
35
|
+
## License
|
36
|
+
|
37
|
+
Copyright (c) 2009-2012 Simone Carletti.
|
38
|
+
This is Free Software distributed under the MIT license.
|
data/Rakefile
CHANGED
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
|
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = "actionmailer-with-request"
|
6
|
-
s.version = "0.
|
6
|
+
s.version = "0.4.0"
|
7
7
|
s.platform = Gem::Platform::RUBY
|
8
8
|
s.authors = "Simone Carletti"
|
9
9
|
s.email = "weppos@weppos.net"
|
@@ -17,6 +17,4 @@ Gem::Specification.new do |s|
|
|
17
17
|
s.require_paths = ["lib"]
|
18
18
|
|
19
19
|
s.add_dependency "rails", ">= 3"
|
20
|
-
|
21
|
-
s.rdoc_options << "--main" << "README"
|
22
20
|
end
|
@@ -1,7 +1,6 @@
|
|
1
1
|
module ActionMailerWithRequest
|
2
2
|
|
3
3
|
module ControllerMixin
|
4
|
-
|
5
4
|
def self.included(base)
|
6
5
|
base.class_eval do
|
7
6
|
before_filter :store_request
|
@@ -9,13 +8,11 @@ module ActionMailerWithRequest
|
|
9
8
|
end
|
10
9
|
|
11
10
|
def store_request
|
12
|
-
Thread.current[
|
11
|
+
Thread.current["actiondispatch.request"] = request
|
13
12
|
end
|
14
|
-
|
15
13
|
end
|
16
14
|
|
17
15
|
module MailerDefaultUrlOptions
|
18
|
-
|
19
16
|
def self.included(base)
|
20
17
|
base.class_eval <<-RUBY, __FILE__, __LINE__ + 1
|
21
18
|
# Extends ActionMailer#default_url_options capabilities
|
@@ -24,7 +21,7 @@ module ActionMailerWithRequest
|
|
24
21
|
# Returns the default url options Hash.
|
25
22
|
def default_url_options_with_current_request(*args)
|
26
23
|
defaults = {}
|
27
|
-
request = Thread.current[
|
24
|
+
request = Thread.current["actiondispatch.request"]
|
28
25
|
|
29
26
|
if request
|
30
27
|
host = request.host
|
@@ -53,9 +50,8 @@ module ActionMailerWithRequest
|
|
53
50
|
# request then this method returns nil. Hence the try(:domain)
|
54
51
|
# as well as the fallback domain.
|
55
52
|
def request
|
56
|
-
Thread.current[
|
53
|
+
Thread.current["actiondispatch.request"]
|
57
54
|
end
|
58
|
-
|
59
55
|
end
|
60
56
|
|
61
57
|
class Railtie < Rails::Railtie
|
metadata
CHANGED
@@ -1,41 +1,43 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: actionmailer-with-request
|
3
|
-
version: !ruby/object:Gem::Version
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.4.0
|
4
5
|
prerelease:
|
5
|
-
version: 0.3.0
|
6
6
|
platform: ruby
|
7
|
-
authors:
|
7
|
+
authors:
|
8
8
|
- Simone Carletti
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
- !ruby/object:Gem::Dependency
|
12
|
+
date: 2012-10-15 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
16
15
|
name: rails
|
17
|
-
|
18
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
19
17
|
none: false
|
20
|
-
requirements:
|
21
|
-
- -
|
22
|
-
- !ruby/object:Gem::Version
|
23
|
-
version:
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '3'
|
24
22
|
type: :runtime
|
25
|
-
|
26
|
-
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '3'
|
30
|
+
description: Let's ActionMailer know about the request context to avoid having to
|
31
|
+
set a number of defaults manually.
|
27
32
|
email: weppos@weppos.net
|
28
33
|
executables: []
|
29
|
-
|
30
34
|
extensions: []
|
31
|
-
|
32
35
|
extra_rdoc_files: []
|
33
|
-
|
34
|
-
files:
|
36
|
+
files:
|
35
37
|
- .gitignore
|
36
38
|
- Gemfile
|
37
|
-
- LICENSE
|
38
|
-
- README
|
39
|
+
- LICENSE.txt
|
40
|
+
- README.md
|
39
41
|
- Rakefile
|
40
42
|
- actionmailer-with-request.gemspec
|
41
43
|
- init.rb
|
@@ -43,32 +45,32 @@ files:
|
|
43
45
|
- lib/actionmailer_with_request.rb
|
44
46
|
homepage: http://github.com/weppos/actionmailer_with_request
|
45
47
|
licenses: []
|
46
|
-
|
47
48
|
post_install_message:
|
48
|
-
rdoc_options:
|
49
|
-
|
50
|
-
- README
|
51
|
-
require_paths:
|
49
|
+
rdoc_options: []
|
50
|
+
require_paths:
|
52
51
|
- lib
|
53
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
52
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
54
53
|
none: false
|
55
|
-
requirements:
|
56
|
-
- -
|
57
|
-
- !ruby/object:Gem::Version
|
58
|
-
version:
|
59
|
-
|
54
|
+
requirements:
|
55
|
+
- - ! '>='
|
56
|
+
- !ruby/object:Gem::Version
|
57
|
+
version: '0'
|
58
|
+
segments:
|
59
|
+
- 0
|
60
|
+
hash: -2861886898297731627
|
61
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
60
62
|
none: false
|
61
|
-
requirements:
|
62
|
-
- -
|
63
|
-
- !ruby/object:Gem::Version
|
64
|
-
version:
|
63
|
+
requirements:
|
64
|
+
- - ! '>='
|
65
|
+
- !ruby/object:Gem::Version
|
66
|
+
version: '0'
|
67
|
+
segments:
|
68
|
+
- 0
|
69
|
+
hash: -2861886898297731627
|
65
70
|
requirements: []
|
66
|
-
|
67
71
|
rubyforge_project:
|
68
|
-
rubygems_version: 1.
|
72
|
+
rubygems_version: 1.8.24
|
69
73
|
signing_key:
|
70
74
|
specification_version: 3
|
71
75
|
summary: Let's ActionMailer know about the website.
|
72
76
|
test_files: []
|
73
|
-
|
74
|
-
has_rdoc:
|
data/README
DELETED
@@ -1,36 +0,0 @@
|
|
1
|
-
= ActionMailer with Request
|
2
|
-
|
3
|
-
This is a simple plugin that aims to solve the problem to pass a dynamic host for generating URLs in ActionMailer.
|
4
|
-
|
5
|
-
For more information, read my blog post at
|
6
|
-
http://www.simonecarletti.com/blog/2009/10/actionmailer-and-host-value/
|
7
|
-
|
8
|
-
|
9
|
-
== Requirements
|
10
|
-
|
11
|
-
* Rails 3
|
12
|
-
|
13
|
-
Please note
|
14
|
-
|
15
|
-
* ActionMailerWithRequest >= 0.3 requires Rails 3. Use TabsOnRails 0.2.x with Rails 2.
|
16
|
-
|
17
|
-
|
18
|
-
== Installation
|
19
|
-
|
20
|
-
$ gem install actionmailer-with-request
|
21
|
-
|
22
|
-
|
23
|
-
== Author
|
24
|
-
|
25
|
-
* {Simone Carletti}[http://www.simonecarletti.com] <weppos@weppos.net>
|
26
|
-
|
27
|
-
|
28
|
-
== Contributors
|
29
|
-
|
30
|
-
Eric Anderson, Didier Lafforgue.
|
31
|
-
|
32
|
-
|
33
|
-
== License
|
34
|
-
|
35
|
-
ActionMailerWithRequest is Copyright (c) 2009-2011 Simone Carletti.
|
36
|
-
This is Free Software distributed under the MIT license.
|