drip-ruby 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +0 -2
- data/README.md +6 -1
- data/drip-ruby.gemspec +2 -1
- data/lib/drip/client.rb +16 -20
- data/lib/drip/client/accounts.rb +0 -94
- data/lib/drip/client/purchases.rb +66 -0
- data/lib/drip/client/subscribers.rb +1 -1
- data/lib/drip/client/tags.rb +8 -0
- data/lib/drip/collections.rb +5 -1
- data/lib/drip/collections/purchases.rb +13 -0
- data/lib/drip/collections/tags.rb +13 -0
- data/lib/drip/resources.rb +5 -1
- data/lib/drip/resources/purchase.rb +9 -0
- data/lib/drip/resources/tag.rb +9 -0
- data/lib/drip/version.rb +1 -1
- data/test/drip/client/purchases_test.rb +94 -0
- data/test/drip/client/tags_test.rb +16 -0
- data/test/drip/collections_test.rb +1 -0
- data/test/drip/resources_test.rb +1 -0
- metadata +11 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 88627464a71686f9b3adcf9be0e40fc818856bb4
|
4
|
+
data.tar.gz: 20acf82185d43a600bab243510c58a9c0828ad2b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: df49725e0364d09f2f5b48552e829d6726e2ea402cd390fc6ea2a6cd8b091d6b8ba49a5644e7f4bf4d19a08b17fcf63bc620101cfa4311bedd614ca425b22849
|
7
|
+
data.tar.gz: 69bd895065c5d133f164b5c3fe05caf9e1607fbf801a384cadac9da46b2ccc4e8ddd7dc07df6310282d02e8159668a25dd9a221da3c4858b4865f09af4c83bd1
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -5,6 +5,8 @@ A Ruby toolkit for the [Drip](https://www.getdrip.com/) API.
|
|
5
5
|
[![Build Status](https://travis-ci.org/DripEmail/drip-ruby.svg?branch=master)](https://travis-ci.org/DripEmail/drip-ruby)
|
6
6
|
[![Code Climate](https://codeclimate.com/github/DripEmail/drip-ruby/badges/gpa.svg)](https://codeclimate.com/github/DripEmail/drip-ruby)
|
7
7
|
|
8
|
+
|
9
|
+
|
8
10
|
## Installation
|
9
11
|
|
10
12
|
Add this line to your application's Gemfile:
|
@@ -69,12 +71,15 @@ as methods on the client object. The following methods are currently available:
|
|
69
71
|
| Subscribe to a campaign | `#subscribe(email, campaign_id, options = {})` |
|
70
72
|
| Unsubscribe | `#unsubscribe(id_or_email, options = {})` |
|
71
73
|
| Delete | `#delete_subscriber(id_or_email)` |
|
74
|
+
| List tags | `#tags` |
|
72
75
|
| Apply a tag | `#apply_tag(email, tag)` |
|
73
76
|
| Remove a tag | `#remove_tag(email, tag)` |
|
74
77
|
| Track an event | `#track_event(email, action, properties = {})` |
|
75
78
|
| Track a batch of events | `#track_events(events)` |
|
76
79
|
| List campaigns | `#campaigns` |
|
77
|
-
|
80
|
+
| Create a purchase | `#create_purchase(email, amount, options = {})` |
|
81
|
+
| List purchases for a subscriber | `#purchases(email)` |
|
82
|
+
| Fetch a purchase | `#purchase(email, id)` |
|
78
83
|
|
79
84
|
**Note:** We do not have complete API coverage yet. If we are missing an API method
|
80
85
|
that you need to use in your application, please file an issue and/or open a
|
data/drip-ruby.gemspec
CHANGED
@@ -18,6 +18,8 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
|
+
spec.required_ruby_version = '>= 1.9.3'
|
22
|
+
|
21
23
|
spec.add_development_dependency "bundler", "~> 1.6"
|
22
24
|
spec.add_development_dependency "rake", "~> 10.0"
|
23
25
|
spec.add_development_dependency "shoulda-context", "~> 1.0"
|
@@ -26,5 +28,4 @@ Gem::Specification.new do |spec|
|
|
26
28
|
|
27
29
|
spec.add_runtime_dependency "faraday", "~> 0.9"
|
28
30
|
spec.add_runtime_dependency "faraday_middleware", "~> 0.9"
|
29
|
-
spec.add_runtime_dependency "json", "~> 1.8"
|
30
31
|
end
|
data/lib/drip/client.rb
CHANGED
@@ -4,6 +4,7 @@ require "drip/client/subscribers"
|
|
4
4
|
require "drip/client/tags"
|
5
5
|
require "drip/client/events"
|
6
6
|
require "drip/client/campaigns"
|
7
|
+
require "drip/client/purchases"
|
7
8
|
require "faraday"
|
8
9
|
require "faraday_middleware"
|
9
10
|
require "json"
|
@@ -15,6 +16,7 @@ module Drip
|
|
15
16
|
include Tags
|
16
17
|
include Events
|
17
18
|
include Campaigns
|
19
|
+
include Purchases
|
18
20
|
|
19
21
|
attr_accessor :access_token, :api_key, :account_id
|
20
22
|
|
@@ -34,37 +36,31 @@ module Drip
|
|
34
36
|
end
|
35
37
|
|
36
38
|
def get(url, options = {})
|
37
|
-
|
38
|
-
connection.get do |req|
|
39
|
-
req.url url
|
40
|
-
req.params = options
|
41
|
-
end
|
42
|
-
end
|
39
|
+
make_request(:get, url, options)
|
43
40
|
end
|
44
41
|
|
45
42
|
def post(url, options = {})
|
46
|
-
|
47
|
-
connection.post do |req|
|
48
|
-
req.url url
|
49
|
-
req.body = options.to_json
|
50
|
-
end
|
51
|
-
end
|
43
|
+
make_request(:post, url, options)
|
52
44
|
end
|
53
45
|
|
54
46
|
def put(url, options = {})
|
55
|
-
|
56
|
-
connection.put do |req|
|
57
|
-
req.url url
|
58
|
-
req.body = options.to_json
|
59
|
-
end
|
60
|
-
end
|
47
|
+
make_request(:put, url, options)
|
61
48
|
end
|
62
49
|
|
63
50
|
def delete(url, options = {})
|
51
|
+
make_request(:delete, url, options)
|
52
|
+
end
|
53
|
+
|
54
|
+
def make_request(verb, url, options)
|
64
55
|
build_response do
|
65
|
-
connection.
|
56
|
+
connection.send(verb) do |req|
|
66
57
|
req.url url
|
67
|
-
|
58
|
+
|
59
|
+
if verb == :get
|
60
|
+
req.params = options
|
61
|
+
else
|
62
|
+
req.body = options.to_json
|
63
|
+
end
|
68
64
|
end
|
69
65
|
end
|
70
66
|
end
|
data/lib/drip/client/accounts.rb
CHANGED
@@ -8,100 +8,6 @@ module Drip
|
|
8
8
|
def accounts
|
9
9
|
get "accounts"
|
10
10
|
end
|
11
|
-
|
12
|
-
# Public: Create or update a subscriber.
|
13
|
-
#
|
14
|
-
# options - A Hash of options.
|
15
|
-
# - email - Required. The String subscriber email address.
|
16
|
-
# - new_email - Optional. A new email address for the subscriber.
|
17
|
-
# If provided and a subscriber with the email above
|
18
|
-
# does not exist, this address will be used to
|
19
|
-
# create a new subscriber.
|
20
|
-
# - time_zone - Optional. The subscriber's time zone (in Olsen
|
21
|
-
# format). Defaults to Etc/UTC.
|
22
|
-
# - custom_fields - Optional. A Hash of custom field data.
|
23
|
-
# - tags - Optional. An Array of tags.
|
24
|
-
#
|
25
|
-
# Returns a Drip::Response.
|
26
|
-
# See https://www.getdrip.com/docs/rest-api#create_or_update_subscriber
|
27
|
-
def create_or_update_subscriber(email, options = {})
|
28
|
-
data = options.merge(:email => email)
|
29
|
-
post "#{account_id}/subscribers", generate_resource("subscribers", data)
|
30
|
-
end
|
31
|
-
|
32
|
-
# Public: Create or update a collection of subscribers.
|
33
|
-
#
|
34
|
-
# subscribers - Required. An Array of between 1 and 1000 Hashes of subscriber data.
|
35
|
-
# - email - Required. The String subscriber email address.
|
36
|
-
# - new_email - Optional. A new email address for the subscriber.
|
37
|
-
# If provided and a subscriber with the email above
|
38
|
-
# does not exist, this address will be used to
|
39
|
-
# create a new subscriber.
|
40
|
-
# - time_zone - Optional. The subscriber's time zone (in Olsen
|
41
|
-
# format). Defaults to Etc/UTC.
|
42
|
-
# - custom_fields - Optional. A Hash of custom field data.
|
43
|
-
# - tags - Optional. An Array of tags.
|
44
|
-
#
|
45
|
-
# Returns a Drip::Response
|
46
|
-
# See https://www.getdrip.com/docs/rest-api#subscriber_batches
|
47
|
-
def create_or_update_subscribers(subscribers)
|
48
|
-
url = "#{account_id}/subscribers/batches"
|
49
|
-
post url, generate_resource("batches", { "subscribers" => subscribers })
|
50
|
-
end
|
51
|
-
|
52
|
-
# Public: Unsubscribe a subscriber globally or from a specific campaign.
|
53
|
-
#
|
54
|
-
# id_or_email - Required. The String id or email address of the subscriber.
|
55
|
-
# options - A Hash of options.
|
56
|
-
# - campaign_id - Optional. The campaign from which to
|
57
|
-
# unsubscribe the subscriber. Defaults to all.
|
58
|
-
#
|
59
|
-
# Returns a Drip::Response.
|
60
|
-
# See https://www.getdrip.com/docs/rest-api#unsubscribe
|
61
|
-
def unsubscribe(id_or_email, options = {})
|
62
|
-
url = "#{account_id}/subscribers/#{CGI.escape id_or_email}/unsubscribe"
|
63
|
-
url += options[:campaign_id] ? "?campaign_id=#{options[:campaign_id]}" : ""
|
64
|
-
post url
|
65
|
-
end
|
66
|
-
|
67
|
-
# Public: Subscribe to a campaign.
|
68
|
-
#
|
69
|
-
# email - Required. The String email address of the subscriber.
|
70
|
-
# campaign_id - Required. The String campaign id.
|
71
|
-
# options - Optional. A Hash of options.
|
72
|
-
# - double_optin - Optional. If true, the double opt-in confirmation
|
73
|
-
# email is sent; if false, the confirmation
|
74
|
-
# email is skipped. Defaults to the value set
|
75
|
-
# on the campaign.
|
76
|
-
# - starting_email_index - Optional. The index (zero-based) of
|
77
|
-
# the email to send first. Defaults to 0.
|
78
|
-
# - time_zone - Optional. The subscriber's time zone (in Olsen
|
79
|
-
# format). Defaults to Etc/UTC.
|
80
|
-
# - custom_fields - Optional. A Hash of custom field data.
|
81
|
-
# - tags - Optional. An Array of tags.
|
82
|
-
# - reactivate_if_removed - Optional. If true, re-subscribe
|
83
|
-
# the subscriber to the campaign if there
|
84
|
-
# is a removed subscriber in Drip with the same
|
85
|
-
# email address; otherwise, respond with
|
86
|
-
# 422 Unprocessable Entity. Defaults to true.
|
87
|
-
#
|
88
|
-
# Returns a Drip::Response.
|
89
|
-
# See https://www.getdrip.com/docs/rest-api#subscribe
|
90
|
-
def subscribe(email, campaign_id, options = {})
|
91
|
-
data = options.merge("email" => email)
|
92
|
-
url = "#{account_id}/campaigns/#{campaign_id}/subscribers"
|
93
|
-
post url, generate_resource("subscribers", data)
|
94
|
-
end
|
95
|
-
|
96
|
-
# Public: Delete a subscriber.
|
97
|
-
#
|
98
|
-
# id_or_email - Required. The String id or email address of the subscriber.
|
99
|
-
#
|
100
|
-
# Returns No Content.
|
101
|
-
# See https://www.getdrip.com/docs/rest-api#fdelete_subscriber
|
102
|
-
def delete_subscriber(id_or_email)
|
103
|
-
delete "#{account_id}/subscribers/#{CGI.escape id_or_email}"
|
104
|
-
end
|
105
11
|
end
|
106
12
|
end
|
107
13
|
end
|
@@ -0,0 +1,66 @@
|
|
1
|
+
require "cgi"
|
2
|
+
|
3
|
+
module Drip
|
4
|
+
class Client
|
5
|
+
module Purchases
|
6
|
+
# Public: Create a purchase.
|
7
|
+
#
|
8
|
+
# email - Required. The String email address of the subscriber.
|
9
|
+
# amount - Required. The total amount of the purchase in cents.
|
10
|
+
# options - A Hash of options.
|
11
|
+
# - properties - Optional. An Object containing properties about
|
12
|
+
# the order.
|
13
|
+
# - items - Optional. An Array of objects containing information
|
14
|
+
# about specific order items.
|
15
|
+
# - name - Required. The product name.
|
16
|
+
# - amount - Required. The line total (in
|
17
|
+
# cents).
|
18
|
+
# - quantity - Optional. The quantity of the
|
19
|
+
# item purchased (if omitted,
|
20
|
+
# defaults to 1).
|
21
|
+
# - product_id - Optional. A unique identifier
|
22
|
+
# for the specific product.
|
23
|
+
# - sku - Optional. The product SKU number.
|
24
|
+
# - properties - Optional. An Object containing
|
25
|
+
# properties about the line item.
|
26
|
+
# - provider - Optional. The identifier for the provider from
|
27
|
+
# which the purchase data was received
|
28
|
+
# - order_id - Optional. A unique identifier for the order
|
29
|
+
# (generally the primary key generated by the
|
30
|
+
# order management system).
|
31
|
+
# - permalink - Optional. A URL for the human-readable
|
32
|
+
# interface to view the order details.
|
33
|
+
# - occurred_at - Optional. The String time at which the event
|
34
|
+
# occurred in ISO-8601 format. Defaults to the
|
35
|
+
# current time.
|
36
|
+
#
|
37
|
+
# Returns a Drip::Response.
|
38
|
+
# See https://www.getdrip.com/docs/rest-api#create_purchase
|
39
|
+
def create_purchase(email, amount, options = {})
|
40
|
+
data = options.merge(:amount => amount)
|
41
|
+
post "#{account_id}/subscribers/#{CGI.escape email}/purchases", generate_resource("purchases", data)
|
42
|
+
end
|
43
|
+
|
44
|
+
# Public: Fetch a list of purchases for a subscriber.
|
45
|
+
#
|
46
|
+
# email - The String email address of the subscriber.
|
47
|
+
#
|
48
|
+
# Returns a Drip::Response.
|
49
|
+
# See https://www.getdrip.com/docs/rest-api#list_purchases
|
50
|
+
def purchases(email)
|
51
|
+
get "#{account_id}/subscribers/#{CGI.escape email}/purchases"
|
52
|
+
end
|
53
|
+
|
54
|
+
# Public: Fetch a purchase.
|
55
|
+
#
|
56
|
+
# email - The String email address of the subscriber.
|
57
|
+
# id - The String ID of the purchase
|
58
|
+
#
|
59
|
+
# Returns a Drip::Response.
|
60
|
+
# See https://www.getdrip.com/docs/rest-api#list_purchases
|
61
|
+
def purchase(email, id)
|
62
|
+
get "#{account_id}/subscribers/#{CGI.escape email}/purchases/#{id}"
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
@@ -31,8 +31,8 @@ module Drip
|
|
31
31
|
|
32
32
|
# Public: Create or update a subscriber.
|
33
33
|
#
|
34
|
+
# email - Required. The String subscriber email address.
|
34
35
|
# options - A Hash of options.
|
35
|
-
# - email - Required. The String subscriber email address.
|
36
36
|
# - new_email - Optional. A new email address for the subscriber.
|
37
37
|
# If provided and a subscriber with the email above
|
38
38
|
# does not exist, this address will be used to
|
data/lib/drip/client/tags.rb
CHANGED
@@ -3,6 +3,14 @@ require "cgi"
|
|
3
3
|
module Drip
|
4
4
|
class Client
|
5
5
|
module Tags
|
6
|
+
# Public: Get all tags for the account.
|
7
|
+
#
|
8
|
+
# Returns a Drip::Response.
|
9
|
+
# See https://www.getdrip.com/docs/rest-api#tags
|
10
|
+
def tags
|
11
|
+
get "#{account_id}/tags"
|
12
|
+
end
|
13
|
+
|
6
14
|
# Public: Apply a tag to a subscriber.
|
7
15
|
#
|
8
16
|
# email - The String email address of the subscriber.
|
data/lib/drip/collections.rb
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
require "drip/collections/accounts"
|
2
2
|
require "drip/collections/subscribers"
|
3
|
+
require "drip/collections/tags"
|
3
4
|
require "drip/collections/errors"
|
5
|
+
require "drip/collections/purchases"
|
4
6
|
|
5
7
|
module Drip
|
6
8
|
module Collections
|
@@ -8,7 +10,9 @@ module Drip
|
|
8
10
|
[
|
9
11
|
Drip::Accounts,
|
10
12
|
Drip::Subscribers,
|
11
|
-
Drip::Errors
|
13
|
+
Drip::Errors,
|
14
|
+
Drip::Tags,
|
15
|
+
Drip::Purchases
|
12
16
|
]
|
13
17
|
end
|
14
18
|
|
data/lib/drip/resources.rb
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
require "drip/resources/account"
|
2
2
|
require "drip/resources/subscriber"
|
3
|
+
require "drip/resources/tag"
|
3
4
|
require "drip/resources/error"
|
5
|
+
require "drip/resources/purchase"
|
4
6
|
|
5
7
|
module Drip
|
6
8
|
module Resources
|
@@ -8,7 +10,9 @@ module Drip
|
|
8
10
|
[
|
9
11
|
Drip::Account,
|
10
12
|
Drip::Subscriber,
|
11
|
-
Drip::Error
|
13
|
+
Drip::Error,
|
14
|
+
Drip::Tags,
|
15
|
+
Drip::Purchase
|
12
16
|
]
|
13
17
|
end
|
14
18
|
|
data/lib/drip/version.rb
CHANGED
@@ -0,0 +1,94 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/../../test_helper.rb'
|
2
|
+
|
3
|
+
class Drip::Client::PurchasesTest < Drip::TestCase
|
4
|
+
def setup
|
5
|
+
@stubs = Faraday::Adapter::Test::Stubs.new
|
6
|
+
|
7
|
+
@connection = Faraday.new do |builder|
|
8
|
+
builder.adapter :test, @stubs
|
9
|
+
end
|
10
|
+
|
11
|
+
@client = Drip::Client.new { |c| c.account_id = "12345" }
|
12
|
+
@client.expects(:connection).at_least_once.returns(@connection)
|
13
|
+
end
|
14
|
+
|
15
|
+
context "#create_purchase" do
|
16
|
+
setup do
|
17
|
+
@email = "derrick@getdrip.com"
|
18
|
+
@amount = 3900
|
19
|
+
@properties = {
|
20
|
+
address: '123 Anywhere St'
|
21
|
+
}
|
22
|
+
|
23
|
+
@items = [
|
24
|
+
{
|
25
|
+
name: 'foo',
|
26
|
+
amount: 100
|
27
|
+
},
|
28
|
+
{
|
29
|
+
name: 'bar',
|
30
|
+
amount: 200
|
31
|
+
}
|
32
|
+
]
|
33
|
+
|
34
|
+
@payload = {
|
35
|
+
purchases: [{
|
36
|
+
properties: @properties,
|
37
|
+
items: @items,
|
38
|
+
amount: @amount
|
39
|
+
}]
|
40
|
+
}.to_json
|
41
|
+
|
42
|
+
@response_status = 201
|
43
|
+
@response_body = stub
|
44
|
+
|
45
|
+
@stubs.post "12345/subscribers/#{CGI.escape @email}/purchases", @payload do
|
46
|
+
[@response_status, {}, @response_body]
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
should "send the right request" do
|
51
|
+
expected = Drip::Response.new(@response_status, @response_body)
|
52
|
+
assert_equal expected, @client.create_purchase(@email, @amount, {
|
53
|
+
properties: @properties,
|
54
|
+
items: @items
|
55
|
+
})
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
context "#purchases" do
|
60
|
+
setup do
|
61
|
+
@email = "derrick@getdrip.com"
|
62
|
+
@response_status = 201
|
63
|
+
@response_body = stub
|
64
|
+
|
65
|
+
@stubs.get "12345/subscribers/#{CGI.escape @email}/purchases" do
|
66
|
+
[@response_status, {}, @response_body]
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
should "send the right request" do
|
71
|
+
expected = Drip::Response.new(@response_status, @response_body)
|
72
|
+
assert_equal expected, @client.purchases(@email)
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
context "#purchase" do
|
77
|
+
setup do
|
78
|
+
@email = "derrick@getdrip.com"
|
79
|
+
@id = '23456'
|
80
|
+
@response_status = 201
|
81
|
+
@response_body = stub
|
82
|
+
|
83
|
+
@stubs.get "12345/subscribers/#{CGI.escape @email}/purchases/#{@id}" do
|
84
|
+
[@response_status, {}, @response_body]
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
88
|
+
should "send the right request" do
|
89
|
+
expected = Drip::Response.new(@response_status, @response_body)
|
90
|
+
assert_equal expected, @client.purchase(@email, @id)
|
91
|
+
end
|
92
|
+
end
|
93
|
+
|
94
|
+
end
|
@@ -12,6 +12,22 @@ class Drip::Client::TagsTest < Drip::TestCase
|
|
12
12
|
@client.expects(:connection).at_least_once.returns(@connection)
|
13
13
|
end
|
14
14
|
|
15
|
+
context "#tags" do
|
16
|
+
setup do
|
17
|
+
@response_status = 200
|
18
|
+
@response_body = stub
|
19
|
+
|
20
|
+
@stubs.get "12345/tags" do
|
21
|
+
[@response_status, {}, @response_body]
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
should "send the right request" do
|
26
|
+
expected = Drip::Response.new(@response_status, @response_body)
|
27
|
+
assert_equal expected, @client.tags
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
15
31
|
context "#apply_tag" do
|
16
32
|
setup do
|
17
33
|
@email = "derrick@getdrip.com"
|
@@ -5,6 +5,7 @@ class Drip::CollectionsTest < Drip::TestCase
|
|
5
5
|
assert_equal Drip::Subscribers, Drip::Collections.find_class("subscribers")
|
6
6
|
assert_equal Drip::Accounts, Drip::Collections.find_class("accounts")
|
7
7
|
assert_equal Drip::Errors, Drip::Collections.find_class("errors")
|
8
|
+
assert_equal Drip::Purchases, Drip::Collections.find_class("purchases")
|
8
9
|
end
|
9
10
|
|
10
11
|
should "return base collection by default" do
|
data/test/drip/resources_test.rb
CHANGED
@@ -4,6 +4,7 @@ class Drip::ResourcesTest < Drip::TestCase
|
|
4
4
|
should "find resources" do
|
5
5
|
assert_equal Drip::Subscriber, Drip::Resources.find_class("subscriber")
|
6
6
|
assert_equal Drip::Error, Drip::Resources.find_class("error")
|
7
|
+
assert_equal Drip::Purchase, Drip::Resources.find_class("purchase")
|
7
8
|
end
|
8
9
|
|
9
10
|
should "return base resource by default" do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: drip-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Derrick Reimer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-02-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -108,20 +108,6 @@ dependencies:
|
|
108
108
|
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '0.9'
|
111
|
-
- !ruby/object:Gem::Dependency
|
112
|
-
name: json
|
113
|
-
requirement: !ruby/object:Gem::Requirement
|
114
|
-
requirements:
|
115
|
-
- - "~>"
|
116
|
-
- !ruby/object:Gem::Version
|
117
|
-
version: '1.8'
|
118
|
-
type: :runtime
|
119
|
-
prerelease: false
|
120
|
-
version_requirements: !ruby/object:Gem::Requirement
|
121
|
-
requirements:
|
122
|
-
- - "~>"
|
123
|
-
- !ruby/object:Gem::Version
|
124
|
-
version: '1.8'
|
125
111
|
description: A simple wrapper for the Drip API
|
126
112
|
email:
|
127
113
|
- derrickreimer@gmail.com
|
@@ -141,23 +127,29 @@ files:
|
|
141
127
|
- lib/drip/client/accounts.rb
|
142
128
|
- lib/drip/client/campaigns.rb
|
143
129
|
- lib/drip/client/events.rb
|
130
|
+
- lib/drip/client/purchases.rb
|
144
131
|
- lib/drip/client/subscribers.rb
|
145
132
|
- lib/drip/client/tags.rb
|
146
133
|
- lib/drip/collection.rb
|
147
134
|
- lib/drip/collections.rb
|
148
135
|
- lib/drip/collections/accounts.rb
|
149
136
|
- lib/drip/collections/errors.rb
|
137
|
+
- lib/drip/collections/purchases.rb
|
150
138
|
- lib/drip/collections/subscribers.rb
|
139
|
+
- lib/drip/collections/tags.rb
|
151
140
|
- lib/drip/resource.rb
|
152
141
|
- lib/drip/resources.rb
|
153
142
|
- lib/drip/resources/account.rb
|
154
143
|
- lib/drip/resources/error.rb
|
144
|
+
- lib/drip/resources/purchase.rb
|
155
145
|
- lib/drip/resources/subscriber.rb
|
146
|
+
- lib/drip/resources/tag.rb
|
156
147
|
- lib/drip/response.rb
|
157
148
|
- lib/drip/version.rb
|
158
149
|
- test/drip/client/accounts_test.rb
|
159
150
|
- test/drip/client/campaigns_test.rb
|
160
151
|
- test/drip/client/events_test.rb
|
152
|
+
- test/drip/client/purchases_test.rb
|
161
153
|
- test/drip/client/subscribers_test.rb
|
162
154
|
- test/drip/client/tags_test.rb
|
163
155
|
- test/drip/client_test.rb
|
@@ -183,7 +175,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
183
175
|
requirements:
|
184
176
|
- - ">="
|
185
177
|
- !ruby/object:Gem::Version
|
186
|
-
version:
|
178
|
+
version: 1.9.3
|
187
179
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
188
180
|
requirements:
|
189
181
|
- - ">="
|
@@ -191,7 +183,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
191
183
|
version: '0'
|
192
184
|
requirements: []
|
193
185
|
rubyforge_project:
|
194
|
-
rubygems_version: 2.
|
186
|
+
rubygems_version: 2.5.1
|
195
187
|
signing_key:
|
196
188
|
specification_version: 4
|
197
189
|
summary: A Ruby gem for interacting with the Drip API
|
@@ -199,6 +191,7 @@ test_files:
|
|
199
191
|
- test/drip/client/accounts_test.rb
|
200
192
|
- test/drip/client/campaigns_test.rb
|
201
193
|
- test/drip/client/events_test.rb
|
194
|
+
- test/drip/client/purchases_test.rb
|
202
195
|
- test/drip/client/subscribers_test.rb
|
203
196
|
- test/drip/client/tags_test.rb
|
204
197
|
- test/drip/client_test.rb
|