drip-ruby 0.0.12 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rubocop.yml +17 -0
- data/.rubocop_todo.yml +134 -0
- data/README.md +107 -13
- data/Rakefile +1 -1
- data/drip-ruby.gemspec +2 -2
- data/lib/drip/client.rb +23 -7
- data/lib/drip/client/accounts.rb +10 -0
- data/lib/drip/client/broadcasts.rb +29 -0
- data/lib/drip/client/campaign_subscriptions.rb +15 -0
- data/lib/drip/client/campaigns.rb +54 -0
- data/lib/drip/client/conversions.rb +27 -0
- data/lib/drip/client/custom_fields.rb +13 -0
- data/lib/drip/client/events.rb +13 -0
- data/lib/drip/client/forms.rb +23 -0
- data/lib/drip/client/purchases.rb +1 -1
- data/lib/drip/client/subscribers.rb +28 -6
- data/lib/drip/client/webhooks.rb +59 -0
- data/lib/drip/client/workflow_triggers.rb +44 -0
- data/lib/drip/client/workflows.rb +80 -0
- data/lib/drip/collections.rb +17 -5
- data/lib/drip/collections/broadcasts.rb +13 -0
- data/lib/drip/collections/campaign_subscriptions.rb +13 -0
- data/lib/drip/collections/campaigns.rb +13 -0
- data/lib/drip/collections/webhooks.rb +13 -0
- data/lib/drip/collections/workflow_triggers.rb +13 -0
- data/lib/drip/collections/workflows.rb +13 -0
- data/lib/drip/resources.rb +17 -5
- data/lib/drip/resources/broadcast.rb +9 -0
- data/lib/drip/resources/campaign.rb +9 -0
- data/lib/drip/resources/campaign_subscription.rb +9 -0
- data/lib/drip/resources/webhook.rb +9 -0
- data/lib/drip/resources/workflow.rb +9 -0
- data/lib/drip/resources/workflow_trigger.rb +9 -0
- data/lib/drip/response.rb +1 -1
- data/lib/drip/version.rb +1 -1
- data/test/drip/client/accounts_test.rb +17 -0
- data/test/drip/client/broadcasts_test.rb +47 -0
- data/test/drip/client/campaign_subscriptions_test.rb +31 -0
- data/test/drip/client/campaigns_test.rb +68 -0
- data/test/drip/client/conversions_test.rb +47 -0
- data/test/drip/client/custom_fields_test.rb +30 -0
- data/test/drip/client/events_test.rb +21 -5
- data/test/drip/client/forms_test.rb +47 -0
- data/test/drip/client/purchases_test.rb +0 -1
- data/test/drip/client/subscribers_test.rb +52 -9
- data/test/drip/client/webhooks_test.rb +91 -0
- data/test/drip/client/workflow_triggers_test.rb +85 -0
- data/test/drip/client/workflows_test.rb +122 -0
- data/test/drip/collection_test.rb +1 -1
- data/test/drip/collections_test.rb +8 -1
- data/test/drip/resources_test.rb +8 -1
- data/test/drip/response_test.rb +2 -2
- data/test/test_helper.rb +1 -1
- metadata +40 -2
@@ -2,7 +2,7 @@ require File.dirname(__FILE__) + '/../test_helper.rb'
|
|
2
2
|
|
3
3
|
class Drip::CollectionTest < Drip::TestCase
|
4
4
|
should "yield resources of the correct type" do
|
5
|
-
raw_data = [
|
5
|
+
raw_data = [load_json_fixture("resources/subscriber.json")]
|
6
6
|
collection = TestCollection.new(raw_data)
|
7
7
|
|
8
8
|
collection.each do |item|
|
@@ -2,10 +2,17 @@ require File.dirname(__FILE__) + '/../test_helper.rb'
|
|
2
2
|
|
3
3
|
class Drip::CollectionsTest < Drip::TestCase
|
4
4
|
should "find collections" do
|
5
|
-
assert_equal Drip::Subscribers, Drip::Collections.find_class("subscribers")
|
6
5
|
assert_equal Drip::Accounts, Drip::Collections.find_class("accounts")
|
6
|
+
assert_equal Drip::Broadcasts, Drip::Collections.find_class("broadcasts")
|
7
|
+
assert_equal Drip::Campaigns, Drip::Collections.find_class("campaigns")
|
8
|
+
assert_equal Drip::CampaignSubscriptions, Drip::Collections.find_class("campaign_subscriptions")
|
7
9
|
assert_equal Drip::Errors, Drip::Collections.find_class("errors")
|
8
10
|
assert_equal Drip::Purchases, Drip::Collections.find_class("purchases")
|
11
|
+
assert_equal Drip::Subscribers, Drip::Collections.find_class("subscribers")
|
12
|
+
assert_equal Drip::Tags, Drip::Collections.find_class("tags")
|
13
|
+
assert_equal Drip::Webhooks, Drip::Collections.find_class("webhooks")
|
14
|
+
assert_equal Drip::Workflows, Drip::Collections.find_class("workflows")
|
15
|
+
assert_equal Drip::WorkflowTriggers, Drip::Collections.find_class("workflow_triggers")
|
9
16
|
end
|
10
17
|
|
11
18
|
should "return base collection by default" do
|
data/test/drip/resources_test.rb
CHANGED
@@ -2,9 +2,16 @@ require File.dirname(__FILE__) + '/../test_helper.rb'
|
|
2
2
|
|
3
3
|
class Drip::ResourcesTest < Drip::TestCase
|
4
4
|
should "find resources" do
|
5
|
-
assert_equal Drip::
|
5
|
+
assert_equal Drip::Broadcast, Drip::Resources.find_class("broadcast")
|
6
|
+
assert_equal Drip::Campaign, Drip::Resources.find_class("campaign")
|
7
|
+
assert_equal Drip::CampaignSubscription, Drip::Resources.find_class("campaign_subscription")
|
6
8
|
assert_equal Drip::Error, Drip::Resources.find_class("error")
|
7
9
|
assert_equal Drip::Purchase, Drip::Resources.find_class("purchase")
|
10
|
+
assert_equal Drip::Subscriber, Drip::Resources.find_class("subscriber")
|
11
|
+
assert_equal Drip::Tag, Drip::Resources.find_class("tag")
|
12
|
+
assert_equal Drip::Webhook, Drip::Resources.find_class("webhook")
|
13
|
+
assert_equal Drip::Workflow, Drip::Resources.find_class("workflow")
|
14
|
+
assert_equal Drip::WorkflowTrigger, Drip::Resources.find_class("workflow_trigger")
|
8
15
|
end
|
9
16
|
|
10
17
|
should "return base resource by default" do
|
data/test/drip/response_test.rb
CHANGED
@@ -111,7 +111,7 @@ class Drip::ResponseTest < Drip::TestCase
|
|
111
111
|
|
112
112
|
context "members" do
|
113
113
|
setup do
|
114
|
-
@members = [
|
114
|
+
@members = [load_json_fixture("resources/subscriber.json")]
|
115
115
|
@body = { "subscribers" => @members }
|
116
116
|
@subject = Drip::Response.new(200, @body)
|
117
117
|
end
|
@@ -124,7 +124,7 @@ class Drip::ResponseTest < Drip::TestCase
|
|
124
124
|
|
125
125
|
context "rate limit response" do
|
126
126
|
setup do
|
127
|
-
@body = {"message"=>"API rate limit exceeded. Please try again in an hour."}
|
127
|
+
@body = { "message" => "API rate limit exceeded. Please try again in an hour." }
|
128
128
|
@subject = Drip::Response.new(429, @body)
|
129
129
|
end
|
130
130
|
|
data/test/test_helper.rb
CHANGED
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: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Derrick Reimer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-12-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -116,6 +116,8 @@ extensions: []
|
|
116
116
|
extra_rdoc_files: []
|
117
117
|
files:
|
118
118
|
- ".gitignore"
|
119
|
+
- ".rubocop.yml"
|
120
|
+
- ".rubocop_todo.yml"
|
119
121
|
- ".travis.yml"
|
120
122
|
- Gemfile
|
121
123
|
- LICENSE.txt
|
@@ -125,33 +127,61 @@ files:
|
|
125
127
|
- lib/drip.rb
|
126
128
|
- lib/drip/client.rb
|
127
129
|
- lib/drip/client/accounts.rb
|
130
|
+
- lib/drip/client/broadcasts.rb
|
131
|
+
- lib/drip/client/campaign_subscriptions.rb
|
128
132
|
- lib/drip/client/campaigns.rb
|
133
|
+
- lib/drip/client/conversions.rb
|
134
|
+
- lib/drip/client/custom_fields.rb
|
129
135
|
- lib/drip/client/events.rb
|
136
|
+
- lib/drip/client/forms.rb
|
130
137
|
- lib/drip/client/purchases.rb
|
131
138
|
- lib/drip/client/subscribers.rb
|
132
139
|
- lib/drip/client/tags.rb
|
140
|
+
- lib/drip/client/webhooks.rb
|
141
|
+
- lib/drip/client/workflow_triggers.rb
|
142
|
+
- lib/drip/client/workflows.rb
|
133
143
|
- lib/drip/collection.rb
|
134
144
|
- lib/drip/collections.rb
|
135
145
|
- lib/drip/collections/accounts.rb
|
146
|
+
- lib/drip/collections/broadcasts.rb
|
147
|
+
- lib/drip/collections/campaign_subscriptions.rb
|
148
|
+
- lib/drip/collections/campaigns.rb
|
136
149
|
- lib/drip/collections/errors.rb
|
137
150
|
- lib/drip/collections/purchases.rb
|
138
151
|
- lib/drip/collections/subscribers.rb
|
139
152
|
- lib/drip/collections/tags.rb
|
153
|
+
- lib/drip/collections/webhooks.rb
|
154
|
+
- lib/drip/collections/workflow_triggers.rb
|
155
|
+
- lib/drip/collections/workflows.rb
|
140
156
|
- lib/drip/resource.rb
|
141
157
|
- lib/drip/resources.rb
|
142
158
|
- lib/drip/resources/account.rb
|
159
|
+
- lib/drip/resources/broadcast.rb
|
160
|
+
- lib/drip/resources/campaign.rb
|
161
|
+
- lib/drip/resources/campaign_subscription.rb
|
143
162
|
- lib/drip/resources/error.rb
|
144
163
|
- lib/drip/resources/purchase.rb
|
145
164
|
- lib/drip/resources/subscriber.rb
|
146
165
|
- lib/drip/resources/tag.rb
|
166
|
+
- lib/drip/resources/webhook.rb
|
167
|
+
- lib/drip/resources/workflow.rb
|
168
|
+
- lib/drip/resources/workflow_trigger.rb
|
147
169
|
- lib/drip/response.rb
|
148
170
|
- lib/drip/version.rb
|
149
171
|
- test/drip/client/accounts_test.rb
|
172
|
+
- test/drip/client/broadcasts_test.rb
|
173
|
+
- test/drip/client/campaign_subscriptions_test.rb
|
150
174
|
- test/drip/client/campaigns_test.rb
|
175
|
+
- test/drip/client/conversions_test.rb
|
176
|
+
- test/drip/client/custom_fields_test.rb
|
151
177
|
- test/drip/client/events_test.rb
|
178
|
+
- test/drip/client/forms_test.rb
|
152
179
|
- test/drip/client/purchases_test.rb
|
153
180
|
- test/drip/client/subscribers_test.rb
|
154
181
|
- test/drip/client/tags_test.rb
|
182
|
+
- test/drip/client/webhooks_test.rb
|
183
|
+
- test/drip/client/workflow_triggers_test.rb
|
184
|
+
- test/drip/client/workflows_test.rb
|
155
185
|
- test/drip/client_test.rb
|
156
186
|
- test/drip/collection_test.rb
|
157
187
|
- test/drip/collections_test.rb
|
@@ -189,11 +219,19 @@ specification_version: 4
|
|
189
219
|
summary: A Ruby gem for interacting with the Drip API
|
190
220
|
test_files:
|
191
221
|
- test/drip/client/accounts_test.rb
|
222
|
+
- test/drip/client/broadcasts_test.rb
|
223
|
+
- test/drip/client/campaign_subscriptions_test.rb
|
192
224
|
- test/drip/client/campaigns_test.rb
|
225
|
+
- test/drip/client/conversions_test.rb
|
226
|
+
- test/drip/client/custom_fields_test.rb
|
193
227
|
- test/drip/client/events_test.rb
|
228
|
+
- test/drip/client/forms_test.rb
|
194
229
|
- test/drip/client/purchases_test.rb
|
195
230
|
- test/drip/client/subscribers_test.rb
|
196
231
|
- test/drip/client/tags_test.rb
|
232
|
+
- test/drip/client/webhooks_test.rb
|
233
|
+
- test/drip/client/workflow_triggers_test.rb
|
234
|
+
- test/drip/client/workflows_test.rb
|
197
235
|
- test/drip/client_test.rb
|
198
236
|
- test/drip/collection_test.rb
|
199
237
|
- test/drip/collections_test.rb
|