pdm-rails 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -31,13 +31,14 @@ module Pdm
31
31
 
32
32
  begin
33
33
  if (res = pdm_mail.deliver)
34
- case res
35
- when Net::HTTPSuccess
34
+ case res.code
35
+ when 200
36
36
  logger.debug("Delivered #{mail.subject.inspect} to #{mail.to.inspect} " +
37
37
  "via PDM #{pdm_mail.guid}.")
38
38
  return mail
39
39
  else
40
- logger.error("Unable to deliver mail via PDM: Got response #{res.inspect}.")
40
+ logger.error("Unable to deliver mail via PDM: Got response #{res.code}, " +
41
+ res.inspect)
41
42
  end
42
43
  else
43
44
  logger.error("Unable to deliver mail via PDM. No response? :-(")
@@ -10,22 +10,20 @@ module ActionMailer
10
10
  end
11
11
  alias_method_chain :view_assigns, :pdm
12
12
 
13
- def assign_pdm_template(template)
14
- return unless template.formats.include?(:html)
15
- message.template_html = template.source
16
- message.template_assigns = view_assigns_with_pdm
13
+ def apply_personalization
14
+ message.personalization = view_assigns_with_pdm
17
15
  end
18
-
16
+
17
+ # The result of this method is shoved in 'message.body'
19
18
  def render_with_pdm(opts)
20
19
  if ::Pdm::Rails::Delivery === message.delivery_method &&
21
20
  message.delivery_method.personalization?
22
- assign_pdm_template(opts[:template])
23
- return("") # The result of this method is shoved in 'body'
21
+ apply_personalization
22
+ return opts[:template].source
24
23
  end
25
24
 
26
25
  return render_without_pdm(opts)
27
26
  end
28
-
27
+ alias_method_chain :render, :pdm
29
28
  end
30
- alias_method_chain :render, :pdm
31
29
  end
@@ -2,7 +2,7 @@ module Pdm
2
2
  module Rails
3
3
 
4
4
  def version
5
- "0.0.5"
5
+ "0.0.6"
6
6
  end
7
7
  module_function :version
8
8
  end
metadata CHANGED
@@ -1,76 +1,56 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: pdm-rails
3
- version: !ruby/object:Gem::Version
4
- hash: 21
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.6
5
5
  prerelease:
6
- segments:
7
- - 0
8
- - 0
9
- - 5
10
- version: 0.0.5
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - PipeDevMail
14
9
  autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
-
18
- date: 2011-11-20 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: 3
27
- segments:
28
- - 0
29
- version: "0"
30
- prerelease: false
31
- requirement: *id001
32
- type: :development
12
+ date: 2012-03-07 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
33
15
  name: rake
34
- - !ruby/object:Gem::Dependency
35
- version_requirements: &id002 !ruby/object:Gem::Requirement
16
+ requirement: &20829820 !ruby/object:Gem::Requirement
36
17
  none: false
37
- requirements:
38
- - - ">="
39
- - !ruby/object:Gem::Version
40
- hash: 7
41
- segments:
42
- - 3
43
- - 0
44
- - 0
45
- version: 3.0.0
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
22
+ type: :development
46
23
  prerelease: false
47
- requirement: *id002
48
- type: :runtime
24
+ version_requirements: *20829820
25
+ - !ruby/object:Gem::Dependency
49
26
  name: rails
50
- - !ruby/object:Gem::Dependency
51
- version_requirements: &id003 !ruby/object:Gem::Requirement
27
+ requirement: &20827420 !ruby/object:Gem::Requirement
52
28
  none: false
53
- requirements:
54
- - - ">="
55
- - !ruby/object:Gem::Version
56
- hash: 3
57
- segments:
58
- - 0
59
- version: "0"
60
- prerelease: false
61
- requirement: *id003
29
+ requirements:
30
+ - - ! '>='
31
+ - !ruby/object:Gem::Version
32
+ version: 3.0.0
62
33
  type: :runtime
34
+ prerelease: false
35
+ version_requirements: *20827420
36
+ - !ruby/object:Gem::Dependency
63
37
  name: pdm
38
+ requirement: &20825940 !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ! '>='
42
+ - !ruby/object:Gem::Version
43
+ version: '0'
44
+ type: :runtime
45
+ prerelease: false
46
+ version_requirements: *20825940
64
47
  description: Use the PipeDevMail gem within Rails
65
- email:
48
+ email:
66
49
  - support@pipedevmail.com
67
50
  executables: []
68
-
69
51
  extensions: []
70
-
71
52
  extra_rdoc_files: []
72
-
73
- files:
53
+ files:
74
54
  - .gitignore
75
55
  - Gemfile
76
56
  - Rakefile
@@ -80,38 +60,34 @@ files:
80
60
  - lib/pdm-rails/railtie.rb
81
61
  - lib/pdm-rails/version.rb
82
62
  - pdm-rails.gemspec
83
- homepage: ""
63
+ homepage: ''
84
64
  licenses: []
85
-
86
65
  post_install_message:
87
66
  rdoc_options: []
88
-
89
- require_paths:
67
+ require_paths:
90
68
  - lib
91
- required_ruby_version: !ruby/object:Gem::Requirement
69
+ required_ruby_version: !ruby/object:Gem::Requirement
92
70
  none: false
93
- requirements:
94
- - - ">="
95
- - !ruby/object:Gem::Version
96
- hash: 3
97
- segments:
71
+ requirements:
72
+ - - ! '>='
73
+ - !ruby/object:Gem::Version
74
+ version: '0'
75
+ segments:
98
76
  - 0
99
- version: "0"
100
- required_rubygems_version: !ruby/object:Gem::Requirement
77
+ hash: -2900027422427818904
78
+ required_rubygems_version: !ruby/object:Gem::Requirement
101
79
  none: false
102
- requirements:
103
- - - ">="
104
- - !ruby/object:Gem::Version
105
- hash: 3
106
- segments:
80
+ requirements:
81
+ - - ! '>='
82
+ - !ruby/object:Gem::Version
83
+ version: '0'
84
+ segments:
107
85
  - 0
108
- version: "0"
86
+ hash: -2900027422427818904
109
87
  requirements: []
110
-
111
88
  rubyforge_project:
112
- rubygems_version: 1.8.11
89
+ rubygems_version: 1.8.10
113
90
  signing_key:
114
91
  specification_version: 3
115
92
  summary: Interact with the PDM API from Rails
116
93
  test_files: []
117
-