mail_male_mail 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +18 -0
- data/README.md +4 -0
- data/Rakefile +1 -0
- data/lib/mail_male_mail/configuration.rb +15 -0
- data/lib/mail_male_mail/version.rb +3 -0
- data/lib/mail_male_mail.rb +33 -0
- data/mail_male_mail.gemspec +18 -0
- metadata +68 -0
data/.gitignore
ADDED
data/README.md
ADDED
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
@@ -0,0 +1,15 @@
|
|
1
|
+
require "yaml"
|
2
|
+
|
3
|
+
module MailMaleMail
|
4
|
+
class Configuration
|
5
|
+
class <<self
|
6
|
+
def load
|
7
|
+
@configurations ||= YAML.load(ERB.new(File.read(Rails.root.join("config/mail_male_mail.yml"))).result)[Rails.env]
|
8
|
+
end
|
9
|
+
|
10
|
+
def get(name)
|
11
|
+
@configurations and @configurations[name.to_s]
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
require "yaml"
|
2
|
+
require "action_mailer"
|
3
|
+
|
4
|
+
module MailMaleMail
|
5
|
+
autoload :Configuration, "mail_male_mail/configuration"
|
6
|
+
|
7
|
+
|
8
|
+
if defined? Rails::Railtie
|
9
|
+
class MailMaleMailRailtie < Rails::Railtie
|
10
|
+
initializer "mail_male_mail_initializer" do |app|
|
11
|
+
ActionMailer::Base.send(:include, MailMaleMail)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
def self.included(base)
|
17
|
+
base.extend(ClassMethods)
|
18
|
+
base.class_eval do
|
19
|
+
Configuration.load
|
20
|
+
mailman('default')
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
module ClassMethods
|
25
|
+
def mailman(name)
|
26
|
+
config = Configuration.get(name)
|
27
|
+
if config
|
28
|
+
self.delivery_method = config['delivery_method'].to_sym if config.key?('delivery_method')
|
29
|
+
self.smtp_settings = config['smtp_settings'].symbolize_keys if config.key?('smtp_settings') && config['smtp_settings'].is_a?(Hash)
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
require File.expand_path('../lib/mail_male_mail/version', __FILE__)
|
2
|
+
|
3
|
+
Gem::Specification.new do |gem|
|
4
|
+
gem.authors = ["Carl Allen"]
|
5
|
+
gem.email = ["github@allenofmn.com"]
|
6
|
+
gem.description = %q{extend actionmailer to work with multiple mail providers}
|
7
|
+
gem.summary = %q{extend actionmailer to work with multiple mail providers}
|
8
|
+
gem.homepage = "http://github.com/carlallen/mail_male_mail"
|
9
|
+
|
10
|
+
gem.files = `git ls-files`.split($\)
|
11
|
+
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
12
|
+
gem.test_files = gem.files.grep(%r{^(spec)/})
|
13
|
+
gem.name = "mail_male_mail"
|
14
|
+
gem.require_paths = ["lib"]
|
15
|
+
gem.version = MailMaleMail::VERSION
|
16
|
+
|
17
|
+
gem.add_development_dependency "actionmailer"
|
18
|
+
end
|
metadata
ADDED
@@ -0,0 +1,68 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: mail_male_mail
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Carl Allen
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2013-04-17 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: actionmailer
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
22
|
+
type: :development
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0'
|
30
|
+
description: extend actionmailer to work with multiple mail providers
|
31
|
+
email:
|
32
|
+
- github@allenofmn.com
|
33
|
+
executables: []
|
34
|
+
extensions: []
|
35
|
+
extra_rdoc_files: []
|
36
|
+
files:
|
37
|
+
- .gitignore
|
38
|
+
- README.md
|
39
|
+
- Rakefile
|
40
|
+
- lib/mail_male_mail.rb
|
41
|
+
- lib/mail_male_mail/configuration.rb
|
42
|
+
- lib/mail_male_mail/version.rb
|
43
|
+
- mail_male_mail.gemspec
|
44
|
+
homepage: http://github.com/carlallen/mail_male_mail
|
45
|
+
licenses: []
|
46
|
+
post_install_message:
|
47
|
+
rdoc_options: []
|
48
|
+
require_paths:
|
49
|
+
- lib
|
50
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
51
|
+
none: false
|
52
|
+
requirements:
|
53
|
+
- - ! '>='
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: '0'
|
56
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
requirements: []
|
63
|
+
rubyforge_project:
|
64
|
+
rubygems_version: 1.8.23
|
65
|
+
signing_key:
|
66
|
+
specification_version: 3
|
67
|
+
summary: extend actionmailer to work with multiple mail providers
|
68
|
+
test_files: []
|