souls 0.33.5 β†’ 0.33.9

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: 407612a8618e5d5ffd323ab3e172952740f63e30e55db1c8ee1ea33668504dbc
4
- data.tar.gz: 519a665685c9227cb5940e9c1f2bae741fb9abc972f50c06518b8aa6663615cf
3
+ metadata.gz: 608049300c7ced421ac47c23fb182d5cd52c3bf27c353475465e3d4f3a334e8a
4
+ data.tar.gz: ccb7cb87370aa801ba478b6207c283ac0907f6e01b657a537c606220a8ecd28c
5
5
  SHA512:
6
- metadata.gz: b079b3b24df0dfbd01fb169602d4ed20617f1e4b818791ac679b12d7d1b17019c54bd957df343307d1f83707a98b1db327042870dd8b8d14cb1e4adca7aa828b
7
- data.tar.gz: f3f87320d01f683e6408fa58ad65eaddcbeb3524e8fb5db5a71750f408ef7f4f07b4973b34331858add68fb88f06c8ce224fe1c15ee9c7bc80f3bc5da53ca57c
6
+ metadata.gz: e905793fed4e930ba3d473a9801a311d46e477d45e19d510d6d8093cbe8b7f9115a3183f5af342cba258f7a462b4d985a59b7687ef69d9ccee21375afacf903d
7
+ data.tar.gz: 29488a24eb4ad63850aed7d4cf1c0ac17f893697491d6479fba52a6970b4ae2dd396c41a6ae8d71517ff115a53a7f69f2430737b5e3f81e4a2a4de6bf0e6d119
data/exe/souls CHANGED
@@ -14,10 +14,12 @@ begin
14
14
  when "generate", "g"
15
15
  method_name = ARGV[2]
16
16
  class_name = ARGV[3]
17
+ args = { class_name: class_name }
18
+ args[:mutation] = ARGV[4] if ARGV.size > 4
17
19
  status = Paint["Running SOULs Generate Commands...", :yellow]
18
20
  Whirly.start(spinner: "clock", interval: 420, stop: "πŸŽ‰") do
19
21
  Whirly.status = status
20
- Souls::Api::Generate.public_send(method_name, class_name: class_name)
22
+ Souls::Api::Generate.public_send(method_name, **args)
21
23
  Whirly.status = "Done!"
22
24
  end
23
25
  when "update"
@@ -1,19 +1,30 @@
1
1
  module Souls
2
2
  module Api::Generate
3
- def self.manager(class_name: "souls")
3
+ def self.manager(class_name: "user", mutation: "user_login")
4
4
  singularized_class_name = class_name.underscore.singularize
5
5
  file_dir = "./app/graphql/mutations/managers/#{singularized_class_name}_manager"
6
6
  FileUtils.mkdir_p(file_dir) unless Dir.exist?(file_dir)
7
- file_path = "#{file_dir}/#{singularized_class_name}.rb"
7
+ file_path = "#{file_dir}/#{mutation}.rb"
8
+ raise(StandardError, "Already Exist!") if File.exist?(file_path)
9
+
8
10
  File.open(file_path, "w") do |f|
9
11
  f.write(<<~TEXT)
10
- class Types::#{singularized_class_name.camelize}Edge < module Mutations
11
- module Mailers
12
- class #{singularized_class_name.camelize}Mailer < BaseMutation
13
- description "Mail を送俑します。"
12
+ module Mutations
13
+ module Managers::#{singularized_class_name.camelize}Manager
14
+ class #{mutation.underscore.camelize} < BaseMutation
15
+ description "#{mutation} description"
16
+ ## Edit `argument` and `field`
17
+ argument :argment, String, required: true
18
+
14
19
  field :response, String, null: false
15
20
 
16
- node_type(Types::#{singularized_class_name.camelize}Type)
21
+ def resolve(**args)
22
+ # Define Here
23
+ rescue StandardError => e
24
+ GraphQL::ExecutionError.new(e.to_s)
25
+ end
26
+ end
27
+ end
17
28
  end
18
29
  TEXT
19
30
  end
@@ -5,6 +5,20 @@ module Souls
5
5
  def create_migration(class_name: "user")
6
6
  pluralized_class_name = class_name.underscore.pluralize
7
7
  system("rake db:create_migration NAME=create_#{pluralized_class_name}")
8
+ file_path = Dir["db/migrate/*create_#{pluralized_class_name}.rb"].first
9
+ File.open(file_path, "w") do |f|
10
+ f.write(<<~TEXT)
11
+ class Create#{pluralized_class_name.camelize} < ActiveRecord::Migration[6.1]
12
+ def change
13
+ create_table :#{pluralized_class_name} do |t|
14
+
15
+ t.boolean :is_deleted, null: false, default: false
16
+ t.timestamps
17
+ end
18
+ end
19
+ end
20
+ TEXT
21
+ end
8
22
  end
9
23
 
10
24
  def add_column(class_name: "user")
data/lib/souls/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module Souls
2
- VERSION = "0.33.5".freeze
2
+ VERSION = "0.33.9".freeze
3
3
  public_constant :VERSION
4
4
  end
@@ -1 +1 @@
1
- 0.12.5
1
+ 0.12.9
@@ -1 +1 @@
1
- 0.12.5
1
+ 0.12.9
@@ -18,7 +18,7 @@ module Souls
18
18
  def resolve
19
19
  # Define Job Here
20
20
 
21
- { response: "Job queued!" }
21
+ { response: "Job done!" }
22
22
  rescue StandardError => e
23
23
  GraphQL::ExecutionError.new(e.to_s)
24
24
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: souls
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.33.5
4
+ version: 0.33.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - POPPIN-FUMI
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: exe
12
12
  cert_chain: []
13
- date: 2021-08-28 00:00:00.000000000 Z
13
+ date: 2021-08-29 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activesupport