shopify_toolkit 0.3.1 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 196eef035351804fd3640e1ff995bc853b6e5c026ae9c301762620225e2967ed
4
- data.tar.gz: 2cbeb8412d7659732136eb0f4d152f9b1df766561b8a203ac594aac7dcadf656
3
+ metadata.gz: fb10c26092bd25299c97b8391e318eecffa7d1d0e628876fa4b21de0af86e81e
4
+ data.tar.gz: 4c16e43a2456927224a08ebb78ef86ab6e8f9111491c35bcc74396678f42e596
5
5
  SHA512:
6
- metadata.gz: c5d3071a0cddfcccd0b9b534a2c0c0c3f3cc86b3b6e1fedb8bc8fa70dafa74444f65b723c9ca08a9c091a5c4e1d07677bf4f0a95eaae48bc971e482e4085489d
7
- data.tar.gz: 2001bf1e1ecae528a91131a5ea07502cb2fe9bb6f71534c504100560912ad0cabcff5b9eebc1ecfa01241aae6ff42ec433ac2769ba6e6ad9606af15161300dd2
6
+ metadata.gz: 2f11c232fed4521afd0f8fcd97e5db90e15fedb7fb594b1888f847b05b6918a6e50b6df90385c3aa2fcc95b62ae681d398b9f5ee5e63b210aab8ca23117d272f
7
+ data.tar.gz: a6253f913325c38dd807ac795027d226cae9b053b3849dea669aca928663b7441e127d334e86736d9ebdb244123c6cecd4d6e0b731aad96571ffb63da09d9874
@@ -2,6 +2,7 @@
2
2
 
3
3
  require "shopify_toolkit/migration/logging"
4
4
  require "shopify_toolkit/admin_client"
5
+ require "active_support/concern"
5
6
 
6
7
  module ShopifyToolkit::MetafieldStatements
7
8
  extend ActiveSupport::Concern
@@ -1,3 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "stringio"
4
+ require "shopify_api"
5
+ require "rails"
6
+
1
7
  module ShopifyToolkit::Schema
2
8
  extend self
3
9
  include ShopifyToolkit::MetafieldStatements
@@ -75,9 +81,8 @@ module ShopifyToolkit::Schema
75
81
 
76
82
  def generate_schema_content
77
83
  definitions = fetch_definitions
78
-
79
- content = [
80
- <<~RUBY
84
+ content = StringIO.new
85
+ content << <<~RUBY
81
86
  # This file is auto-generated from the current state of the Shopify metafields.
82
87
  # Instead of editing this file, please use the metafields migration feature of ShopifyToolkit
83
88
  # to incrementally modify your metafields, and then regenerate this schema definition.
@@ -87,7 +92,6 @@ module ShopifyToolkit::Schema
87
92
  # It's strongly recommended that you check this file into your version control system.
88
93
  ShopifyToolkit::Schema.define do
89
94
  RUBY
90
- ]
91
95
 
92
96
  definitions.each do |defn|
93
97
  owner_type = defn["ownerType"].downcase.pluralize.to_sym
@@ -119,11 +123,10 @@ module ShopifyToolkit::Schema
119
123
  kwargs[:capabilities] = capabilities if has_non_default_capabilities
120
124
  end
121
125
 
122
- content << " create_metafield #{args.map(&:inspect).join(", ")}, #{kwargs.map { |k, v| "#{k}: #{v.inspect}" }.join(", ")}"
126
+ content.puts " create_metafield #{args.map(&:inspect).join(", ")}, #{kwargs.map { |k, v| "#{k}: #{v.inspect}" }.join(", ")}"
123
127
  end
124
128
 
125
- content << "end"
126
- content << "\n"
127
- content.join("\n")
129
+ content.puts "end"
130
+ content.string
128
131
  end
129
132
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ShopifyToolkit
4
- VERSION = "0.3.1"
4
+ VERSION = "0.3.2"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shopify_toolkit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elia Schito