drill-mailer 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +13 -0
- data/.rspec +3 -0
- data/.ruby-version +1 -0
- data/.travis.yml +7 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +6 -0
- data/Gemfile.lock +71 -0
- data/LICENSE.txt +21 -0
- data/README.md +43 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/drill.gemspec +36 -0
- data/lib/drill.rb +29 -0
- data/lib/drill/mail.rb +23 -0
- data/lib/drill/mail/base.rb +9 -0
- data/lib/drill/mail/default.rb +50 -0
- data/lib/drill/mail/letter_opener.rb +51 -0
- data/lib/drill/mailer.rb +58 -0
- data/lib/drill/params.rb +12 -0
- data/lib/drill/version.rb +3 -0
- metadata +163 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 3b648fb7c1d316913b407a23bf3e44b23020e31cda2ca42509d5496870a6344e
|
4
|
+
data.tar.gz: 5845d4b67de355009f61820588db6cea4495d4f45c50c2f12fbb1414286ee8ed
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 3543d3c1be11433a103e386003d4bdff742f547fc4920b142f0bc1e2709347f35f98f964542f7e4496f5d80b967901c1fc94ec89cc478fda8c5c60abb22055b0
|
7
|
+
data.tar.gz: 3431ca7c2f0a4da36eed8b7b19d92cf4d1c654fcc07ff4fcebdd672c92353c489f2238a4fdeab6eeb45533e775b8c5920344610a68c39a64dc5bd1af04e4f998
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
2.5.1
|
data/.travis.yml
ADDED
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
2
|
+
|
3
|
+
## Our Pledge
|
4
|
+
|
5
|
+
In the interest of fostering an open and welcoming environment, we as
|
6
|
+
contributors and maintainers pledge to making participation in our project and
|
7
|
+
our community a harassment-free experience for everyone, regardless of age, body
|
8
|
+
size, disability, ethnicity, gender identity and expression, level of experience,
|
9
|
+
nationality, personal appearance, race, religion, or sexual identity and
|
10
|
+
orientation.
|
11
|
+
|
12
|
+
## Our Standards
|
13
|
+
|
14
|
+
Examples of behavior that contributes to creating a positive environment
|
15
|
+
include:
|
16
|
+
|
17
|
+
* Using welcoming and inclusive language
|
18
|
+
* Being respectful of differing viewpoints and experiences
|
19
|
+
* Gracefully accepting constructive criticism
|
20
|
+
* Focusing on what is best for the community
|
21
|
+
* Showing empathy towards other community members
|
22
|
+
|
23
|
+
Examples of unacceptable behavior by participants include:
|
24
|
+
|
25
|
+
* The use of sexualized language or imagery and unwelcome sexual attention or
|
26
|
+
advances
|
27
|
+
* Trolling, insulting/derogatory comments, and personal or political attacks
|
28
|
+
* Public or private harassment
|
29
|
+
* Publishing others' private information, such as a physical or electronic
|
30
|
+
address, without explicit permission
|
31
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
32
|
+
professional setting
|
33
|
+
|
34
|
+
## Our Responsibilities
|
35
|
+
|
36
|
+
Project maintainers are responsible for clarifying the standards of acceptable
|
37
|
+
behavior and are expected to take appropriate and fair corrective action in
|
38
|
+
response to any instances of unacceptable behavior.
|
39
|
+
|
40
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
41
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
42
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
43
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
44
|
+
threatening, offensive, or harmful.
|
45
|
+
|
46
|
+
## Scope
|
47
|
+
|
48
|
+
This Code of Conduct applies both within project spaces and in public spaces
|
49
|
+
when an individual is representing the project or its community. Examples of
|
50
|
+
representing a project or community include using an official project e-mail
|
51
|
+
address, posting via an official social media account, or acting as an appointed
|
52
|
+
representative at an online or offline event. Representation of a project may be
|
53
|
+
further defined and clarified by project maintainers.
|
54
|
+
|
55
|
+
## Enforcement
|
56
|
+
|
57
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
58
|
+
reported by contacting the project team at i.demukh@appodeal.com. All
|
59
|
+
complaints will be reviewed and investigated and will result in a response that
|
60
|
+
is deemed necessary and appropriate to the circumstances. The project team is
|
61
|
+
obligated to maintain confidentiality with regard to the reporter of an incident.
|
62
|
+
Further details of specific enforcement policies may be posted separately.
|
63
|
+
|
64
|
+
Project maintainers who do not follow or enforce the Code of Conduct in good
|
65
|
+
faith may face temporary or permanent repercussions as determined by other
|
66
|
+
members of the project's leadership.
|
67
|
+
|
68
|
+
## Attribution
|
69
|
+
|
70
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
71
|
+
available at [http://contributor-covenant.org/version/1/4][version]
|
72
|
+
|
73
|
+
[homepage]: http://contributor-covenant.org
|
74
|
+
[version]: http://contributor-covenant.org/version/1/4/
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,71 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
drill-mailer (0.1.0)
|
5
|
+
mandrill-api (~> 1.0)
|
6
|
+
|
7
|
+
GEM
|
8
|
+
remote: https://rubygems.org/
|
9
|
+
specs:
|
10
|
+
addressable (2.5.2)
|
11
|
+
public_suffix (>= 2.0.2, < 4.0)
|
12
|
+
ast (2.4.0)
|
13
|
+
diff-lcs (1.3)
|
14
|
+
excon (0.62.0)
|
15
|
+
jaro_winkler (1.5.1)
|
16
|
+
json (1.8.6)
|
17
|
+
launchy (2.4.3)
|
18
|
+
addressable (~> 2.3)
|
19
|
+
letter_opener (1.6.0)
|
20
|
+
launchy (~> 2.2)
|
21
|
+
mail (2.7.0)
|
22
|
+
mini_mime (>= 0.1.1)
|
23
|
+
mandrill-api (1.0.53)
|
24
|
+
excon (>= 0.16.0, < 1.0)
|
25
|
+
json (>= 1.7.7, < 2.0)
|
26
|
+
mini_mime (1.0.1)
|
27
|
+
parallel (1.12.1)
|
28
|
+
parser (2.5.1.2)
|
29
|
+
ast (~> 2.4.0)
|
30
|
+
powerpack (0.1.2)
|
31
|
+
public_suffix (3.0.3)
|
32
|
+
rainbow (3.0.0)
|
33
|
+
rake (10.5.0)
|
34
|
+
rspec (3.8.0)
|
35
|
+
rspec-core (~> 3.8.0)
|
36
|
+
rspec-expectations (~> 3.8.0)
|
37
|
+
rspec-mocks (~> 3.8.0)
|
38
|
+
rspec-core (3.8.0)
|
39
|
+
rspec-support (~> 3.8.0)
|
40
|
+
rspec-expectations (3.8.1)
|
41
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
42
|
+
rspec-support (~> 3.8.0)
|
43
|
+
rspec-mocks (3.8.0)
|
44
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
45
|
+
rspec-support (~> 3.8.0)
|
46
|
+
rspec-support (3.8.0)
|
47
|
+
rubocop (0.59.0)
|
48
|
+
jaro_winkler (~> 1.5.1)
|
49
|
+
parallel (~> 1.10)
|
50
|
+
parser (>= 2.5, != 2.5.1.1)
|
51
|
+
powerpack (~> 0.1)
|
52
|
+
rainbow (>= 2.2.2, < 4.0)
|
53
|
+
ruby-progressbar (~> 1.7)
|
54
|
+
unicode-display_width (~> 1.0, >= 1.0.1)
|
55
|
+
ruby-progressbar (1.10.0)
|
56
|
+
unicode-display_width (1.4.0)
|
57
|
+
|
58
|
+
PLATFORMS
|
59
|
+
ruby
|
60
|
+
|
61
|
+
DEPENDENCIES
|
62
|
+
bundler (~> 1.16)
|
63
|
+
drill-mailer!
|
64
|
+
letter_opener (~> 1.6)
|
65
|
+
mail (~> 2.7)
|
66
|
+
rake (~> 10.0)
|
67
|
+
rspec (~> 3.0)
|
68
|
+
rubocop (~> 0.0)
|
69
|
+
|
70
|
+
BUNDLED WITH
|
71
|
+
1.16.4
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2018 TODO: Write your name
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,43 @@
|
|
1
|
+
# Drill
|
2
|
+
|
3
|
+
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/drill`. To experiment with that code, run `bin/console` for an interactive prompt.
|
4
|
+
|
5
|
+
TODO: Delete this and the text above, and describe your gem
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Add this line to your application's Gemfile:
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
gem 'drill-mailer'
|
13
|
+
```
|
14
|
+
|
15
|
+
And then execute:
|
16
|
+
|
17
|
+
$ bundle
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
|
21
|
+
$ gem install drill-mailer
|
22
|
+
|
23
|
+
## Usage
|
24
|
+
|
25
|
+
TODO: Write usage instructions here
|
26
|
+
|
27
|
+
## Development
|
28
|
+
|
29
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
30
|
+
|
31
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
32
|
+
|
33
|
+
## Contributing
|
34
|
+
|
35
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/drill. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
36
|
+
|
37
|
+
## License
|
38
|
+
|
39
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
40
|
+
|
41
|
+
## Code of Conduct
|
42
|
+
|
43
|
+
Everyone interacting in the Drill project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/drill/blob/master/CODE_OF_CONDUCT.md).
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "drill"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start(__FILE__)
|
data/bin/setup
ADDED
data/drill.gemspec
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
lib = File.expand_path('lib', __dir__)
|
4
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
5
|
+
require 'drill/version'
|
6
|
+
|
7
|
+
Gem::Specification.new do |spec|
|
8
|
+
spec.name = 'drill-mailer'
|
9
|
+
spec.version = Drill::VERSION
|
10
|
+
spec.authors = ['Ilya Demukh']
|
11
|
+
spec.email = ['i.demukh@appodeal.com']
|
12
|
+
|
13
|
+
spec.summary = 'ActionMailer like gem for mandrill'
|
14
|
+
spec.description = 'ActionMailer like gem for mandrill'
|
15
|
+
spec.homepage = 'https://github.com/appodeal/drill'
|
16
|
+
spec.license = 'MIT'
|
17
|
+
|
18
|
+
# Specify which files should be added to the gem when it is released.
|
19
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
20
|
+
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
21
|
+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
22
|
+
end
|
23
|
+
spec.bindir = 'exe'
|
24
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
25
|
+
spec.require_paths = ['lib']
|
26
|
+
|
27
|
+
spec.add_runtime_dependency 'mandrill-api', '~> 1.0'
|
28
|
+
|
29
|
+
spec.add_development_dependency 'letter_opener', '~> 1.6'
|
30
|
+
spec.add_development_dependency 'mail', '~> 2.7'
|
31
|
+
|
32
|
+
spec.add_development_dependency 'bundler', '~> 1.16'
|
33
|
+
spec.add_development_dependency 'rake', '~> 10.0'
|
34
|
+
spec.add_development_dependency 'rspec', '~> 3.0'
|
35
|
+
spec.add_development_dependency 'rubocop', '~> 0.0'
|
36
|
+
end
|
data/lib/drill.rb
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'drill/version'
|
4
|
+
require 'drill/mailer'
|
5
|
+
require 'mandrill'
|
6
|
+
|
7
|
+
module Drill
|
8
|
+
Configuration = Struct.new(
|
9
|
+
:api_key, :delivery_method, :default_vars,
|
10
|
+
keyword_init: true
|
11
|
+
)
|
12
|
+
|
13
|
+
module_function
|
14
|
+
|
15
|
+
def configuration
|
16
|
+
@configuration ||= Configuration.new(
|
17
|
+
delivery_method: :default,
|
18
|
+
default_vars: {}
|
19
|
+
)
|
20
|
+
end
|
21
|
+
|
22
|
+
def configure
|
23
|
+
yield configuration
|
24
|
+
end
|
25
|
+
|
26
|
+
def client
|
27
|
+
@client ||= Mandrill::API.new(configuration.api_key)
|
28
|
+
end
|
29
|
+
end
|
data/lib/drill/mail.rb
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Drill
|
4
|
+
module Mail
|
5
|
+
autoload :Default, 'drill/mail/default'
|
6
|
+
autoload :LetterOpener, 'drill/mail/letter_opener'
|
7
|
+
|
8
|
+
module_function
|
9
|
+
|
10
|
+
def new(params)
|
11
|
+
mail.new(params)
|
12
|
+
end
|
13
|
+
|
14
|
+
def mail
|
15
|
+
case Drill.configuration.delivery_method
|
16
|
+
when :letter_opener
|
17
|
+
LetterOpener
|
18
|
+
else
|
19
|
+
Default
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,50 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'drill/mail/base'
|
4
|
+
|
5
|
+
module Drill
|
6
|
+
module Mail
|
7
|
+
class Default < Base
|
8
|
+
def deliver
|
9
|
+
template_name = params.template_name
|
10
|
+
|
11
|
+
Drill.client.messages.send_template(template_name, [], message_hash)
|
12
|
+
end
|
13
|
+
|
14
|
+
private
|
15
|
+
|
16
|
+
def message_hash
|
17
|
+
message_hash = {}
|
18
|
+
|
19
|
+
to_emails = Array(params.to).map do |email|
|
20
|
+
{ email: email }
|
21
|
+
end
|
22
|
+
cc_emails = Array(params.cc).map do |email|
|
23
|
+
{ email: email, type: 'cc' }
|
24
|
+
end
|
25
|
+
vars = Hash(params.vars).map do |name, content|
|
26
|
+
{ name: name.to_s.upcase, content: content }
|
27
|
+
end
|
28
|
+
|
29
|
+
all_emails = to_emails + cc_emails
|
30
|
+
unless all_emails.empty?
|
31
|
+
message_hash[:to] = all_emails
|
32
|
+
|
33
|
+
unless vars.empty?
|
34
|
+
message_hash[:merge_vars] =
|
35
|
+
all_emails.each.with_object([]) do |email, arr|
|
36
|
+
arr << { rcpt: email[:email], vars: vars }
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
message_hash[:from_name] = params.from_name if params.from_name
|
41
|
+
message_hash[:from_email] = params.from_email if params.from_email
|
42
|
+
if params.reply_to
|
43
|
+
message_hash[:headers] = { 'Reply-To' => params.reply_to }
|
44
|
+
end
|
45
|
+
|
46
|
+
message_hash
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'mail'
|
4
|
+
require 'letter_opener'
|
5
|
+
require 'drill/mail/base'
|
6
|
+
|
7
|
+
module Drill
|
8
|
+
module Mail
|
9
|
+
class LetterOpener < Base
|
10
|
+
attr_reader :mail, :delivery_method
|
11
|
+
|
12
|
+
def initialize(
|
13
|
+
params,
|
14
|
+
mail = ::Mail.new,
|
15
|
+
delivery_method = ::LetterOpener::DeliveryMethod.new
|
16
|
+
)
|
17
|
+
super(params)
|
18
|
+
|
19
|
+
@mail = mail
|
20
|
+
@delivery_method = delivery_method
|
21
|
+
end
|
22
|
+
|
23
|
+
def deliver
|
24
|
+
prepare_mail!
|
25
|
+
|
26
|
+
delivery_method.deliver!(mail)
|
27
|
+
end
|
28
|
+
|
29
|
+
private
|
30
|
+
|
31
|
+
def prepare_mail!
|
32
|
+
mail.to = Array(params.to) + Array(params.cc)
|
33
|
+
mail.from = params.from_email
|
34
|
+
mail.sender = params.from_name
|
35
|
+
mail.reply_to = params.reply_to
|
36
|
+
mail.content_type = 'text/html'
|
37
|
+
mail.body = render_html
|
38
|
+
end
|
39
|
+
|
40
|
+
def render_html
|
41
|
+
template_name = params.template_name
|
42
|
+
merge_vars =
|
43
|
+
params.vars.each.with_object([]) do |(name, content), arr|
|
44
|
+
arr << { name: name.to_s.upcase, content: content }
|
45
|
+
end
|
46
|
+
|
47
|
+
Drill.client.templates.render(template_name, [], merge_vars)['html']
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
data/lib/drill/mailer.rb
ADDED
@@ -0,0 +1,58 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'drill/params'
|
4
|
+
require 'drill/mail'
|
5
|
+
|
6
|
+
module Drill
|
7
|
+
class Mailer
|
8
|
+
attr_reader :action_name
|
9
|
+
|
10
|
+
class << self
|
11
|
+
private
|
12
|
+
|
13
|
+
def method_missing(method, *args)
|
14
|
+
super unless respond_to_missing?(method)
|
15
|
+
|
16
|
+
new(method).public_send(method, *args)
|
17
|
+
end
|
18
|
+
|
19
|
+
def respond_to_missing?(method, include_all = false)
|
20
|
+
public_instance_methods(false).include?(method) || super
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
def initialize(action_name)
|
25
|
+
@action_name = action_name
|
26
|
+
end
|
27
|
+
|
28
|
+
def mail(params = {})
|
29
|
+
params[:template_name] ||= action_name
|
30
|
+
|
31
|
+
params = Params.new(permitted_params(params))
|
32
|
+
params.merge_vars(vars_from_instance_variables)
|
33
|
+
params.merge_vars(Drill.configuration.default_vars)
|
34
|
+
|
35
|
+
Mail.new(params)
|
36
|
+
end
|
37
|
+
|
38
|
+
private
|
39
|
+
|
40
|
+
def permitted_params(params)
|
41
|
+
params.slice(*Params.members)
|
42
|
+
end
|
43
|
+
|
44
|
+
def vars_from_instance_variables
|
45
|
+
permitted_instance_variables
|
46
|
+
.each.with_object({}) do |instance_variable, vars|
|
47
|
+
name = instance_variable.to_s.sub('@', '').to_sym
|
48
|
+
content = instance_variable_get(instance_variable)
|
49
|
+
|
50
|
+
vars[name] = content
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
def permitted_instance_variables
|
55
|
+
instance_variables - %i[@action_name]
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
data/lib/drill/params.rb
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Drill
|
4
|
+
Params = Struct.new(
|
5
|
+
:from_name, :from_email, :reply_to, :cc, :to, :vars, :template_name,
|
6
|
+
keyword_init: true
|
7
|
+
) do
|
8
|
+
def merge_vars(other_vars)
|
9
|
+
self.vars = Hash(vars).merge(other_vars)
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
metadata
ADDED
@@ -0,0 +1,163 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: drill-mailer
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Ilya Demukh
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2018-09-18 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: mandrill-api
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: letter_opener
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.6'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.6'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: mail
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '2.7'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '2.7'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: bundler
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '1.16'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '1.16'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rake
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '10.0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '10.0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: rspec
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '3.0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '3.0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: rubocop
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0.0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0.0'
|
111
|
+
description: ActionMailer like gem for mandrill
|
112
|
+
email:
|
113
|
+
- i.demukh@appodeal.com
|
114
|
+
executables: []
|
115
|
+
extensions: []
|
116
|
+
extra_rdoc_files: []
|
117
|
+
files:
|
118
|
+
- ".gitignore"
|
119
|
+
- ".rspec"
|
120
|
+
- ".ruby-version"
|
121
|
+
- ".travis.yml"
|
122
|
+
- CODE_OF_CONDUCT.md
|
123
|
+
- Gemfile
|
124
|
+
- Gemfile.lock
|
125
|
+
- LICENSE.txt
|
126
|
+
- README.md
|
127
|
+
- Rakefile
|
128
|
+
- bin/console
|
129
|
+
- bin/setup
|
130
|
+
- drill.gemspec
|
131
|
+
- lib/drill.rb
|
132
|
+
- lib/drill/mail.rb
|
133
|
+
- lib/drill/mail/base.rb
|
134
|
+
- lib/drill/mail/default.rb
|
135
|
+
- lib/drill/mail/letter_opener.rb
|
136
|
+
- lib/drill/mailer.rb
|
137
|
+
- lib/drill/params.rb
|
138
|
+
- lib/drill/version.rb
|
139
|
+
homepage: https://github.com/appodeal/drill
|
140
|
+
licenses:
|
141
|
+
- MIT
|
142
|
+
metadata: {}
|
143
|
+
post_install_message:
|
144
|
+
rdoc_options: []
|
145
|
+
require_paths:
|
146
|
+
- lib
|
147
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
148
|
+
requirements:
|
149
|
+
- - ">="
|
150
|
+
- !ruby/object:Gem::Version
|
151
|
+
version: '0'
|
152
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
153
|
+
requirements:
|
154
|
+
- - ">="
|
155
|
+
- !ruby/object:Gem::Version
|
156
|
+
version: '0'
|
157
|
+
requirements: []
|
158
|
+
rubyforge_project:
|
159
|
+
rubygems_version: 2.7.6
|
160
|
+
signing_key:
|
161
|
+
specification_version: 4
|
162
|
+
summary: ActionMailer like gem for mandrill
|
163
|
+
test_files: []
|