mailerlite 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: efd9c3192e8b0b5803b0e38ad265b850315cc347
4
- data.tar.gz: dbd161446be6234bd65db1eda6c06cea96d8dcfc
3
+ metadata.gz: 429068032003d8d580e7558e2cdb4ebe03837156
4
+ data.tar.gz: 6a079e90259500321c692d80c6ae269fbcc9c29f
5
5
  SHA512:
6
- metadata.gz: 5bdacde3271be3b651fdb21a664585f3b4fc2d33cb2bc59899fcdb7b777784768956710c9d42ed53d2019645ebd264740694e12b14ee914e7ecefc8d6dd82bff
7
- data.tar.gz: e26de30288431b82a8c099ac20428db695947420b878ea1a72c799be73cf68f8ed4646b4d7ec46c314e7ba6d921eb04a80c5c565ccc4a73573a6f0de9c6fe596
6
+ metadata.gz: f48c09315918f8061f0d8669f0873de0491f0cacaff59fa1615fabc299ace35b1729680ad853ee8922e31069361d758698b479d9dcbb34d41a19686dcf6782a0
7
+ data.tar.gz: 58b50f488ae6107d6808d8c237f3ff73405b3a0cf626c93ab6ae13bacdb3757462492e1f297be09afaf8066592c18cade543a2baac4d187e4b4a9d363a8a873e
data/CONTRIBUTING.md ADDED
@@ -0,0 +1,42 @@
1
+ # How to contribute
2
+
3
+ I like to encourage you to contribute to the repository.
4
+ This should be as easy as possible for you but there are a few things to consider when contributing.
5
+ The following guidelines for contribution should be followed if you want to submit a pull request.
6
+
7
+ ## How to prepare
8
+
9
+ * You need a [GitHub account](https://github.com/signup/free)
10
+ * Submit an [issue ticket](https://github.com/jpalumickas/mailerlite-ruby/issues) for your issue if the is no one yet.
11
+ * Describe the issue and include steps to reproduce if it's a bug.
12
+ * Ensure to mention the earliest version that you know is affected.
13
+ * If you are able and want to fix this, fork the repository on GitHub
14
+
15
+ ## Make Changes
16
+
17
+ * In your forked repository, create a topic branch for your upcoming patch. (e.g. `feature--autoplay` or `bugfix--ios-crash`)
18
+ * Usually this is based on the master branch.
19
+ * Create a branch based on master; `git branch
20
+ fix/master/my_contribution master` then checkout the new branch with `git
21
+ checkout fix/master/my_contribution`. Please avoid working directly on the `master` branch.
22
+ * Make sure you stick to the coding style that is used already.
23
+ * Make use of the `.editorconfig`-file if provided with the repository.
24
+ * Make commits of logical units and describe them properly.
25
+ * Check for unnecessary whitespace with `git diff --check` before committing.
26
+
27
+ * If possible, submit tests to your patch / new feature so it can be tested easily.
28
+ * Assure nothing is broken by running all the tests.
29
+
30
+ ## Submit Changes
31
+
32
+ * Push your changes to a topic branch in your fork of the repository.
33
+ * Open a pull request to the original repository and choose the right original branch you want to patch.
34
+ _Advanced users may use [`hub`](https://github.com/defunkt/hub#git-pull-request) gem for that._
35
+ * If not done in commit messages (which you really should do) please reference and update your issue with the code changes. But _please do not close the issue yourself_.
36
+ _Notice: You can [turn your previously filed issues into a pull-request here](http://issue2pr.herokuapp.com/)._
37
+ * Even if you have write access to the repository, do not directly push or merge pull-requests. Let another team member review your pull request and approve.
38
+
39
+ # Additional Resources
40
+
41
+ * [General GitHub documentation](http://help.github.com/)
42
+ * [GitHub pull request documentation](http://help.github.com/send-pull-requests/)
data/Gemfile CHANGED
@@ -8,6 +8,7 @@ group :test do
8
8
  gem 'codeclimate-test-reporter', require: false
9
9
  gem 'coveralls', '~> 0.8.13', require: false
10
10
  gem 'guard-rspec', '~> 4.6.5'
11
+ gem 'rake' # For Travis CI
11
12
  gem 'simplecov', '~> 0.11.2', require: false
12
13
  gem 'webmock', '~> 1.24.3'
13
14
  end
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2016 Justas Palumickas
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 all
13
+ 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 THE
21
+ SOFTWARE.
data/README.md CHANGED
@@ -20,6 +20,10 @@ gem 'mailerlite'
20
20
 
21
21
  ### Authentication
22
22
 
23
+ When you sign up for an account, you are given an **API key**. You authenticate to
24
+ the [MailerLite][mailerlite] API by providing your API key in the request.
25
+ You can find your API key in page: Integrations » Developer API.
26
+
23
27
  ```ruby
24
28
  client = MailerLite::Client.new(api_key: 'my-secret-api-key')
25
29
  ```
@@ -1,10 +1,12 @@
1
1
  require 'mailerlite/connection'
2
2
  require 'mailerlite/configuration'
3
3
 
4
+ require 'mailerlite/clients/campaigns'
4
5
  require 'mailerlite/clients/lists'
5
6
 
6
7
  module MailerLite
7
8
  class Client
9
+ include MailerLite::Clients::Campaigns
8
10
  include MailerLite::Clients::Lists
9
11
 
10
12
  def initialize(options = {})
@@ -0,0 +1,42 @@
1
+ module MailerLite
2
+ module Clients
3
+ # Get information about MailerLite Campaigns.
4
+ #
5
+ # You can official documentation at
6
+ # https://docs.mailerlite.com/pages/campaigns
7
+ module Campaigns
8
+ def campaigns(options = {})
9
+ connection.get('campaigns/', options)
10
+ end
11
+
12
+ def campaign(id)
13
+ connection.get("campaigns/#{id}/")
14
+ end
15
+
16
+ def campaign_recipients(id, options = {})
17
+ connection.get("campaigns/#{id}/recipients/", options)
18
+ end
19
+
20
+ def campaign_opens(id, options = {})
21
+ connection.get("campaigns/#{id}/opens/", options)
22
+ end
23
+
24
+ def campaign_clicks(id, options = {})
25
+ connection.get("campaigns/#{id}/clicks/", options)
26
+ end
27
+
28
+ def campaign_unsubscribes(id, options = {})
29
+ connection.get("campaigns/#{id}/unsubscribes/", options)
30
+ end
31
+
32
+ def campaign_bounces(id, options = {})
33
+ connection.get("campaigns/#{id}/bounces/", options)
34
+ end
35
+
36
+ def campaign_junk(id, options = {})
37
+ connection.get("campaigns/#{id}/junk/", options)
38
+ end
39
+ alias campaign_spam_complaints campaign_junk
40
+ end
41
+ end
42
+ end
@@ -1,5 +1,9 @@
1
1
  module MailerLite
2
2
  module Clients
3
+ # Get information about MailerLite Lists.
4
+ #
5
+ # You can official documentation at
6
+ # https://docs.mailerlite.com/pages/lists
3
7
  module Lists
4
8
  def lists(options = {})
5
9
  connection.get('lists/', options)
@@ -1,3 +1,3 @@
1
1
  module MailerLite
2
- VERSION = '0.1.0'.freeze
2
+ VERSION = '0.2.0'.freeze
3
3
  end
data/lib/mailerlite.rb CHANGED
@@ -4,8 +4,6 @@ require 'mailerlite/version'
4
4
  require 'mailerlite/error'
5
5
  require 'mailerlite/client'
6
6
 
7
- require 'faraday'
8
-
9
7
  module MailerLite
10
8
  class << self
11
9
  def client
data/mailerlite.gemspec CHANGED
@@ -10,9 +10,11 @@ Gem::Specification.new do |spec|
10
10
  spec.email = ['jpalumickas@gmail.com']
11
11
 
12
12
  spec.summary = 'Ruby wrapper for MailerLite API'
13
- spec.description = 'Unofficial ruby gem for MailerLite API'
13
+ spec.description = 'Ruby gem for MailerLite API'
14
14
  spec.homepage = 'https://github.com/jpalumickas/mailerlite-ruby'
15
15
 
16
+ spec.license = 'MIT'
17
+
16
18
  spec.files = `git ls-files -z`
17
19
  .split("\x0")
18
20
  .reject { |f| f.match(%r{^(test|spec|features)/}) }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mailerlite
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justas Palumickas
@@ -94,7 +94,7 @@ dependencies:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
96
  version: '3.4'
97
- description: Unofficial ruby gem for MailerLite API
97
+ description: Ruby gem for MailerLite API
98
98
  email:
99
99
  - jpalumickas@gmail.com
100
100
  executables: []
@@ -104,13 +104,16 @@ files:
104
104
  - ".gitignore"
105
105
  - ".rspec"
106
106
  - ".travis.yml"
107
+ - CONTRIBUTING.md
107
108
  - Gemfile
109
+ - LICENSE
108
110
  - README.md
109
111
  - Rakefile
110
112
  - bin/console
111
113
  - bin/setup
112
114
  - lib/mailerlite.rb
113
115
  - lib/mailerlite/client.rb
116
+ - lib/mailerlite/clients/campaigns.rb
114
117
  - lib/mailerlite/clients/lists.rb
115
118
  - lib/mailerlite/configuration.rb
116
119
  - lib/mailerlite/connection.rb
@@ -121,7 +124,8 @@ files:
121
124
  - lib/mailerlite/version.rb
122
125
  - mailerlite.gemspec
123
126
  homepage: https://github.com/jpalumickas/mailerlite-ruby
124
- licenses: []
127
+ licenses:
128
+ - MIT
125
129
  metadata: {}
126
130
  post_install_message:
127
131
  rdoc_options: []