shopify_api 9.5.1 → 9.5.2

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: 933903ae7a032f32236d6ab88916650e03e4b0288f65208babba3141816454ac
4
- data.tar.gz: 7260bf183dfe4327d6d94880dd67745bcc0f413576c7c2e95aa143a0e7649721
3
+ metadata.gz: f24aa6fda25253f8eaa77769a3e911da6eee1b3640da54d2d5cd1b21e2456edc
4
+ data.tar.gz: 40077cf4eca48ec27872dfba720594872ffe50118424edc99b065e92e43720a3
5
5
  SHA512:
6
- metadata.gz: 5a54d8ee191a8fc3bfa8f11a0df12106ba3b1f46d78d17d4168988e6c56563532ebd1225e076d24e19d90925cc17bc59c1d8cf96be40fd009cacd0251965be9b
7
- data.tar.gz: 6463e8c51171d93d226adab9441530397bc334aaabf36fa00ab8a9b0e6128e46fa768957faa132971bf402fc9e3618d8b87f7f45d3f538f545391fbc3fd1da23
6
+ metadata.gz: 4e9e85ec74d6e9c09342f51057d738cf2cf0d77d745ec1313a70663248c989e77524138170661a73ed02d7b1b70c6b569d0a1a866922bab6035ef73b8b29510f
7
+ data.tar.gz: 25349d3d9802381d96cdbbff0b3180950f6685ebf8d863edfe642090da6bb15d1c3fcb9fe7eb4927a281c7f8d95b93f0095db78e8568d762a79f762fd08f8504
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## Unreleased
2
2
 
3
+ ## Version 9.5.2
4
+
5
+ - [#1356](https://github.com/Shopify/shopify-api-ruby/pull/1356) Autoload ActiveResource classes to improve load time for Rails apps.
6
+
3
7
  ## Version 9.5.1
4
8
 
5
9
  - [#891](https://github.com/Shopify/shopify_api/pull/891) Removed the upper bound on the `activeresource` dependency to allow apps to use the latest version
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- shopify_api (9.5.1)
4
+ shopify_api (9.5.2)
5
5
  activeresource (>= 4.1.0)
6
6
  graphql-client
7
7
  rack
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
- require 'active_resource/base'
2
+ require 'active_resource/validations'
3
3
 
4
4
  module ActiveResource
5
5
  class Errors < ActiveModel::Errors
@@ -1,4 +1,7 @@
1
1
  # frozen_string_literal: true
2
+
3
+ require "active_support/core_ext/hash"
4
+
2
5
  module ShopifyAPI
3
6
  class ApiVersion
4
7
  class UnknownVersion < StandardError; end
@@ -4,6 +4,8 @@ require 'rails/railtie'
4
4
  module ShopifyAPI
5
5
  module GraphQL
6
6
  class Railtie < Rails::Railtie
7
+ config.eager_load_namespaces << ShopifyAPI
8
+
7
9
  initializer 'shopify_api.initialize_graphql_clients' do |app|
8
10
  ShopifyAPI::GraphQL.schema_location = app.root.join('db', ShopifyAPI::GraphQL.schema_location)
9
11
  ShopifyAPI::GraphQL.initialize_clients
@@ -164,3 +164,10 @@ module ShopifyAPI
164
164
  end
165
165
  end
166
166
  end
167
+
168
+
169
+ if ShopifyAPI::Base.respond_to?(:connection_class)
170
+ ShopifyAPI::Base.connection_class = ShopifyAPI::Connection
171
+ else
172
+ require 'active_resource/connection_ext'
173
+ end
@@ -1,4 +1,98 @@
1
1
  # frozen_string_literal: true
2
- require 'shopify_api/resources/base'
3
- require 'shopify_api/resources/array_base'
4
- Dir.glob("#{File.dirname(__FILE__)}/resources/*").each { |file| require(file) }
2
+
3
+ module ShopifyAPI
4
+ eager_autoload do
5
+ autoload_under('resources') do
6
+ autoload(:Base)
7
+ autoload(:ArrayBase)
8
+ autoload(:AbandonedCheckout)
9
+ autoload(:AccessScope)
10
+ autoload(:AccessToken)
11
+ autoload(:Address)
12
+ autoload(:Announcement)
13
+ autoload(:ApiPermission)
14
+ autoload(:ApplicationCharge)
15
+ autoload(:ApplicationCredit)
16
+ autoload(:ArrayBase)
17
+ autoload(:Article)
18
+ autoload(:Asset)
19
+ autoload(:AssignedFulfillmentOrder)
20
+ autoload(:Base)
21
+ autoload(:BillingAddress)
22
+ autoload(:Blog)
23
+ autoload(:CarrierService)
24
+ autoload(:Cart)
25
+ autoload(:Checkout)
26
+ autoload(:Collect)
27
+ autoload(:Collection)
28
+ autoload(:CollectionListing)
29
+ autoload(:CollectionPublication)
30
+ autoload(:Comment)
31
+ autoload(:Country)
32
+ autoload(:Currency)
33
+ autoload(:CustomCollection)
34
+ autoload(:Customer)
35
+ autoload(:CustomerGroup)
36
+ autoload(:CustomerInvite)
37
+ autoload(:CustomerSavedSearch)
38
+ autoload(:DiscountCode)
39
+ autoload(:DiscountCodeBatch)
40
+ autoload(:DraftOrder)
41
+ autoload(:DraftOrderInvoice)
42
+ autoload(:Event)
43
+ autoload(:Fulfillment)
44
+ autoload(:FulfillmentEvent)
45
+ autoload(:FulfillmentOrder)
46
+ autoload(:FulfillmentOrderLocationsForMove)
47
+ autoload(:FulfillmentRequest)
48
+ autoload(:FulfillmentService)
49
+ autoload(:FulfillmentV2)
50
+ autoload(:GiftCard)
51
+ autoload(:Image)
52
+ autoload(:InventoryItem)
53
+ autoload(:InventoryLevel)
54
+ autoload(:LineItem)
55
+ autoload(:Location)
56
+ autoload(:MarketingEvent)
57
+ autoload(:Metafield)
58
+ autoload(:NoteAttribute)
59
+ autoload(:Option)
60
+ autoload(:Order)
61
+ autoload(:OrderRisk)
62
+ autoload(:Page)
63
+ autoload(:Payment)
64
+ autoload(:PaymentDetails)
65
+ autoload(:Policy)
66
+ autoload(:PriceRule)
67
+ autoload(:Product)
68
+ autoload(:ProductListing)
69
+ autoload(:ProductPublication)
70
+ autoload(:Province)
71
+ autoload(:Publication)
72
+ autoload(:Receipt)
73
+ autoload(:RecurringApplicationCharge)
74
+ autoload(:Redirect)
75
+ autoload(:Refund)
76
+ autoload(:Report)
77
+ autoload(:ResourceFeedback)
78
+ autoload(:Rule)
79
+ autoload(:ScriptTag)
80
+ autoload(:ShippingAddress)
81
+ autoload(:ShippingLine)
82
+ autoload(:ShippingRate)
83
+ autoload(:ShippingZone)
84
+ autoload(:Shop)
85
+ autoload(:SmartCollection)
86
+ autoload(:StorefrontAccessToken)
87
+ autoload(:TaxLine)
88
+ autoload(:TaxService)
89
+ autoload(:TenderTransaction)
90
+ autoload(:Theme)
91
+ autoload(:Transaction)
92
+ autoload(:UsageCharge)
93
+ autoload(:User)
94
+ autoload(:Variant)
95
+ autoload(:Webhook)
96
+ end
97
+ end
98
+ end
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module ShopifyAPI
3
- VERSION = "9.5.1"
3
+ VERSION = "9.5.2"
4
4
  end
data/lib/shopify_api.rb CHANGED
@@ -5,40 +5,40 @@ require 'active_support/core_ext/class/attribute_accessors'
5
5
  require 'digest/md5'
6
6
  require 'base64'
7
7
  require 'active_resource/detailed_log_subscriber'
8
- require 'shopify_api/limits'
9
- require 'shopify_api/api_version'
10
- require 'shopify_api/meta'
11
8
  require 'active_resource/json_errors'
12
- require 'shopify_api/paginated_collection'
13
- require 'shopify_api/disable_prefix_check'
14
9
 
15
10
  if Gem::Version.new(RUBY_VERSION) < Gem::Version.new("2.6")
16
11
  puts("\nshopify_api: NOTE: Support for Ruby #{RUBY_VERSION} will be dropped in the next major release. Please update to Ruby 2.6 or newer before updating this gem.\n\n")
17
12
  end
18
13
 
19
14
  module ShopifyAPI
15
+ extend ActiveSupport::Autoload
16
+
17
+ require 'shopify_api/limits'
18
+ require 'shopify_api/api_version'
19
+ require 'shopify_api/paginated_collection'
20
+ require 'shopify_api/disable_prefix_check'
21
+ require 'shopify_api/events'
22
+ require 'shopify_api/metafields'
23
+ require 'shopify_api/countable'
24
+ require 'shopify_api/resources'
25
+ require 'shopify_api/session'
26
+ require 'shopify_api/hmac_params'
27
+ require 'shopify_api/api_access'
28
+ require 'shopify_api/message_enricher'
29
+ require 'shopify_api/connection'
30
+ require 'shopify_api/pagination_link_headers'
31
+ require 'shopify_api/graphql'
32
+
33
+ eager_autoload do
34
+ autoload(:Meta)
35
+ end
36
+
20
37
  include Limits
21
38
  end
22
39
 
23
- require 'shopify_api/events'
24
- require 'shopify_api/metafields'
25
- require 'shopify_api/countable'
26
- require 'shopify_api/resources'
27
- require 'shopify_api/session'
28
- require 'shopify_api/hmac_params'
29
- require 'shopify_api/api_access'
30
- require 'shopify_api/message_enricher'
31
- require 'shopify_api/connection'
32
- require 'shopify_api/pagination_link_headers'
33
- require 'shopify_api/graphql'
34
40
  require 'shopify_api/graphql/railtie' if defined?(Rails)
35
41
 
36
- if ShopifyAPI::Base.respond_to?(:connection_class)
37
- ShopifyAPI::Base.connection_class = ShopifyAPI::Connection
38
- else
39
- require 'active_resource/connection_ext'
40
- end
41
-
42
42
  if ENV["SHOPIFY_LOG_PATH"]
43
43
  ActiveResource::Base.logger = Logger.new(ENV["SHOPIFY_LOG_PATH"])
44
44
  ActiveResource::DetailedLogSubscriber.attach_to(:active_resource_detailed)
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shopify_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 9.5.1
4
+ version: 9.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shopify
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2022-01-13 00:00:00.000000000 Z
10
+ date: 2025-01-06 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: activeresource
@@ -286,7 +285,6 @@ files:
286
285
  - lib/shopify_api/resources/page.rb
287
286
  - lib/shopify_api/resources/payment.rb
288
287
  - lib/shopify_api/resources/payment_details.rb
289
- - lib/shopify_api/resources/ping.rb
290
288
  - lib/shopify_api/resources/policy.rb
291
289
  - lib/shopify_api/resources/price_rule.rb
292
290
  - lib/shopify_api/resources/product.rb
@@ -529,7 +527,6 @@ licenses:
529
527
  - MIT
530
528
  metadata:
531
529
  allowed_push_host: https://rubygems.org
532
- post_install_message:
533
530
  rdoc_options:
534
531
  - "--charset=UTF-8"
535
532
  require_paths:
@@ -545,8 +542,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
545
542
  - !ruby/object:Gem::Version
546
543
  version: '0'
547
544
  requirements: []
548
- rubygems_version: 3.2.20
549
- signing_key:
545
+ rubygems_version: 3.6.2
550
546
  specification_version: 4
551
547
  summary: ShopifyAPI is a lightweight gem for accessing the Shopify admin REST web
552
548
  services
@@ -1,3 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- Dir.glob("#{File.dirname(__FILE__)}/ping/*").each { |file| require file }