souls 0.33.7 β 0.33.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/exe/souls +3 -1
- data/lib/souls/api/generate/manager.rb +19 -7
- data/lib/souls/version.rb +1 -1
- data/lib/souls/versions/.souls_api_version +1 -1
- data/lib/souls/versions/.souls_worker_version +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: ac3801b7cc5089209a6d5d6b01289f4d35bd4868ca9e911b32a12dd138172aa0
|
4
|
+
data.tar.gz: 7c240fc7c4afce0db3189758196293199761dc8f44d1f621aa86951f12270c44
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 150e24efafed4e5673125dba72143a17605107e7ff916499580b48eb8fcbb3e42cc81bafb82594931d9880ae93f620a5c37326efda27bc4b037d228e78cc08e4
|
7
|
+
data.tar.gz: 112bac58b55863b8fc896bbdebea7fbd047a2627415163b8ab89de7323800b5fca2690dd71aecf48970b559c301702a17bab65e3a96aca04d03d22aabf8ca353
|
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,
|
22
|
+
Souls::Api::Generate.public_send(method_name, **args)
|
21
23
|
Whirly.status = "Done!"
|
22
24
|
end
|
23
25
|
when "update"
|
@@ -1,19 +1,31 @@
|
|
1
1
|
module Souls
|
2
2
|
module Api::Generate
|
3
|
-
def self.manager(class_name: "
|
3
|
+
def self.manager(class_name: "user", mutation: "user_login")
|
4
|
+
p(mutation)
|
4
5
|
singularized_class_name = class_name.underscore.singularize
|
5
6
|
file_dir = "./app/graphql/mutations/managers/#{singularized_class_name}_manager"
|
6
7
|
FileUtils.mkdir_p(file_dir) unless Dir.exist?(file_dir)
|
7
|
-
file_path = "#{file_dir}/#{
|
8
|
+
file_path = "#{file_dir}/#{mutation}.rb"
|
9
|
+
raise(StandardError, "Already Exist!") if File.exist?(file_path)
|
10
|
+
|
8
11
|
File.open(file_path, "w") do |f|
|
9
12
|
f.write(<<~TEXT)
|
10
|
-
|
11
|
-
module
|
12
|
-
class #{
|
13
|
-
description "
|
13
|
+
module Mutations
|
14
|
+
module Managers::#{singularized_class_name.camelize}Manager
|
15
|
+
class #{mutation.underscore.camelize} < BaseMutation
|
16
|
+
description "#{mutation} description"
|
17
|
+
## Edit `argument` and `field`
|
18
|
+
argument :argment, String, required: true
|
19
|
+
|
14
20
|
field :response, String, null: false
|
15
21
|
|
16
|
-
|
22
|
+
def resolve(**args)
|
23
|
+
# Define Here
|
24
|
+
rescue StandardError => e
|
25
|
+
GraphQL::ExecutionError.new(e.to_s)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
17
29
|
end
|
18
30
|
TEXT
|
19
31
|
end
|
data/lib/souls/version.rb
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.12.
|
1
|
+
0.12.8
|
@@ -1 +1 @@
|
|
1
|
-
0.12.
|
1
|
+
0.12.8
|