mailgems 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 1d48e8c5393dab964c8bbb24c660c088711976ce111517e9b7a88d212c7b366c
4
+ data.tar.gz: a69d8662d560cdba6a5e225a10e7d57e61f29e9b9e6e8a26040479841ea76e26
5
+ SHA512:
6
+ metadata.gz: 35a3bb67f13e0a9fc766b5dadfc769bc7415feb003f2944622a3b1fae98cf7ff14a3756e5d72a6166b5916f77407bd1ece830303fe39119c9b91baf701cea2be
7
+ data.tar.gz: ea9ea43f95958039690be0199466745ea9c77795a54b1a560493ccdc0a54c4c7645cae2635399694af871a190dd40087203b7efaa72ae9c9b8f87da2277facd8
@@ -0,0 +1 @@
1
+ service_name: travis-ci
@@ -0,0 +1,13 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+
10
+ # rspec failure tracking
11
+ .rspec_status
12
+
13
+ *.gem
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
@@ -0,0 +1,7 @@
1
+ ---
2
+ sudo: false
3
+ language: ruby
4
+ cache: bundler
5
+ rvm:
6
+ - 2.5.3
7
+ before_install: gem install bundler -v 2.0.1
@@ -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 ankit@weinvest.net. 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
@@ -0,0 +1,4 @@
1
+ source "https://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in mailgems.gemspec
4
+ gemspec
@@ -0,0 +1,106 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ mailgems (0.1.1)
5
+ httparty (~> 0.17.0)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ addressable (2.6.0)
11
+ public_suffix (>= 2.0.2, < 4.0)
12
+ ast (2.4.1)
13
+ coderay (1.1.2)
14
+ coveralls (0.8.23)
15
+ json (>= 1.8, < 3)
16
+ simplecov (~> 0.16.1)
17
+ term-ansicolor (~> 1.3)
18
+ thor (>= 0.19.4, < 2.0)
19
+ tins (~> 1.6)
20
+ crack (0.4.3)
21
+ safe_yaml (~> 1.0.0)
22
+ diff-lcs (1.4.4)
23
+ docile (1.3.2)
24
+ hashdiff (0.3.8)
25
+ httparty (0.17.3)
26
+ mime-types (~> 3.0)
27
+ multi_xml (>= 0.5.2)
28
+ json (2.3.1)
29
+ mail (2.7.1)
30
+ mini_mime (>= 0.1.1)
31
+ method_source (0.9.2)
32
+ mime-types (3.3.1)
33
+ mime-types-data (~> 3.2015)
34
+ mime-types-data (3.2020.0512)
35
+ mini_mime (1.0.2)
36
+ multi_xml (0.6.0)
37
+ parallel (1.14.0)
38
+ parser (2.7.1.4)
39
+ ast (~> 2.4.1)
40
+ pry (0.12.2)
41
+ coderay (~> 1.1.0)
42
+ method_source (~> 0.9.0)
43
+ public_suffix (3.0.3)
44
+ rainbow (3.0.0)
45
+ rake (10.5.0)
46
+ regexp_parser (1.7.1)
47
+ rexml (3.2.4)
48
+ rspec (3.9.0)
49
+ rspec-core (~> 3.9.0)
50
+ rspec-expectations (~> 3.9.0)
51
+ rspec-mocks (~> 3.9.0)
52
+ rspec-core (3.9.2)
53
+ rspec-support (~> 3.9.3)
54
+ rspec-expectations (3.9.2)
55
+ diff-lcs (>= 1.2.0, < 2.0)
56
+ rspec-support (~> 3.9.0)
57
+ rspec-mocks (3.9.1)
58
+ diff-lcs (>= 1.2.0, < 2.0)
59
+ rspec-support (~> 3.9.0)
60
+ rspec-support (3.9.3)
61
+ rubocop (0.87.1)
62
+ parallel (~> 1.10)
63
+ parser (>= 2.7.1.1)
64
+ rainbow (>= 2.2.2, < 4.0)
65
+ regexp_parser (>= 1.7)
66
+ rexml
67
+ rubocop-ast (>= 0.1.0, < 1.0)
68
+ ruby-progressbar (~> 1.7)
69
+ unicode-display_width (>= 1.4.0, < 2.0)
70
+ rubocop-ast (0.1.0)
71
+ parser (>= 2.7.0.1)
72
+ ruby-progressbar (1.10.0)
73
+ safe_yaml (1.0.5)
74
+ simplecov (0.16.1)
75
+ docile (~> 1.1)
76
+ json (>= 1.8, < 3)
77
+ simplecov-html (~> 0.10.0)
78
+ simplecov-html (0.10.2)
79
+ sync (0.5.0)
80
+ term-ansicolor (1.7.1)
81
+ tins (~> 1.0)
82
+ thor (1.0.1)
83
+ tins (1.25.0)
84
+ sync
85
+ unicode-display_width (1.4.1)
86
+ webmock (3.5.1)
87
+ addressable (>= 2.3.6)
88
+ crack (>= 0.3.2)
89
+ hashdiff
90
+
91
+ PLATFORMS
92
+ ruby
93
+
94
+ DEPENDENCIES
95
+ bundler (~> 2.0)
96
+ coveralls (~> 0.8.23)
97
+ mail (~> 2.6, >= 2.6.0)
98
+ mailgems!
99
+ pry (~> 0.12.2)
100
+ rake (~> 10.0)
101
+ rspec (~> 3.0)
102
+ rubocop (~> 0.87.1)
103
+ webmock (~> 3.5.1)
104
+
105
+ BUNDLED WITH
106
+ 2.0.1
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2020 Ankit S
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.
@@ -0,0 +1,88 @@
1
+ [![Build Status](https://travis-ci.org/mailgems/mailgems-ruby.svg?branch=master)](https://travis-ci.org/mailgems/mailgems-ruby) [![Coverage Status](https://coveralls.io/repos/github/mailgems/mailgems-ruby/badge.svg)](https://coveralls.io/github/mailgems/mailgems-ruby)
2
+
3
+ # Mailgems
4
+
5
+ This library allows you to quickly and easily use the Mailgems API v1 via Ruby. It is also an Action Mailer adapter for using [Mailgems](https://www.mailgems.com) in Rails apps. It uses the [Mailgems HTTP API](https://mailgems.docs.apiary.io/) internally.
6
+
7
+ ## Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ ```ruby
12
+ gem 'mailgems'
13
+ ```
14
+
15
+ And then execute:
16
+
17
+ $ bundle
18
+
19
+ Or install it yourself as:
20
+
21
+ $ gem install mailgems
22
+
23
+ ## Usage
24
+
25
+ Here's how to send a message using the library:
26
+
27
+ ```ruby
28
+ require 'mailguns'
29
+
30
+ # First, instantiate the Mailgems Mail with your API key
31
+ mg_client = Mailgun::Mail.new(api_key: 'your-api-key')
32
+
33
+ # Define your mail parameters
34
+ mail_params = {
35
+ from_email: 'foo@sending_domain.com',
36
+ from_name: 'Foo',
37
+ recipients: [{
38
+ email: 'receiver@example.com',
39
+ attributes: { name: 'Receiver' }
40
+ }],
41
+ subject: 'The Mailgems Ruby SDK is awesome!',
42
+ content: 'Hi {{name}}, It is really easy to send an email!'
43
+ }
44
+
45
+ # Send your mail through the client
46
+ mg_client.send_mail mail_params
47
+ ```
48
+
49
+ ## Rails
50
+
51
+ ```ruby
52
+ Mailgems.configure do |config|
53
+ config.api_key = 'your-api-key'
54
+ config.sandbox = false
55
+ end
56
+ ```
57
+
58
+ Or have the initializer read your environment setting if you prefer.
59
+
60
+ To use as the ActionMailer delivery method, add this to your `config/environments/whatever.rb`:
61
+ ```ruby
62
+ config.action_mailer.delivery_method = :mailgems
63
+ ```
64
+
65
+ To specify Mailgems options such as template (body) or merge_data:
66
+ ```ruby
67
+ class UserMailer < ApplicationMailer
68
+ def welcome_email
69
+ mail(to: params[:to], subject: "Welcome!", body: 'mailgems-template-name', merge_data: { name: params[:name] })
70
+ end
71
+ end
72
+ ```
73
+
74
+ ## Development
75
+
76
+ 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.
77
+
78
+ ## Contributing
79
+
80
+ Bug reports and pull requests are welcome on GitHub at https://github.com/mailgems/mailgems-ruby. 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.
81
+
82
+ ## License
83
+
84
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
85
+
86
+ ## Code of Conduct
87
+
88
+ Everyone interacting in the Mailgems project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/mailgems/mailgems-ruby/blob/master/CODE_OF_CONDUCT.md).
@@ -0,0 +1,6 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "mailgems"
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__)
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'mailgems/version'
4
+
5
+ module Mailgems
6
+ class Error < StandardError; end
7
+
8
+ autoload :DeliveryMethod, 'mailgems/delivery_method'
9
+ autoload :Configuration, 'mailgems/configuration'
10
+ autoload :Mail, 'mailgems/mail'
11
+ autoload :Message, 'mailgems/message'
12
+ autoload :ApiError, 'mailgems/api_error'
13
+
14
+ def self.configuration
15
+ @configuration ||= Configuration.new
16
+ end
17
+
18
+ def self.configure
19
+ yield(configuration)
20
+ end
21
+ end
22
+
23
+ require 'mailgems/railtie' if defined?(Rails::Railtie)
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Mailgems
4
+ class ApiError < StandardError
5
+ attr_accessor :code, :message
6
+
7
+ def initialize(code, message)
8
+ @code = code
9
+ @message = message
10
+ end
11
+
12
+ def to_s
13
+ reason
14
+ end
15
+
16
+ private
17
+
18
+ def reason
19
+ "Code: #{code} and Message: #{message}"
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Mailgems
4
+ class Configuration
5
+ attr_accessor :api_key, :sandbox, :api_version
6
+
7
+ def initialize
8
+ @api_key = nil
9
+ @sandbox = false
10
+ @api_version = 'v1'
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,37 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'digest/sha1'
4
+
5
+ module Mailgems
6
+ class DeliveryMethod
7
+ class InvalidOption < StandardError; end
8
+
9
+ attr_accessor :settings
10
+
11
+ def initialize(options = {})
12
+ options[:api_key] ||= Mailgems.configuration.api_key
13
+ options[:sandbox] ||= Mailgems.configuration.sandbox
14
+
15
+ raise InvalidOption, "Api Key is required" if options[:api_key].nil?
16
+
17
+ self.settings = options
18
+ end
19
+
20
+ def deliver!(mail)
21
+ validate_mail!(mail)
22
+ Message.new(mail, settings).send
23
+ end
24
+
25
+ private
26
+
27
+ def validate_mail!(mail)
28
+ if mail.smtp_envelope_from.nil? || mail.smtp_envelope_from.empty?
29
+ raise ArgumentError, 'SMTP From address may not be blank'
30
+ end
31
+
32
+ if mail.smtp_envelope_to.nil? || mail.smtp_envelope_to.empty?
33
+ raise ArgumentError, 'SMTP To address may not be blank'
34
+ end
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,45 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'httparty'
4
+
5
+ module Mailgems
6
+ class Mail
7
+ class InvalidOption < StandardError; end
8
+ include HTTParty
9
+
10
+ base_uri 'https://api.mailgems.com/api'
11
+ attr_accessor :api_key, :api_version
12
+
13
+ def initialize(opts = {})
14
+ @api_key = opts[:api_key]
15
+ @api_version = opts[:api_version] || 'v1'
16
+
17
+ raise InvalidOption, "Api Key is required" if opts[:api_key].nil?
18
+ end
19
+
20
+ def send_mail(params)
21
+ response = self.class.post("/#{api_version}/emails",
22
+ body: params.to_json, headers: headers)
23
+
24
+ response_code = response.code
25
+ response_hash = response.parsed_response
26
+
27
+ raise_exception(response_code, response_hash) unless response_code == 200
28
+
29
+ response_hash
30
+ end
31
+
32
+ private
33
+
34
+ def headers
35
+ {
36
+ 'Content-Type': 'application/json',
37
+ 'X-Api-Key': api_key
38
+ }
39
+ end
40
+
41
+ def raise_exception(code, hash)
42
+ raise Mailgems::ApiError.new(code, hash['message'])
43
+ end
44
+ end
45
+ end
@@ -0,0 +1,103 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Mailgems
4
+ class Message
5
+ attr_reader :mail, :api_key, :sandbox
6
+ ERROR_MSG = '%s configuration must be given'
7
+
8
+ def initialize(mail, settings)
9
+ @mail = mail
10
+ @api_key = settings[:api_key]
11
+ @sandbox = settings[:sandbox]
12
+
13
+ raise ArgumentError, ERROR_MSG % 'Api key' unless @api_key
14
+ end
15
+
16
+ def send
17
+ Mail.new(api_key: api_key).send_mail(params)
18
+ end
19
+
20
+ private
21
+
22
+ def params
23
+ {
24
+ recipients: recipients, from_email: from_email, from_name: from_name,
25
+ subject: subject, content: content, server: server, cc: cc, bcc: bcc,
26
+ attachments: attachments, template: template, is_test: sandbox
27
+ }
28
+ end
29
+
30
+ def recipients
31
+ mail.to.map do |to|
32
+ {
33
+ email: to,
34
+ attributes: mail.header['merge_data']&.unparsed_value
35
+ }
36
+ end
37
+ end
38
+
39
+ def from_email
40
+ mail[:from].addrs.first.address
41
+ end
42
+
43
+ def from_name
44
+ mail[:from].addrs.first.name
45
+ end
46
+
47
+ def subject
48
+ mail.subject
49
+ end
50
+
51
+ def content
52
+ return mail.html_part.decoded if mail.html_part
53
+
54
+ mail.text_part&.decoded
55
+ end
56
+
57
+ def template
58
+ mail.body&.raw_source
59
+ end
60
+
61
+ def server
62
+ mail.header['server']&.value
63
+ end
64
+
65
+ def cc
66
+ mail[:cc]&.addrs&.map(&:address)
67
+ end
68
+
69
+ def bcc
70
+ mail[:bcc]&.addrs&.map(&:address)
71
+ end
72
+
73
+ def attachments
74
+ mail.attachments.map do |attachment|
75
+ if inline?(attachment)
76
+ inline_attachment_body(attachment)
77
+ else
78
+ attachment_body(attachment)
79
+ end
80
+ end.compact
81
+ end
82
+
83
+ def inline_attachment_body(attachment)
84
+ {
85
+ filename: attachment.filename,
86
+ content: Base64.strict_encode64(attachment.decoded),
87
+ content_id: attachment['Content-ID'].element.message_ids.first,
88
+ inline: true
89
+ }
90
+ end
91
+
92
+ def attachment_body(attachment)
93
+ {
94
+ filename: attachment.filename,
95
+ content: Base64.strict_encode64(attachment.decoded)
96
+ }
97
+ end
98
+
99
+ def inline?(attachment)
100
+ attachment.content_disposition.starts_with? 'inline'
101
+ end
102
+ end
103
+ end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Mailgems
4
+ class Railtie < Rails::Railtie
5
+ initializer 'mailgems.add_delivery_method' do
6
+ ActiveSupport.on_load :action_mailer do
7
+ ActionMailer::Base.add_delivery_method(
8
+ :mailgems,
9
+ Mailgems::DeliveryMethod
10
+ )
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Mailgems
4
+ VERSION = '0.1.1'
5
+ end
@@ -0,0 +1,48 @@
1
+
2
+ lib = File.expand_path("../lib", __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require "mailgems/version"
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "mailgems"
8
+ spec.version = Mailgems::VERSION
9
+ spec.authors = ["Mailgems"]
10
+ spec.email = ["admin@mailgems.com"]
11
+
12
+ spec.summary = %q{This library allows you to quickly and easily use the Mailgems API v1 via Ruby}
13
+ spec.description = %q{This library allows you to quickly and easily use the Mailgems API v1 via Ruby. It is also an Action Mailer adapter for using Mailgems in Rails apps. It uses the Mailgems HTTP API internally.}
14
+ spec.homepage = "https://www.mailgems.com"
15
+ spec.license = "MIT"
16
+
17
+ # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
18
+ # to allow pushing to a single host or delete this section to allow pushing to any host.
19
+ if spec.respond_to?(:metadata)
20
+ spec.metadata["allowed_push_host"] = "https://rubygems.org"
21
+
22
+ spec.metadata["homepage_uri"] = spec.homepage
23
+ spec.metadata["source_code_uri"] = "https://github.com/mailgems/mailgems-ruby"
24
+ spec.metadata["changelog_uri"] = "https://github.com/mailgems/mailgems-ruby"
25
+ else
26
+ raise "RubyGems 2.0 or newer is required to protect against " \
27
+ "public gem pushes."
28
+ end
29
+
30
+ # Specify which files should be added to the gem when it is released.
31
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
32
+ spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
33
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
34
+ end
35
+ spec.bindir = "exe"
36
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
37
+ spec.require_paths = ["lib"]
38
+
39
+ spec.add_dependency "httparty", "~> 0.17.0"
40
+ spec.add_development_dependency "bundler", "~> 2.0"
41
+ spec.add_development_dependency "rake", "~> 10.0"
42
+ spec.add_development_dependency "mail", "~> 2.6", ">= 2.6.0"
43
+ spec.add_development_dependency "rspec", "~> 3.0"
44
+ spec.add_development_dependency 'webmock', '~> 3.5.1'
45
+ spec.add_development_dependency 'pry', '~> 0.12.2'
46
+ spec.add_development_dependency 'rubocop', '~> 0.87.1'
47
+ spec.add_development_dependency 'coveralls', '~> 0.8.23'
48
+ end
metadata ADDED
@@ -0,0 +1,203 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: mailgems
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.1
5
+ platform: ruby
6
+ authors:
7
+ - Mailgems
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2020-07-09 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: httparty
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: 0.17.0
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: 0.17.0
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '2.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '2.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '10.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '10.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: mail
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: 2.6.0
62
+ - - "~>"
63
+ - !ruby/object:Gem::Version
64
+ version: '2.6'
65
+ type: :development
66
+ prerelease: false
67
+ version_requirements: !ruby/object:Gem::Requirement
68
+ requirements:
69
+ - - ">="
70
+ - !ruby/object:Gem::Version
71
+ version: 2.6.0
72
+ - - "~>"
73
+ - !ruby/object:Gem::Version
74
+ version: '2.6'
75
+ - !ruby/object:Gem::Dependency
76
+ name: rspec
77
+ requirement: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - "~>"
80
+ - !ruby/object:Gem::Version
81
+ version: '3.0'
82
+ type: :development
83
+ prerelease: false
84
+ version_requirements: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - "~>"
87
+ - !ruby/object:Gem::Version
88
+ version: '3.0'
89
+ - !ruby/object:Gem::Dependency
90
+ name: webmock
91
+ requirement: !ruby/object:Gem::Requirement
92
+ requirements:
93
+ - - "~>"
94
+ - !ruby/object:Gem::Version
95
+ version: 3.5.1
96
+ type: :development
97
+ prerelease: false
98
+ version_requirements: !ruby/object:Gem::Requirement
99
+ requirements:
100
+ - - "~>"
101
+ - !ruby/object:Gem::Version
102
+ version: 3.5.1
103
+ - !ruby/object:Gem::Dependency
104
+ name: pry
105
+ requirement: !ruby/object:Gem::Requirement
106
+ requirements:
107
+ - - "~>"
108
+ - !ruby/object:Gem::Version
109
+ version: 0.12.2
110
+ type: :development
111
+ prerelease: false
112
+ version_requirements: !ruby/object:Gem::Requirement
113
+ requirements:
114
+ - - "~>"
115
+ - !ruby/object:Gem::Version
116
+ version: 0.12.2
117
+ - !ruby/object:Gem::Dependency
118
+ name: rubocop
119
+ requirement: !ruby/object:Gem::Requirement
120
+ requirements:
121
+ - - "~>"
122
+ - !ruby/object:Gem::Version
123
+ version: 0.87.1
124
+ type: :development
125
+ prerelease: false
126
+ version_requirements: !ruby/object:Gem::Requirement
127
+ requirements:
128
+ - - "~>"
129
+ - !ruby/object:Gem::Version
130
+ version: 0.87.1
131
+ - !ruby/object:Gem::Dependency
132
+ name: coveralls
133
+ requirement: !ruby/object:Gem::Requirement
134
+ requirements:
135
+ - - "~>"
136
+ - !ruby/object:Gem::Version
137
+ version: 0.8.23
138
+ type: :development
139
+ prerelease: false
140
+ version_requirements: !ruby/object:Gem::Requirement
141
+ requirements:
142
+ - - "~>"
143
+ - !ruby/object:Gem::Version
144
+ version: 0.8.23
145
+ description: This library allows you to quickly and easily use the Mailgems API v1
146
+ via Ruby. It is also an Action Mailer adapter for using Mailgems in Rails apps.
147
+ It uses the Mailgems HTTP API internally.
148
+ email:
149
+ - admin@mailgems.com
150
+ executables: []
151
+ extensions: []
152
+ extra_rdoc_files: []
153
+ files:
154
+ - ".coveralls.yml"
155
+ - ".gitignore"
156
+ - ".rspec"
157
+ - ".travis.yml"
158
+ - CODE_OF_CONDUCT.md
159
+ - Gemfile
160
+ - Gemfile.lock
161
+ - LICENSE.txt
162
+ - README.md
163
+ - Rakefile
164
+ - bin/console
165
+ - bin/setup
166
+ - lib/mailgems.rb
167
+ - lib/mailgems/api_error.rb
168
+ - lib/mailgems/configuration.rb
169
+ - lib/mailgems/delivery_method.rb
170
+ - lib/mailgems/mail.rb
171
+ - lib/mailgems/message.rb
172
+ - lib/mailgems/railtie.rb
173
+ - lib/mailgems/version.rb
174
+ - mailgems.gemspec
175
+ homepage: https://www.mailgems.com
176
+ licenses:
177
+ - MIT
178
+ metadata:
179
+ allowed_push_host: https://rubygems.org
180
+ homepage_uri: https://www.mailgems.com
181
+ source_code_uri: https://github.com/mailgems/mailgems-ruby
182
+ changelog_uri: https://github.com/mailgems/mailgems-ruby
183
+ post_install_message:
184
+ rdoc_options: []
185
+ require_paths:
186
+ - lib
187
+ required_ruby_version: !ruby/object:Gem::Requirement
188
+ requirements:
189
+ - - ">="
190
+ - !ruby/object:Gem::Version
191
+ version: '0'
192
+ required_rubygems_version: !ruby/object:Gem::Requirement
193
+ requirements:
194
+ - - ">="
195
+ - !ruby/object:Gem::Version
196
+ version: '0'
197
+ requirements: []
198
+ rubygems_version: 3.0.3
199
+ signing_key:
200
+ specification_version: 4
201
+ summary: This library allows you to quickly and easily use the Mailgems API v1 via
202
+ Ruby
203
+ test_files: []