shopify_app 7.0.2 → 7.0.4

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
  SHA1:
3
- metadata.gz: c0198555206848af2793096285ea0e4f2d5e2abd
4
- data.tar.gz: 9780f636ad16abdf01152955c80ed6601729b43a
3
+ metadata.gz: 24adcdf60d551e803f895d21e59cc2a8d1e3568c
4
+ data.tar.gz: b06241bf4f3ab38210efec82139536297009eb94
5
5
  SHA512:
6
- metadata.gz: 6477ba3a45b15895b4ef6dbb4385ae8cad74d7b2513906049ea5da4b9813dfe736693a541f792ae9c552ad3649eefc9e5f64451032ec99c20dafc61ae5bfbdb1
7
- data.tar.gz: b28fd5aa1a9384f0713a154f460bfa25465b524a8c45698e8756669ef4bbf94d69ea9d2af315b97e3885a1cddc45e05512cd266855794f5811676615f3203fd4
6
+ metadata.gz: 01fb498f9ec1a9d5c379dfb9c13b6739c31acf4ea5358e9dfcfbfc4632731f321d967838b59763c6202ca32aa82fe570a7e49e9edb4e8d4373c36f01306af317
7
+ data.tar.gz: b911f97a9d859fc2fa1b4bf58a97b870e66d74780a5b622795f930acb4e7c004a3c87468e4691ad386ca0534923bae9f74e7e5cd1b033dce0f86649f5aa48064
@@ -1,7 +1,7 @@
1
1
  language: ruby
2
2
 
3
3
  rvm:
4
- - 2.0.0
4
+ - 2.2.4
5
5
 
6
6
  gemfile:
7
7
  - Gemfile
data/CHANGELOG CHANGED
@@ -1,3 +1,13 @@
1
+ 7.0.4
2
+ -----
3
+
4
+ * Bump required shopify_api version to 4.x.
5
+
6
+ 7.0.3
7
+ -----
8
+
9
+ * Bump required Rails version to >= 4.2.6 since we are now using ActiveSupport::SecurityUtils:Module
10
+
1
11
  7.0.2
2
12
  -----
3
13
 
@@ -2,12 +2,8 @@ module ShopifyApp
2
2
  class ScripttagsManager
3
3
  class CreationFailed < StandardError; end
4
4
 
5
- def self.queue(shop_name, token)
6
- ShopifyApp::ScripttagsManagerJob.perform_later(shop_name: shop_name, token: token)
7
- end
8
-
9
- def initialize(shop_name, token)
10
- @shop_name, @token = shop_name, token
5
+ def self.queue(shop_domain, shop_token)
6
+ ShopifyApp::ScripttagsManagerJob.perform_later(shop_domain: shop_domain, shop_token: shop_token)
11
7
  end
12
8
 
13
9
  def recreate_scripttags!
@@ -18,19 +14,16 @@ module ShopifyApp
18
14
  def create_scripttags
19
15
  return unless required_scripttags.present?
20
16
 
21
- with_shopify_session do
22
- required_scripttags.each do |scripttag|
23
- create_scripttag(scripttag) unless scripttag_exists?(scripttag[:src])
24
- end
17
+ required_scripttags.each do |scripttag|
18
+ create_scripttag(scripttag) unless scripttag_exists?(scripttag[:src])
25
19
  end
26
20
  end
27
21
 
28
22
  def destroy_scripttags
29
- with_shopify_session do
30
- ShopifyAPI::ScriptTag.all.each do |scripttag|
31
- ShopifyAPI::ScriptTag.delete(scripttag.id) if is_required_scripttag?(scripttag)
32
- end
23
+ ShopifyAPI::ScriptTag.all.each do |scripttag|
24
+ ShopifyAPI::ScriptTag.delete(scripttag.id) if is_required_scripttag?(scripttag)
33
25
  end
26
+
34
27
  @current_scripttags = nil
35
28
  end
36
29
 
@@ -44,12 +37,6 @@ module ShopifyApp
44
37
  required_scripttags.map{ |w| w[:src] }.include? scripttag.src
45
38
  end
46
39
 
47
- def with_shopify_session
48
- ShopifyAPI::Session.temp(@shop_name, @token) do
49
- yield
50
- end
51
- end
52
-
53
40
  def create_scripttag(attributes)
54
41
  attributes.reverse_merge!(format: 'json')
55
42
  scripttag = ShopifyAPI::ScriptTag.create(attributes)
@@ -1,11 +1,10 @@
1
1
  module ShopifyApp
2
2
  class ScripttagsManagerJob < ActiveJob::Base
3
- def perform(params = {})
4
- shop_name = params.fetch(:shop_name)
5
- token = params.fetch(:token)
6
-
7
- manager = ScripttagsManager.new(shop_name, token)
8
- manager.create_scripttags
3
+ def perform(shop_domain:, shop_token:)
4
+ ShopifyAPI::Session.temp(shop_domain, shop_token) do
5
+ manager = ScripttagsManager.new
6
+ manager.create_scripttags
7
+ end
9
8
  end
10
9
  end
11
10
  end
@@ -1,3 +1,3 @@
1
1
  module ShopifyApp
2
- VERSION = '7.0.2'
2
+ VERSION = '7.0.4'
3
3
  end
@@ -2,12 +2,8 @@ module ShopifyApp
2
2
  class WebhooksManager
3
3
  class CreationFailed < StandardError; end
4
4
 
5
- def self.queue(shop_name, token)
6
- ShopifyApp::WebhooksManagerJob.perform_later(shop_name: shop_name, token: token)
7
- end
8
-
9
- def initialize(shop_name, token)
10
- @shop_name, @token = shop_name, token
5
+ def self.queue(shop_domain, shop_token)
6
+ ShopifyApp::WebhooksManagerJob.perform_later(shop_domain: shop_domain, shop_token: shop_token)
11
7
  end
12
8
 
13
9
  def recreate_webhooks!
@@ -18,19 +14,16 @@ module ShopifyApp
18
14
  def create_webhooks
19
15
  return unless required_webhooks.present?
20
16
 
21
- with_shopify_session do
22
- required_webhooks.each do |webhook|
23
- create_webhook(webhook) unless webhook_exists?(webhook[:topic])
24
- end
17
+ required_webhooks.each do |webhook|
18
+ create_webhook(webhook) unless webhook_exists?(webhook[:topic])
25
19
  end
26
20
  end
27
21
 
28
22
  def destroy_webhooks
29
- with_shopify_session do
30
- ShopifyAPI::Webhook.all.each do |webhook|
31
- ShopifyAPI::Webhook.delete(webhook.id) if is_required_webhook?(webhook)
32
- end
23
+ ShopifyAPI::Webhook.all.each do |webhook|
24
+ ShopifyAPI::Webhook.delete(webhook.id) if is_required_webhook?(webhook)
33
25
  end
26
+
34
27
  @current_webhooks = nil
35
28
  end
36
29
 
@@ -44,12 +37,6 @@ module ShopifyApp
44
37
  required_webhooks.map{ |w| w[:address] }.include? webhook.address
45
38
  end
46
39
 
47
- def with_shopify_session
48
- ShopifyAPI::Session.temp(@shop_name, @token) do
49
- yield
50
- end
51
- end
52
-
53
40
  def create_webhook(attributes)
54
41
  attributes.reverse_merge!(format: 'json')
55
42
  webhook = ShopifyAPI::Webhook.create(attributes)
@@ -1,11 +1,10 @@
1
1
  module ShopifyApp
2
2
  class WebhooksManagerJob < ActiveJob::Base
3
- def perform(params = {})
4
- shop_name = params.fetch(:shop_name)
5
- token = params.fetch(:token)
6
-
7
- manager = WebhooksManager.new(shop_name, token)
8
- manager.create_webhooks
3
+ def perform(shop_domain:, shop_token:)
4
+ ShopifyAPI::Session.temp(shop_domain, shop_token) do
5
+ manager = WebhooksManager.new
6
+ manager.create_webhooks
7
+ end
9
8
  end
10
9
  end
11
10
  end
@@ -8,9 +8,9 @@ Gem::Specification.new do |s|
8
8
  s.author = "Shopify"
9
9
  s.summary = %q{This gem is used to get quickly started with the Shopify API}
10
10
 
11
- s.add_dependency('rails', '>= 4.2', '< 5.0')
11
+ s.add_dependency('rails', '>= 4.2.6', '< 5.0')
12
12
 
13
- s.add_runtime_dependency('shopify_api', '~> 4.0.2')
13
+ s.add_runtime_dependency('shopify_api', '~> 4.2')
14
14
  s.add_runtime_dependency('omniauth-shopify-oauth2', '~> 1.1.11')
15
15
 
16
16
  s.add_development_dependency('rake')
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shopify_app
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.0.2
4
+ version: 7.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shopify
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-31 00:00:00.000000000 Z
11
+ date: 2016-05-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -16,7 +16,7 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '4.2'
19
+ version: 4.2.6
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
22
  version: '5.0'
@@ -26,7 +26,7 @@ dependencies:
26
26
  requirements:
27
27
  - - ">="
28
28
  - !ruby/object:Gem::Version
29
- version: '4.2'
29
+ version: 4.2.6
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
32
  version: '5.0'
@@ -36,14 +36,14 @@ dependencies:
36
36
  requirements:
37
37
  - - "~>"
38
38
  - !ruby/object:Gem::Version
39
- version: 4.0.2
39
+ version: '4.2'
40
40
  type: :runtime
41
41
  prerelease: false
42
42
  version_requirements: !ruby/object:Gem::Requirement
43
43
  requirements:
44
44
  - - "~>"
45
45
  - !ruby/object:Gem::Version
46
- version: 4.0.2
46
+ version: '4.2'
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: omniauth-shopify-oauth2
49
49
  requirement: !ruby/object:Gem::Requirement