souls 0.71.0 → 0.71.4
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3da971c3f76a283d4a81f8a4319cc7f64c5cdd9d9c5c2bdc0e859deae66c9c73
|
4
|
+
data.tar.gz: 196039d967ba3094a7313efd78d48150d4d8151a873475262c019b6eadc0749c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 94f7f3a5768042f6ea3e66bf2dcf48ee24b9f1289fbe757bc8d4c81f18d01a6bf3f9c9f4a783617dc33d8e8593a994c397fe7b7b6c54dcd7d73c87c13718ea2e
|
7
|
+
data.tar.gz: 5e475d71483c8276b593e91c353bce495304672e9566887cf826b6a85e4f0f7f8aae17a5ac4256cebfc7b423987da2238c1a0584abdcdbb7f05433edf6e5adb7
|
@@ -10,17 +10,19 @@ require_relative "./rspec_resolver"
|
|
10
10
|
module Souls
|
11
11
|
class Update < Thor
|
12
12
|
desc "scaffold [CLASS_NAME]", "Update Scaffold Params"
|
13
|
-
def scaffold(
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
13
|
+
def scaffold(class_name)
|
14
|
+
create_mutation(class_name)
|
15
|
+
update_mutation(class_name)
|
16
|
+
resolver(class_name)
|
17
|
+
type(class_name)
|
18
|
+
rspec_factory(class_name)
|
19
|
+
rspec_mutation(class_name)
|
20
|
+
rspec_resolver(class_name)
|
21
|
+
Dir.chdir(Souls.get_mother_path.to_s) do
|
22
|
+
create_mutation_rbs(class_name)
|
23
|
+
update_mutation_rbs(class_name)
|
24
|
+
type_rbs(class_name)
|
25
|
+
end
|
24
26
|
end
|
25
27
|
end
|
26
28
|
end
|
@@ -3,7 +3,10 @@ module Souls
|
|
3
3
|
desc "create_mutation_rbs [CLASS_NAME]", "Update GraphQL Type from schema.rb"
|
4
4
|
def create_mutation_rbs(class_name)
|
5
5
|
singularized_class_name = class_name.singularize.underscore
|
6
|
-
new_cols =
|
6
|
+
new_cols = ""
|
7
|
+
Dir.chdir(Souls.get_api_path.to_s) do
|
8
|
+
new_cols = Souls.get_columns_num(class_name: singularized_class_name)
|
9
|
+
end
|
7
10
|
dir_name = "./sig/api/app/graphql/mutations/base/#{singularized_class_name}"
|
8
11
|
new_file_path = "tmp/create_mutation.rbs"
|
9
12
|
file_path = "#{dir_name}/create_#{singularized_class_name}.rbs"
|
@@ -23,8 +26,6 @@ module Souls
|
|
23
26
|
new_cols.each_with_index do |col, i|
|
24
27
|
type = Souls.type_check(col[:type])
|
25
28
|
type = "[#{type}]" if col[:array]
|
26
|
-
args = check_mutation_argument(class_name: class_name)
|
27
|
-
next if args.include?(col[:column_name])
|
28
29
|
next if col[:column_name] == "created_at" || col[:column_name] == "updated_at"
|
29
30
|
|
30
31
|
if i.zero?
|
@@ -38,8 +39,6 @@ module Souls
|
|
38
39
|
new_cols.each_with_index do |col, i|
|
39
40
|
type = Souls.type_check(col[:type])
|
40
41
|
type = "[#{type}]" if col[:array]
|
41
|
-
args = check_mutation_argument(class_name: class_name)
|
42
|
-
next if args.include?(col[:column_name])
|
43
42
|
next if col[:column_name] == "created_at" || col[:column_name] == "updated_at"
|
44
43
|
|
45
44
|
if i.zero?
|
@@ -89,8 +88,6 @@ module Souls
|
|
89
88
|
new_cols.each_with_index do |col, i|
|
90
89
|
type = Souls.type_check(col[:type])
|
91
90
|
type = "[#{type}]" if col[:array]
|
92
|
-
args = check_mutation_argument(class_name: class_name)
|
93
|
-
next if args.include?(col[:column_name])
|
94
91
|
next if col[:column_name] == "created_at" || col[:column_name] == "updated_at"
|
95
92
|
|
96
93
|
if i.zero?
|
@@ -105,8 +102,6 @@ module Souls
|
|
105
102
|
new_cols.each_with_index do |col, i|
|
106
103
|
type = Souls.type_check(col[:type])
|
107
104
|
type = "[#{type}]" if col[:array]
|
108
|
-
args = check_mutation_argument(class_name: class_name)
|
109
|
-
next if args.include?(col[:column_name])
|
110
105
|
next if col[:column_name] == "created_at" || col[:column_name] == "updated_at"
|
111
106
|
|
112
107
|
if i.zero?
|
@@ -132,20 +127,5 @@ module Souls
|
|
132
127
|
rescue Thor::Error => e
|
133
128
|
raise(Thor::Error, e)
|
134
129
|
end
|
135
|
-
|
136
|
-
private
|
137
|
-
|
138
|
-
def check_mutation_argument(class_name: "user", action: "create")
|
139
|
-
singularized_class_name = class_name.singularize.underscore
|
140
|
-
dir_name = "./sig/api/app/graphql/mutations/base/#{singularized_class_name}"
|
141
|
-
file_path = "#{dir_name}/#{action}_#{singularized_class_name}.rbs"
|
142
|
-
args = []
|
143
|
-
File.open(file_path) do |f|
|
144
|
-
f.each_line do |line|
|
145
|
-
args << line.split(",")[0].gsub("argument :", "").strip.underscore if line.include?("argument")
|
146
|
-
end
|
147
|
-
end
|
148
|
-
args
|
149
|
-
end
|
150
130
|
end
|
151
131
|
end
|
data/lib/souls/version.rb
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.50.
|
1
|
+
0.50.4
|
@@ -1 +1 @@
|
|
1
|
-
0.50.
|
1
|
+
0.50.4
|