lucid_shopify 0.12.0 → 0.12.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: ffb571433eeb8cf5658df59664fcdd0a6f6263abbc0e344dbb72aca4696b9194
4
- data.tar.gz: d6039441bdedc23549bd096089898e7904265f9b1613fea10bb9a97f23f76a36
3
+ metadata.gz: a2beb43231e15f6cc5f05d857bafedbaf49e5e96f7fc6c4c6e2fa4d73afdb5ab
4
+ data.tar.gz: b1fa7c8dc3c7b14e5e3093d7caec13e0116bb94183fe4a30b39704ac6fe9a4cf
5
5
  SHA512:
6
- metadata.gz: 2f670bb4a773274e4b48c5a01ae96528b0b18f0443387a6ed08dec67096efc387623949a701425ddf1cd8a5ea6479db2935e96b4567068895d6daef9a94e5053
7
- data.tar.gz: ee826b6b538b45f0674e75db7726785a097550b7cf2207db84b6c12d3decf5fb70b075db8685da8167e40aab602e240c0a83adb1a9fa72d1ef2f3b147e21dd1f
6
+ metadata.gz: 8ad6e9008d5da48f20733a97f70686c88939fe4f67b0d2e639791b603fd1969470eaf9419421f762ba768d944bf34d1648fbdb317ec6952cf30499d4fa31744f
7
+ data.tar.gz: 44531fb0c0eb3ee4f82195b285865771523237b2974d6b7abfb71e1db6350364febb84608ae1d100768b04c886573adb003abf23a8fdbda54551fb1e52d91015
data/README.md CHANGED
@@ -40,14 +40,18 @@ This is only useful during the OAuth2 process.
40
40
 
41
41
  Configure each webhook the app will create (if any):
42
42
 
43
- LucidShopify.webhooks.register('orders/create', fields: 'id,tags'}
43
+ webhooks = LucidShopify::Container['webhook_list']
44
+
45
+ webhooks.register('orders/create', fields: 'id,tags'}
44
46
 
45
47
 
46
48
  ### Register webhook handlers
47
49
 
48
50
  For each webhook, register one or more handlers:
49
51
 
50
- LucidShopify.handlers.register('orders/create', OrdersCreateWebhook.new)
52
+ handlers = LucidShopify::Container['webhook_handler_list']
53
+
54
+ handlers.register('orders/create', OrdersCreateWebhook.new)
51
55
 
52
56
  See the inline method documentation for more detail.
53
57
 
@@ -56,7 +60,7 @@ to create a worker around something like this:
56
60
 
57
61
  webhook = LucidShopify::Webhook.new(myshopify_domain, topic, data)
58
62
 
59
- LucidShopify.handlers.delegate(webhook)
63
+ handlers.delegate(webhook)
60
64
 
61
65
 
62
66
  ### Create and delete webhooks
@@ -20,4 +20,6 @@ module LucidShopify
20
20
  Container.register(:send_throttled_request) { SendThrottledRequest.new }
21
21
  Container.register(:verify_callback) { VerifyCallback.new }
22
22
  Container.register(:verify_webhook) { VerifyWebhook.new }
23
+ Container.register(:webhook_handler_list) { LucidShopify.handlers }
24
+ Container.register(:webhook_list) { LucidShopify.webhooks }
23
25
  end
@@ -16,9 +16,10 @@ module LucidShopify
16
16
  # already exist remotely.
17
17
  #
18
18
  # @param request_credentials [RequestCredentials]
19
+ # @param webhooks [WebhookList]
19
20
  #
20
- def call(request_credentials)
21
- LucidShopify.webhooks.map do |webhook|
21
+ def call(request_credentials, webhooks: Container[:webhook_list])
22
+ webhooks.map do |webhook|
22
23
  Thread.new { @create_webhook.(request_credentials, webhook) }
23
24
  end.map(&:value)
24
25
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module LucidShopify
4
- VERSION = '0.12.0'
4
+ VERSION = '0.12.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.12.0
4
+ version: 0.12.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-07 00:00:00.000000000 Z
11
+ date: 2018-08-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dotenv