shopify_toolkit 0.5.0 → 0.5.1

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: fbc1361f6cf3ce45a4b6d004f55cc98b4c9f748c2863e281874cc48f085e7b9d
4
- data.tar.gz: 2e9a2fc920f7f7178f5f4ea3ccc945e6ac0c4fb1d50a426d77708888837a4941
3
+ metadata.gz: 101513a4e3028e85086e96c5fc36b992df1fd77804dcf6f55207a3f3d3761582
4
+ data.tar.gz: 10eff581de2567092a710ad7fd0533c51d74c6ead9c1003a0467941806624dda
5
5
  SHA512:
6
- metadata.gz: 44168636617828f3420d2fd0da7322c962f0b1a7a34e57cf9fe8642acc67d1dfe22dd5fabc934f0ba671e83eecf1623f47dd99f37c98821ef8689b81df91bc7f
7
- data.tar.gz: 3fa125127d19a08be48ef8a2165628816653527f272fb0cd352962ff1f5bdb55d5c2a2d8ea08bf3eabd174278e4d9d5777fcee2988d0ee6956b52ff464686c8e
6
+ metadata.gz: '08b4bd6ee54f7764ce9999dd01b438f0ac89c440c3c5dba2e4cf684de40350fc6e3a4f018942f2b9fee484fc4dfb89b1ca585548812de39c4cf04aa31e51cf57'
7
+ data.tar.gz: 0d52e249d1abecea1643a2109a984290216c7babe61bd036f241168246ee1a796380747e7f767c23b9593ff044862fcdf7fe0b0507778fdfcde714377712a9e6
data/README.md CHANGED
@@ -40,7 +40,7 @@ bundle add shopify_toolkit
40
40
  Within a Rails application created with ShopifyApp, generate a new migration file:
41
41
 
42
42
  ```bash
43
- touch config/shopify/migrate/$(date +%Y%m%d%H%M%S)_add_product_press_releases.rb
43
+ bundle exec shopify-toolkit generate migration AddProductPressReleases
44
44
  ```
45
45
 
46
46
  Then, add the following code to the migration file:
@@ -1,9 +1,12 @@
1
1
  require 'csv'
2
2
  require 'active_record'
3
3
  require 'thor'
4
+ require 'thor/actions'
4
5
  require 'tmpdir'
5
6
 
6
7
  class ShopifyToolkit::CommandLine < Thor
8
+ include Thor::Actions
9
+
7
10
  RESERVED_COLUMN_NAMES = %w[select type id]
8
11
 
9
12
  class Result < ActiveRecord::Base
@@ -83,6 +86,31 @@ class ShopifyToolkit::CommandLine < Thor
83
86
  ::Shop.sole.with_shopify_session { ShopifyToolkit::Schema.dump! }
84
87
  end
85
88
 
89
+ desc "generate_migration NAME", "Generate a migration with the given NAME"
90
+ def generate_migration(name)
91
+ require "./config/environment"
92
+ migrations_dir = Rails.root.join("config/shopify/migrate")
93
+ file_name = "#{Time.now.utc.strftime('%Y%m%d%H%M%S')}_#{name.underscore}.rb"
94
+
95
+ if migrations_dir.entries.map(&:to_s).grep(/\A\d+_#{Regexp.escape name.underscore}\.rb\z/).any?
96
+ raise Thor::Error, "Migration class already exists: #{file_name}"
97
+ end
98
+
99
+ create_file migrations_dir.join(file_name) do
100
+ <<~RUBY
101
+ class #{name.camelize} < ShopifyToolkit::Migration
102
+ def up
103
+ # Add your migration code here
104
+ end
105
+
106
+ def down
107
+ # Add your rollback code here
108
+ end
109
+ end
110
+ RUBY
111
+ end
112
+ end
113
+
86
114
  def self.exit_on_failure?
87
115
  true
88
116
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ShopifyToolkit
4
- VERSION = "0.5.0"
4
+ VERSION = "0.5.1"
5
5
  end
metadata CHANGED
@@ -1,15 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shopify_toolkit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elia Schito
8
8
  - Nebulab Team
9
- autorequire:
10
9
  bindir: exe
11
10
  cert_chain: []
12
- date: 2025-06-03 00:00:00.000000000 Z
11
+ date: 2025-06-04 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: railties
@@ -95,7 +94,6 @@ dependencies:
95
94
  - - ">="
96
95
  - !ruby/object:Gem::Version
97
96
  version: '14.8'
98
- description:
99
97
  email:
100
98
  - elia@schito.me
101
99
  executables:
@@ -129,7 +127,6 @@ metadata:
129
127
  homepage_uri: https://github.com/nebulab/shopify_toolkit?tab=readme-ov-file#readme
130
128
  source_code_uri: https://github.com/nebulab/shopify_toolkit
131
129
  changelog_uri: https://github.com/nebulab/shopify_toolkit/releases
132
- post_install_message:
133
130
  rdoc_options: []
134
131
  require_paths:
135
132
  - lib
@@ -144,8 +141,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
144
141
  - !ruby/object:Gem::Version
145
142
  version: '0'
146
143
  requirements: []
147
- rubygems_version: 3.5.3
148
- signing_key:
144
+ rubygems_version: 3.6.2
149
145
  specification_version: 4
150
146
  summary: A collection of tools for dealing with Shopify apps.
151
147
  test_files: []