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 +4 -4
- data/lib/shopify_toolkit/metafield_statements.rb +1 -0
- data/lib/shopify_toolkit/schema.rb +11 -8
- data/lib/shopify_toolkit/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fb10c26092bd25299c97b8391e318eecffa7d1d0e628876fa4b21de0af86e81e
|
4
|
+
data.tar.gz: 4c16e43a2456927224a08ebb78ef86ab6e8f9111491c35bcc74396678f42e596
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2f11c232fed4521afd0f8fcd97e5db90e15fedb7fb594b1888f847b05b6918a6e50b6df90385c3aa2fcc95b62ae681d398b9f5ee5e63b210aab8ca23117d272f
|
7
|
+
data.tar.gz: a6253f913325c38dd807ac795027d226cae9b053b3849dea669aca928663b7441e127d334e86736d9ebdb244123c6cecd4d6e0b731aad96571ffb63da09d9874
|
@@ -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
|
126
|
+
content.puts " create_metafield #{args.map(&:inspect).join(", ")}, #{kwargs.map { |k, v| "#{k}: #{v.inspect}" }.join(", ")}"
|
123
127
|
end
|
124
128
|
|
125
|
-
content
|
126
|
-
content
|
127
|
-
content.join("\n")
|
129
|
+
content.puts "end"
|
130
|
+
content.string
|
128
131
|
end
|
129
132
|
end
|