email_preview 1.5.1 → 1.5.2

Sign up to get free protection for your applications and to get access to all the features.
data/.rvmrc CHANGED
@@ -1 +1 @@
1
- rvm use ree-1.8.7-2011.03@email_preview --create
1
+ rvm use ruby-1.9.3@email_preview --create
@@ -3,18 +3,12 @@ class EmailPreviewController < ApplicationController
3
3
  layout false
4
4
 
5
5
  before_filter :enforce_allowed_environments
6
+ around_filter :set_delivery_method, :only => :deliver
6
7
  before_filter :build_email, :only => [:show, :deliver, :details, :preview]
7
8
 
8
9
  def deliver
9
10
  @mail.to params[:to]
10
-
11
- previous_delivery_method = ActionMailer::Base.delivery_method
12
- begin
13
- ActionMailer::Base.delivery_method = EmailPreview.delivery_method if EmailPreview.delivery_method
14
- @mail.deliver
15
- ensure
16
- ActionMailer::Base.delivery_method = previous_delivery_method
17
- end
11
+ @mail.respond_to?(:deliver_now) ? @mail.deliver_now : @mail.deliver
18
12
  redirect_to details_email_preview_path(params[:id])
19
13
  end
20
14
  def preview
@@ -34,4 +28,11 @@ class EmailPreviewController < ApplicationController
34
28
  @mail = EmailPreview.preview params[:id]
35
29
  @parts = @mail.multipart? ? @mail.parts : [@mail]
36
30
  end
31
+ def set_delivery_method
32
+ previous_delivery_method = ActionMailer::Base.delivery_method
33
+ ActionMailer::Base.delivery_method = EmailPreview.delivery_method if EmailPreview.delivery_method
34
+ yield
35
+ ensure
36
+ ActionMailer::Base.delivery_method = previous_delivery_method
37
+ end
37
38
  end
@@ -1,3 +1,3 @@
1
1
  module EmailPreview
2
- VERSION = "1.5.1"
2
+ VERSION = "1.5.2"
3
3
  end
metadata CHANGED
@@ -1,93 +1,88 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: email_preview
3
- version: !ruby/object:Gem::Version
4
- hash: 1
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.5.2
5
5
  prerelease:
6
- segments:
7
- - 1
8
- - 5
9
- - 1
10
- version: 1.5.1
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Ryan Sonnek
14
9
  autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
-
18
- date: 2012-05-18 00:00:00 Z
19
- dependencies:
20
- - !ruby/object:Gem::Dependency
21
- version_requirements: &id001 !ruby/object:Gem::Requirement
22
- none: false
23
- requirements:
24
- - - ">="
25
- - !ruby/object:Gem::Version
26
- hash: 7
27
- segments:
28
- - 3
29
- - 0
30
- version: "3.0"
31
- requirement: *id001
32
- prerelease: false
12
+ date: 2012-10-09 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
33
15
  name: rails
34
- type: :runtime
35
- - !ruby/object:Gem::Dependency
36
- version_requirements: &id002 !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
37
17
  none: false
38
- requirements:
39
- - - ">="
40
- - !ruby/object:Gem::Version
41
- hash: 3
42
- segments:
43
- - 0
44
- version: "0"
45
- requirement: *id002
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '3.0'
22
+ type: :runtime
46
23
  prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '3.0'
30
+ - !ruby/object:Gem::Dependency
47
31
  name: shoulda
48
- type: :development
49
- - !ruby/object:Gem::Dependency
50
- version_requirements: &id003 !ruby/object:Gem::Requirement
32
+ requirement: !ruby/object:Gem::Requirement
51
33
  none: false
52
- requirements:
53
- - - "="
54
- - !ruby/object:Gem::Version
55
- hash: 63
56
- segments:
57
- - 0
58
- - 9
59
- - 2
60
- version: 0.9.2
61
- requirement: *id003
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ type: :development
62
39
  prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
46
+ - !ruby/object:Gem::Dependency
63
47
  name: rake
64
- type: :development
65
- - !ruby/object:Gem::Dependency
66
- version_requirements: &id004 !ruby/object:Gem::Requirement
48
+ requirement: !ruby/object:Gem::Requirement
67
49
  none: false
68
- requirements:
69
- - - "="
70
- - !ruby/object:Gem::Version
71
- hash: 19
72
- segments:
73
- - 1
74
- - 3
75
- - 4
76
- version: 1.3.4
77
- requirement: *id004
50
+ requirements:
51
+ - - '='
52
+ - !ruby/object:Gem::Version
53
+ version: 0.9.2
54
+ type: :development
78
55
  prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - '='
60
+ - !ruby/object:Gem::Version
61
+ version: 0.9.2
62
+ - !ruby/object:Gem::Dependency
79
63
  name: sqlite3
64
+ requirement: !ruby/object:Gem::Requirement
65
+ none: false
66
+ requirements:
67
+ - - '='
68
+ - !ruby/object:Gem::Version
69
+ version: 1.3.4
80
70
  type: :development
81
- description: render and send sample html and plain text emails to see what they will *really* look like
82
- email:
71
+ prerelease: false
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - '='
76
+ - !ruby/object:Gem::Version
77
+ version: 1.3.4
78
+ description: render and send sample html and plain text emails to see what they will
79
+ *really* look like
80
+ email:
83
81
  - ryan@codecrate.com
84
82
  executables: []
85
-
86
83
  extensions: []
87
-
88
84
  extra_rdoc_files: []
89
-
90
- files:
85
+ files:
91
86
  - .document
92
87
  - .gitignore
93
88
  - .rvmrc
@@ -143,40 +138,37 @@ files:
143
138
  - test/dummy/script/rails
144
139
  - test/helper.rb
145
140
  - test/test_email_preview.rb
146
- homepage: ""
141
+ homepage: ''
147
142
  licenses: []
148
-
149
143
  post_install_message:
150
144
  rdoc_options: []
151
-
152
- require_paths:
145
+ require_paths:
153
146
  - lib
154
- required_ruby_version: !ruby/object:Gem::Requirement
147
+ required_ruby_version: !ruby/object:Gem::Requirement
155
148
  none: false
156
- requirements:
157
- - - ">="
158
- - !ruby/object:Gem::Version
159
- hash: 3
160
- segments:
149
+ requirements:
150
+ - - ! '>='
151
+ - !ruby/object:Gem::Version
152
+ version: '0'
153
+ segments:
161
154
  - 0
162
- version: "0"
163
- required_rubygems_version: !ruby/object:Gem::Requirement
155
+ hash: -3068805024756900553
156
+ required_rubygems_version: !ruby/object:Gem::Requirement
164
157
  none: false
165
- requirements:
166
- - - ">="
167
- - !ruby/object:Gem::Version
168
- hash: 3
169
- segments:
158
+ requirements:
159
+ - - ! '>='
160
+ - !ruby/object:Gem::Version
161
+ version: '0'
162
+ segments:
170
163
  - 0
171
- version: "0"
164
+ hash: -3068805024756900553
172
165
  requirements: []
173
-
174
166
  rubyforge_project: email_preview
175
- rubygems_version: 1.8.10
167
+ rubygems_version: 1.8.24
176
168
  signing_key:
177
169
  specification_version: 3
178
170
  summary: simple tool to preview emails in development environment
179
- test_files:
171
+ test_files:
180
172
  - test/dummy/Rakefile
181
173
  - test/dummy/app/assets/javascripts/application.js
182
174
  - test/dummy/app/assets/stylesheets/application.css