lucid_shopify 0.15.0 → 0.15.1

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
  SHA256:
3
- metadata.gz: 653ddf7f8c324f940bf9e2d704910377e34f015eee770b52ce8b0928781dcdd1
4
- data.tar.gz: e82a027e61ab3d5af7edcad6457bb5e69db804589bb9dce6dc5f65e09f78d199
3
+ metadata.gz: b1fa336bfc2abcc35129665ab1679ce26a214e8cc711a9f2f02cb8d12dc910ff
4
+ data.tar.gz: 59d6e27a766ef0b189e4475a658986ede24c8aaba514e5e0f8a4ac9aba859bf5
5
5
  SHA512:
6
- metadata.gz: 8d91712da6b6790a66736fe38c849e18516d6d2fa04b1ba0f7112a5dcae09f74dcf529a8e6ab2515a89b9beaf5d67cf8eae3e3283ef5840859a0ba7996c8da22
7
- data.tar.gz: 47cad3f01c5e7282402b0849abd01a1a5ca7b053990b64d2869b9e800493c73431334d8bc221ca1b8abb94493e5fbda1cee6afcdb05362b23bb4a332eaaa06bc
6
+ metadata.gz: c95ec5d9ba4317494ac5d761bea90ee846b096f75dad3e15399d974966ad663bb0a924262b08053fc382c3126c26de5ebbff34d7a95bd2436cde579d566c31c9
7
+ data.tar.gz: 0dbea237b8786e642e596999c8500f6a57efa8bf9fc92aa8ca044a5c097e38ecd7c637ee8e3a8958e978f783ff52fe4b5618d96a7b5f49779030b38eff79aec6
data/lib/lucid_shopify.rb CHANGED
@@ -11,6 +11,7 @@ module LucidShopify
11
11
  autoload :CreateAllWebhooks, 'lucid_shopify/create_all_webhooks'
12
12
  autoload :CreateCharge, 'lucid_shopify/create_charge'
13
13
  autoload :CreateWebhook, 'lucid_shopify/create_webhook'
14
+ autoload :Credentials, 'lucid_shopify/credentials'
14
15
  autoload :DeleteAllWebhooks, 'lucid_shopify/delete_all_webhooks'
15
16
  autoload :DeleteRequest, 'lucid_shopify/delete_request'
16
17
  autoload :DeleteWebhook, 'lucid_shopify/delete_webhook'
@@ -18,7 +19,6 @@ module LucidShopify
18
19
  autoload :GetRequest, 'lucid_shopify/get_request'
19
20
  autoload :PostRequest, 'lucid_shopify/post_request'
20
21
  autoload :PutRequest, 'lucid_shopify/put_request'
21
- autoload :Credentials, 'lucid_shopify/credentials'
22
22
  autoload :Request, 'lucid_shopify/request'
23
23
  autoload :Response, 'lucid_shopify/response'
24
24
  autoload :Result, 'lucid_shopify/result'
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'dry/container'
4
+ require 'http'
4
5
 
5
6
  require 'lucid_shopify'
6
7
 
@@ -16,6 +17,7 @@ module LucidShopify
16
17
  Container.register(:create_webhook) { CreateWebhook.new }
17
18
  Container.register(:delete_all_webhooks) { DeleteAllWebhooks.new }
18
19
  Container.register(:delete_webhook) { DeleteWebhook.new }
20
+ Container.register(:http) { ::HTTP::Client.new }
19
21
  Container.register(:send_request) { SendRequest.new }
20
22
  Container.register(:send_throttled_request) { SendThrottledRequest.new }
21
23
  Container.register(:verify_callback) { VerifyCallback.new }
@@ -1,7 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'http'
4
-
5
3
  require 'lucid_shopify'
6
4
 
7
5
  module LucidShopify
@@ -13,6 +11,13 @@ module LucidShopify
13
11
  param :original_exception
14
12
  end
15
13
 
14
+ #
15
+ # @param http [HTTP::Client]
16
+ #
17
+ def initialize(http: Container[:http])
18
+ @http = http
19
+ end
20
+
16
21
  #
17
22
  # @param request [Request]
18
23
  # @param attempts [Integer] additional request attempts on client error
@@ -44,7 +49,7 @@ module LucidShopify
44
49
  private def send(request)
45
50
  req = request
46
51
 
47
- HTTP.headers(req.http_headers).__send__(req.http_method, req.url, req.options)
52
+ @http.headers(req.http_headers).__send__(req.http_method, req.url, req.options)
48
53
  end
49
54
 
50
55
  #
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module LucidShopify
4
- VERSION = '0.15.0'
4
+ VERSION = '0.15.1'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lucid_shopify
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.15.0
4
+ version: 0.15.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kelsey Judson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-08-19 00:00:00.000000000 Z
11
+ date: 2018-10-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dotenv