drip-ruby 3.3.1 → 3.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (102) hide show
  1. checksums.yaml +5 -5
  2. data/.rubocop.yml +1 -1
  3. data/.travis.yml +0 -1
  4. data/CHANGELOG.md +11 -1
  5. data/Gemfile +2 -0
  6. data/README.md +6 -0
  7. data/Rakefile +2 -0
  8. data/drip-ruby.gemspec +2 -1
  9. data/lib/drip.rb +2 -0
  10. data/lib/drip/client.rb +6 -2
  11. data/lib/drip/client/accounts.rb +2 -0
  12. data/lib/drip/client/broadcasts.rb +2 -0
  13. data/lib/drip/client/campaign_subscriptions.rb +2 -0
  14. data/lib/drip/client/campaigns.rb +2 -0
  15. data/lib/drip/client/configuration.rb +3 -1
  16. data/lib/drip/client/conversions.rb +2 -0
  17. data/lib/drip/client/custom_fields.rb +2 -0
  18. data/lib/drip/client/events.rb +2 -0
  19. data/lib/drip/client/forms.rb +2 -0
  20. data/lib/drip/client/http_client.rb +2 -0
  21. data/lib/drip/client/orders.rb +2 -0
  22. data/lib/drip/client/shopper_activity.rb +3 -1
  23. data/lib/drip/client/subscribers.rb +2 -0
  24. data/lib/drip/client/tags.rb +2 -0
  25. data/lib/drip/client/users.rb +17 -0
  26. data/lib/drip/client/webhooks.rb +2 -0
  27. data/lib/drip/client/workflow_triggers.rb +2 -0
  28. data/lib/drip/client/workflows.rb +2 -0
  29. data/lib/drip/collection.rb +2 -0
  30. data/lib/drip/collections.rb +2 -0
  31. data/lib/drip/collections/accounts.rb +2 -0
  32. data/lib/drip/collections/broadcasts.rb +2 -0
  33. data/lib/drip/collections/campaign_subscriptions.rb +2 -0
  34. data/lib/drip/collections/campaigns.rb +2 -0
  35. data/lib/drip/collections/errors.rb +2 -0
  36. data/lib/drip/collections/orders.rb +2 -0
  37. data/lib/drip/collections/purchases.rb +2 -0
  38. data/lib/drip/collections/subscribers.rb +2 -0
  39. data/lib/drip/collections/tags.rb +2 -0
  40. data/lib/drip/collections/webhooks.rb +2 -0
  41. data/lib/drip/collections/workflow_triggers.rb +2 -0
  42. data/lib/drip/collections/workflows.rb +2 -0
  43. data/lib/drip/errors.rb +2 -0
  44. data/lib/drip/request.rb +2 -0
  45. data/lib/drip/resource.rb +2 -0
  46. data/lib/drip/resources.rb +2 -0
  47. data/lib/drip/resources/account.rb +2 -0
  48. data/lib/drip/resources/broadcast.rb +2 -0
  49. data/lib/drip/resources/campaign.rb +2 -0
  50. data/lib/drip/resources/campaign_subscription.rb +2 -0
  51. data/lib/drip/resources/error.rb +2 -0
  52. data/lib/drip/resources/order.rb +2 -0
  53. data/lib/drip/resources/purchase.rb +2 -0
  54. data/lib/drip/resources/subscriber.rb +2 -0
  55. data/lib/drip/resources/tag.rb +2 -0
  56. data/lib/drip/resources/webhook.rb +2 -0
  57. data/lib/drip/resources/workflow.rb +2 -0
  58. data/lib/drip/resources/workflow_trigger.rb +2 -0
  59. data/lib/drip/response.rb +2 -0
  60. data/lib/drip/version.rb +3 -1
  61. data/test/drip/client/accounts_test.rb +2 -0
  62. data/test/drip/client/broadcasts_test.rb +2 -0
  63. data/test/drip/client/campaign_subscriptions_test.rb +2 -0
  64. data/test/drip/client/campaigns_test.rb +2 -0
  65. data/test/drip/client/configuration_test.rb +2 -0
  66. data/test/drip/client/conversions_test.rb +2 -0
  67. data/test/drip/client/custom_fields_test.rb +2 -0
  68. data/test/drip/client/events_test.rb +2 -0
  69. data/test/drip/client/forms_test.rb +2 -0
  70. data/test/drip/client/http_client_test.rb +2 -0
  71. data/test/drip/client/orders_test.rb +2 -0
  72. data/test/drip/client/shopper_activity_test.rb +14 -0
  73. data/test/drip/client/subscribers_test.rb +2 -0
  74. data/test/drip/client/tags_test.rb +2 -0
  75. data/test/drip/client/users_test.rb +24 -0
  76. data/test/drip/client/webhooks_test.rb +2 -0
  77. data/test/drip/client/workflow_triggers_test.rb +2 -0
  78. data/test/drip/client/workflows_test.rb +2 -0
  79. data/test/drip/client_test.rb +2 -0
  80. data/test/drip/collection_test.rb +2 -0
  81. data/test/drip/collections/account_test.rb +2 -0
  82. data/test/drip/collections/broadcasts_test.rb +2 -0
  83. data/test/drip/collections/campaign_subscriptions_test.rb +2 -0
  84. data/test/drip/collections/campaigns_test.rb +2 -0
  85. data/test/drip/collections/errors_test.rb +2 -0
  86. data/test/drip/collections/orders_test.rb +2 -0
  87. data/test/drip/collections/purchases_test.rb +2 -0
  88. data/test/drip/collections/tags_test.rb +2 -0
  89. data/test/drip/collections/webhooks_test.rb +2 -0
  90. data/test/drip/collections/workflow_triggers_test.rb +2 -0
  91. data/test/drip/collections/workflows_test.rb +2 -0
  92. data/test/drip/collections_test.rb +2 -0
  93. data/test/drip/request_test.rb +2 -0
  94. data/test/drip/resource_test.rb +2 -0
  95. data/test/drip/resources/account_test.rb +2 -0
  96. data/test/drip/resources/order_test.rb +2 -0
  97. data/test/drip/resources/subscriber_test.rb +2 -0
  98. data/test/drip/resources/tag_test.rb +2 -0
  99. data/test/drip/resources_test.rb +2 -0
  100. data/test/drip/response_test.rb +2 -0
  101. data/test/test_helper.rb +2 -0
  102. metadata +7 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 4ccbc1741cd10add7fca7bc17e87f2e75688000f
4
- data.tar.gz: 6f9b2ff19785e69c175a7b0f77bcf226dc74de41
2
+ SHA256:
3
+ metadata.gz: 1d6b905e4408493869bc0195b63096d82b56e5a3d321e07fd65922b85e436fe8
4
+ data.tar.gz: 178de71bc5d233c44700fe3a2e4749b50a105416b3660b27138f566241b2483f
5
5
  SHA512:
6
- metadata.gz: f8319350060348e6b3bfc61f5e8d2b949aac51e6ae79d727ceac55a02fdcb1ae096167de5588e50e33e8ecaa1dff2b391ee210add8e4b0d603f5c613b4cb882c
7
- data.tar.gz: a984d39cf4d0fc9e36d7acef89e8d27340bb566e9ef4ce7e4d0669cb25276b1be6b368699343b7e7d7a147ebc170bb8a4fa9f3800d3209a86e7d22e6f8156711
6
+ metadata.gz: fe7e16838b2e41df4e7f21437b97dd9d98c11d4d050333de9a774ea681c1bebb406b76aaf1f9d341c3b050a31507723b33482b0deacd24ae7d8ad6fcf97fcf59
7
+ data.tar.gz: fa9abac2ca22886a0dc27476c8ece0cddf585197703d3a08b39b63978fc57377aa59369c9db434ba25e4ebea250f5a41a51a21364e2daf5fb34043e678e8052f
@@ -1,7 +1,7 @@
1
1
  inherit_from: .rubocop_todo.yml
2
2
 
3
3
  AllCops:
4
- TargetRubyVersion: '2.2'
4
+ TargetRubyVersion: '2.3'
5
5
  Exclude:
6
6
  - 'test/fixtures/**/*'
7
7
 
@@ -5,5 +5,4 @@ rvm:
5
5
  - 2.5
6
6
  - 2.4
7
7
  - 2.3
8
- - 2.2
9
8
  - jruby-19mode
@@ -6,10 +6,20 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
- [master]: https://github.com/DripEmail/drip-ruby/compare/v3.3.1...HEAD
9
+ [master]: https://github.com/DripEmail/drip-ruby/compare/v3.4.0...HEAD
10
10
 
11
11
  - Your contribution here!
12
12
 
13
+ ## [3.4.0] - 2020-04-21
14
+
15
+ [3.4.0]: https://github.com/DripEmail/drip-ruby/compare/v3.3.1...v3.4.0
16
+
17
+ ### Added
18
+ - Support for the user endpoint in the REST API
19
+
20
+ ### Changed
21
+ - `Drip::Client#create_cart_activity_event` can be used with visitor UUID
22
+
13
23
  ## [3.3.1] - 2019-05-28
14
24
 
15
25
  [3.3.1]: https://github.com/DripEmail/drip-ruby/compare/v3.3.0...v3.3.1
data/Gemfile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  source 'https://rubygems.org'
2
4
 
3
5
  # Specify your gem's dependencies in drip-ruby.gemspec
data/README.md CHANGED
@@ -150,6 +150,12 @@ as methods on the client object. The following methods are currently available:
150
150
  | Apply a tag | `#apply_tag(email, tag)` |
151
151
  | Remove a tag | `#remove_tag(email, tag)` |
152
152
 
153
+
154
+ #### Users
155
+ | Actions | Methods |
156
+ | :------------------------- | :--------------------------------------------------- |
157
+ | Fetch user | `#user` |
158
+
153
159
  #### Webhooks
154
160
 
155
161
  | Actions | Methods |
data/Rakefile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "bundler/gem_tasks"
2
4
  require "rake/testtask"
3
5
 
@@ -1,4 +1,5 @@
1
1
  # coding: utf-8
2
+ # frozen_string_literal: true
2
3
 
3
4
  lib = File.expand_path('../lib', __FILE__)
4
5
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
@@ -19,5 +20,5 @@ Gem::Specification.new do |spec|
19
20
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
20
21
  spec.require_paths = ["lib"]
21
22
 
22
- spec.required_ruby_version = '>= 2.2'
23
+ spec.required_ruby_version = '>= 2.3'
23
24
  end
@@ -1,2 +1,4 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "drip/version"
2
4
  require "drip/client"
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "drip/errors"
2
4
  require "drip/request"
3
5
  require "drip/response"
@@ -15,6 +17,7 @@ require "drip/client/orders"
15
17
  require "drip/client/shopper_activity"
16
18
  require "drip/client/subscribers"
17
19
  require "drip/client/tags"
20
+ require "drip/client/users"
18
21
  require "drip/client/webhooks"
19
22
  require "drip/client/workflows"
20
23
  require "drip/client/workflow_triggers"
@@ -36,6 +39,7 @@ module Drip
36
39
  include ShopperActivity
37
40
  include Subscribers
38
41
  include Tags
42
+ include Users
39
43
  include Webhooks
40
44
  include Workflows
41
45
  include WorkflowTriggers
@@ -52,10 +56,10 @@ module Drip
52
56
  end
53
57
  end
54
58
 
55
- JSON_API_CONTENT_TYPE = "application/vnd.api+json".freeze
59
+ JSON_API_CONTENT_TYPE = "application/vnd.api+json"
56
60
  private_constant :JSON_API_CONTENT_TYPE
57
61
 
58
- JSON_CONTENT_TYPE = "application/json".freeze
62
+ JSON_CONTENT_TYPE = "application/json"
59
63
  private_constant :JSON_CONTENT_TYPE
60
64
 
61
65
  def initialize(options = {})
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Drip
2
4
  class Client
3
5
  module Accounts
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Drip
2
4
  class Client
3
5
  module Broadcasts
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Drip
2
4
  class Client
3
5
  module CampaignSubscriptions
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Drip
2
4
  class Client
3
5
  module Campaigns
@@ -1,7 +1,9 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Drip
2
4
  class Client
3
5
  class Configuration
4
- DEFAULT_URL_PREFIX = "https://api.getdrip.com/".freeze
6
+ DEFAULT_URL_PREFIX = "https://api.getdrip.com/"
5
7
  private_constant :DEFAULT_URL_PREFIX
6
8
 
7
9
  CONFIGURATION_FIELDS = %i[access_token api_key account_id url_prefix http_open_timeout http_timeout].freeze
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Drip
2
4
  class Client
3
5
  module Conversions
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Drip
2
4
  class Client
3
5
  module CustomFields
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Drip
2
4
  class Client
3
5
  module Events
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Drip
2
4
  class Client
3
5
  module Forms
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Drip
2
4
  class Client
3
5
  class HTTPClient
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Drip
2
4
  class Client
3
5
  module Orders
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Drip
2
4
  class Client
3
5
  module ShopperActivity
@@ -9,7 +11,7 @@ module Drip
9
11
  # Returns a Drip::Response.
10
12
  # See https://developer.drip.com/#cart-activity
11
13
  def create_cart_activity_event(data = {})
12
- raise ArgumentError, 'email: or person_id: parameter required' if !data.key?(:email) && !data.key?(:person_id)
14
+ raise ArgumentError, 'email:, person_id:, or :visitor_uuid parameter required' if !data.key?(:email) && !data.key?(:person_id) && !data.key?(:visitor_uuid)
13
15
 
14
16
  %i[provider action cart_id cart_url].each do |key|
15
17
  raise ArgumentError, "#{key}: parameter required" unless data.key?(key)
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "cgi"
2
4
 
3
5
  module Drip
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "cgi"
2
4
 
3
5
  module Drip
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "cgi"
4
+
5
+ module Drip
6
+ class Client
7
+ module Users
8
+ # Public: Fetch the authenticated user
9
+ #
10
+ # Returns a Drip::Response.
11
+ # See https://developer.drip.com/#users
12
+ def user
13
+ make_json_api_request :get, "v2/user"
14
+ end
15
+ end
16
+ end
17
+ end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Drip
2
4
  class Client
3
5
  module Webhooks
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Drip
2
4
  class Client
3
5
  module WorkflowTriggers
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "cgi"
2
4
 
3
5
  module Drip
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Drip
2
4
  class Collection
3
5
  include Enumerable
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "drip/collections/accounts"
2
4
  require "drip/collections/broadcasts"
3
5
  require "drip/collections/campaigns"
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "drip/collection"
2
4
 
3
5
  module Drip
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "drip/collection"
2
4
 
3
5
  module Drip
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "drip/collection"
2
4
 
3
5
  module Drip
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "drip/collection"
2
4
 
3
5
  module Drip
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "drip/collection"
2
4
 
3
5
  module Drip
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "drip/collection"
2
4
 
3
5
  module Drip
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "drip/collection"
2
4
 
3
5
  module Drip
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "drip/collection"
2
4
 
3
5
  module Drip
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "drip/collection"
2
4
 
3
5
  module Drip
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "drip/collection"
2
4
 
3
5
  module Drip
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "drip/collection"
2
4
 
3
5
  module Drip
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "drip/collection"
2
4
 
3
5
  module Drip
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Drip
2
4
  class TooManyRedirectsError < StandardError; end
3
5
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "net/http"
2
4
 
3
5
  module Drip
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "time"
2
4
 
3
5
  module Drip
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "drip/resources/account"
2
4
  require "drip/resources/broadcast"
3
5
  require "drip/resources/campaign"
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "drip/resource"
2
4
 
3
5
  module Drip
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "drip/resource"
2
4
 
3
5
  module Drip
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "drip/resource"
2
4
 
3
5
  module Drip
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "drip/resource"
2
4
 
3
5
  module Drip
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "drip/resource"
2
4
 
3
5
  module Drip
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "drip/resource"
2
4
 
3
5
  module Drip
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "drip/resource"
2
4
 
3
5
  module Drip
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "drip/resource"
2
4
 
3
5
  module Drip
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "drip/resource"
2
4
 
3
5
  module Drip
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "drip/resource"
2
4
 
3
5
  module Drip
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "drip/resource"
2
4
 
3
5
  module Drip
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "drip/resource"
2
4
 
3
5
  module Drip
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "drip/resources"
2
4
  require "drip/collections"
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Drip
2
- VERSION = "3.3.1".freeze
4
+ VERSION = "3.4.0"
3
5
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require File.dirname(__FILE__) + '/../../test_helper.rb'
2
4
 
3
5
  class Drip::Client::AccountsTest < Drip::TestCase
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require File.dirname(__FILE__) + '/../../test_helper.rb'
2
4
 
3
5
  class Drip::Client::BroadcastsTest < Drip::TestCase
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require File.dirname(__FILE__) + '/../../test_helper.rb'
2
4
 
3
5
  class Drip::Client::CampaignSubscriptionsTest < Drip::TestCase
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require File.dirname(__FILE__) + '/../../test_helper.rb'
2
4
 
3
5
  class Drip::Client::CampaignsTest < Drip::TestCase
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require File.dirname(__FILE__) + '/../../test_helper.rb'
2
4
  require "drip/client/configuration"
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require File.dirname(__FILE__) + '/../../test_helper.rb'
2
4
 
3
5
  class Drip::Client::ConversionsTest < Drip::TestCase
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require File.dirname(__FILE__) + '/../../test_helper.rb'
2
4
 
3
5
  class Drip::Client::CustomFieldsTest < Drip::TestCase
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require File.dirname(__FILE__) + '/../../test_helper.rb'
2
4
 
3
5
  class Drip::Client::EventsTest < Drip::TestCase
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require File.dirname(__FILE__) + '/../../test_helper.rb'
2
4
 
3
5
  class Drip::Client::FormsTest < Drip::TestCase
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require File.dirname(__FILE__) + '/../../test_helper.rb'
2
4
  require "drip/client/configuration"
3
5
  require "drip/client/http_client"
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require File.dirname(__FILE__) + '/../../test_helper.rb'
2
4
 
3
5
  class Drip::Client::OrdersTest < Drip::TestCase
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require File.dirname(__FILE__) + '/../../test_helper.rb'
2
4
 
3
5
  class Drip::Client::ShopperActivityTest < Drip::TestCase
@@ -41,6 +43,18 @@ class Drip::Client::ShopperActivityTest < Drip::TestCase
41
43
  @options.delete(:cart_id)
42
44
  assert_raises(ArgumentError) { @client.create_cart_activity_event(@options) }
43
45
  end
46
+
47
+ should "return error when missing person identifier" do
48
+ @options.delete(:email)
49
+ assert_raises(ArgumentError) { @client.create_cart_activity_event(@options) }
50
+
51
+ @options[:person_id] = "acd123"
52
+ @client.create_cart_activity_event(@options)
53
+
54
+ @options.delete(:person_id)
55
+ @options[:visitor_uuid] = "v1234"
56
+ @client.create_cart_activity_event(@options)
57
+ end
44
58
  end
45
59
 
46
60
  context "#create_order_activity_event" do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require File.dirname(__FILE__) + '/../../test_helper.rb'
2
4
 
3
5
  class Drip::Client::SubscribersTest < Drip::TestCase
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require File.dirname(__FILE__) + '/../../test_helper.rb'
2
4
 
3
5
  class Drip::Client::TagsTest < Drip::TestCase
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ require File.dirname(__FILE__) + '/../../test_helper.rb'
4
+
5
+ class Drip::Client::UsersTest < Drip::TestCase
6
+ def setup
7
+ @client = Drip::Client.new { |c| c.account_id = "12345" }
8
+ end
9
+
10
+ context "#user" do
11
+ setup do
12
+ @response_status = 200
13
+ @response_body = "{}"
14
+
15
+ stub_request(:get, "https://api.getdrip.com/v2/user").
16
+ to_return(status: @response_status, body: @response_body, headers: {})
17
+ end
18
+
19
+ should "send the right request" do
20
+ expected = Drip::Response.new(@response_status, JSON.parse(@response_body))
21
+ assert_equal expected, @client.user
22
+ end
23
+ end
24
+ end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require File.dirname(__FILE__) + '/../../test_helper.rb'
2
4
 
3
5
  class Drip::Client::WebhooksTest < Drip::TestCase
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require File.dirname(__FILE__) + '/../../test_helper.rb'
2
4
 
3
5
  class Drip::Client::WorkflowTriggersTest < Drip::TestCase
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require File.dirname(__FILE__) + '/../../test_helper.rb'
2
4
 
3
5
  class Drip::Client::WorkflowsTest < Drip::TestCase
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require File.dirname(__FILE__) + '/../test_helper.rb'
2
4
  require "base64"
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require File.dirname(__FILE__) + '/../test_helper.rb'
2
4
 
3
5
  class Drip::CollectionTest < Drip::TestCase
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require File.dirname(__FILE__) + '/../../test_helper.rb'
2
4
  require "drip/collections/accounts"
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require File.dirname(__FILE__) + '/../../test_helper.rb'
2
4
  require "drip/collections/broadcasts"
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require File.dirname(__FILE__) + '/../../test_helper.rb'
2
4
  require "drip/collections/campaign_subscriptions"
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require File.dirname(__FILE__) + '/../../test_helper.rb'
2
4
  require "drip/collections/campaigns"
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require File.dirname(__FILE__) + '/../../test_helper.rb'
2
4
  require "drip/collections/errors"
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require File.dirname(__FILE__) + '/../../test_helper.rb'
2
4
  require "drip/collections/orders"
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require File.dirname(__FILE__) + '/../../test_helper.rb'
2
4
  require "drip/collections/purchases"
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require File.dirname(__FILE__) + '/../../test_helper.rb'
2
4
  require "drip/collections/tags"
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require File.dirname(__FILE__) + '/../../test_helper.rb'
2
4
  require "drip/collections/webhooks"
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require File.dirname(__FILE__) + '/../../test_helper.rb'
2
4
  require "drip/collections/workflow_triggers"
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require File.dirname(__FILE__) + '/../../test_helper.rb'
2
4
  require "drip/collections/workflows"
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require File.dirname(__FILE__) + '/../test_helper.rb'
2
4
 
3
5
  class Drip::CollectionsTest < Drip::TestCase
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require File.dirname(__FILE__) + '/../test_helper.rb'
2
4
  require "drip/request"
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require File.dirname(__FILE__) + '/../test_helper.rb'
2
4
 
3
5
  class Drip::ResourceTest < Drip::TestCase
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require File.dirname(__FILE__) + '/../../test_helper.rb'
2
4
 
3
5
  class Drip::AccountTest < Drip::TestCase
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require File.dirname(__FILE__) + '/../../test_helper.rb'
2
4
 
3
5
  class Drip::OrderTest < Drip::TestCase
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require File.dirname(__FILE__) + '/../../test_helper.rb'
2
4
 
3
5
  class Drip::SubscriberTest < Drip::TestCase
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require File.dirname(__FILE__) + '/../../test_helper.rb'
2
4
  require "drip/resources/tag"
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require File.dirname(__FILE__) + '/../test_helper.rb'
2
4
 
3
5
  class Drip::ResourcesTest < Drip::TestCase
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require File.dirname(__FILE__) + '/../test_helper.rb'
2
4
 
3
5
  class Drip::ResponseTest < Drip::TestCase
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'simplecov'
2
4
  SimpleCov.start
3
5
 
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: 3.3.1
4
+ version: 3.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Drip
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-05-28 00:00:00.000000000 Z
11
+ date: 2020-04-22 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: A simple wrapper for the Drip API
14
14
  email:
@@ -43,6 +43,7 @@ files:
43
43
  - lib/drip/client/shopper_activity.rb
44
44
  - lib/drip/client/subscribers.rb
45
45
  - lib/drip/client/tags.rb
46
+ - lib/drip/client/users.rb
46
47
  - lib/drip/client/webhooks.rb
47
48
  - lib/drip/client/workflow_triggers.rb
48
49
  - lib/drip/client/workflows.rb
@@ -92,6 +93,7 @@ files:
92
93
  - test/drip/client/shopper_activity_test.rb
93
94
  - test/drip/client/subscribers_test.rb
94
95
  - test/drip/client/tags_test.rb
96
+ - test/drip/client/users_test.rb
95
97
  - test/drip/client/webhooks_test.rb
96
98
  - test/drip/client/workflow_triggers_test.rb
97
99
  - test/drip/client/workflows_test.rb
@@ -132,15 +134,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
132
134
  requirements:
133
135
  - - ">="
134
136
  - !ruby/object:Gem::Version
135
- version: '2.2'
137
+ version: '2.3'
136
138
  required_rubygems_version: !ruby/object:Gem::Requirement
137
139
  requirements:
138
140
  - - ">="
139
141
  - !ruby/object:Gem::Version
140
142
  version: '0'
141
143
  requirements: []
142
- rubyforge_project:
143
- rubygems_version: 2.5.2
144
+ rubygems_version: 3.1.2
144
145
  signing_key:
145
146
  specification_version: 4
146
147
  summary: A Ruby gem for interacting with the Drip API
@@ -159,6 +160,7 @@ test_files:
159
160
  - test/drip/client/shopper_activity_test.rb
160
161
  - test/drip/client/subscribers_test.rb
161
162
  - test/drip/client/tags_test.rb
163
+ - test/drip/client/users_test.rb
162
164
  - test/drip/client/webhooks_test.rb
163
165
  - test/drip/client/workflow_triggers_test.rb
164
166
  - test/drip/client/workflows_test.rb