api_mailer 0.0.1 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -18,4 +18,5 @@ Gem::Specification.new do |gem|
18
18
  gem.add_development_dependency "debugger"
19
19
  gem.add_dependency "actionpack", ">= 3.0"
20
20
  gem.add_dependency "activesupport", ">= 3.0"
21
+ gem.add_dependency "hashie"
21
22
  end
@@ -1,6 +1,7 @@
1
1
  require "api_mailer/base"
2
2
  require "api_mailer/configuration"
3
3
  require 'abstract_controller'
4
+ require 'hashie'
4
5
 
5
6
  module ApiMailer
6
7
  end
@@ -4,6 +4,11 @@ module ApiMailer
4
4
  abstract!
5
5
 
6
6
  include AbstractController::Rendering
7
+ include AbstractController::Logger
8
+ include AbstractController::Helpers
9
+ include AbstractController::Translation
10
+ include AbstractController::AssetPaths
11
+ include AbstractController::Callbacks
7
12
 
8
13
  attr_accessor :action_name
9
14
  attr_accessor :responses
@@ -50,7 +55,7 @@ module ApiMailer
50
55
  end
51
56
 
52
57
  # Handle defaults
53
- self.headers = ActiveSupport::HashWithIndifferentAccess.new(headers.reverse_merge(default_values))
58
+ self.headers = ActiveSupport::HashWithIndifferentAccess.new(headers.reverse_merge(default_values)) || {}
54
59
 
55
60
  collect_responses(headers)
56
61
  end
@@ -71,7 +76,7 @@ module ApiMailer
71
76
 
72
77
  self.responses << {
73
78
  body: render(template: template),
74
- content_type: template.type.to_s
79
+ content_type: (template.respond_to?(:type) ? template.type : template.mime_type).to_s
75
80
  }
76
81
  end
77
82
  end
@@ -1,3 +1,3 @@
1
1
  module ApiMailer
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: api_mailer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-10-25 00:00:00.000000000 Z
12
+ date: 2013-10-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
@@ -75,6 +75,22 @@ dependencies:
75
75
  - - ! '>='
76
76
  - !ruby/object:Gem::Version
77
77
  version: '3.0'
78
+ - !ruby/object:Gem::Dependency
79
+ name: hashie
80
+ requirement: !ruby/object:Gem::Requirement
81
+ none: false
82
+ requirements:
83
+ - - ! '>='
84
+ - !ruby/object:Gem::Version
85
+ version: '0'
86
+ type: :runtime
87
+ prerelease: false
88
+ version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
90
+ requirements:
91
+ - - ! '>='
92
+ - !ruby/object:Gem::Version
93
+ version: '0'
78
94
  description: A simple replication of ActionMailer for API based mailing that doesn't
79
95
  require the mail gem
80
96
  email: