souls 0.21.1 → 0.21.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/souls/generate/mutation.rb +6 -1
- data/lib/souls/generate/query.rb +1 -0
- data/lib/souls/generate/resolver.rb +2 -2
- data/lib/souls/generate/rspec_factory.rb +1 -1
- data/lib/souls/generate/rspec_mutation.rb +2 -1
- data/lib/souls/generate/rspec_query.rb +2 -1
- data/lib/souls/generate/type.rb +2 -0
- data/lib/souls/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: 9b5d1173eefe9342b59f6b403dbc575a08df5c422ec3e7818da37438b87694b5
|
4
|
+
data.tar.gz: dda825a1c7e89125354a42d8930a54ac9ed59ab5f9138694ba0ac4290248eda9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d86172233a071be4ad87fbe6cf8db1845c4a2f5b82f08f2e2f963b2a3290b79f4242e4316fd09d48646d4fac4907d7afbd5f5766ab884eb9f2910d9877a50f40
|
7
|
+
data.tar.gz: 60549c9c85efa3572492fb9a7afbbb14c2cd4d7ffc78f8f55bd4c546fd7d637d4d7c401733e673c9df12bdb3ac34272331e577aa4e55ac7261f2706d2e5851e6
|
data/Gemfile.lock
CHANGED
@@ -194,6 +194,8 @@ module Souls
|
|
194
194
|
end
|
195
195
|
|
196
196
|
def update_mutation class_name: "souls"
|
197
|
+
file_path = "./app/graphql/mutations/#{class_name}/update_#{class_name}.rb"
|
198
|
+
return "Mutation already exist! #{file_path}" if File.exist? file_path
|
197
199
|
update_mutation_head class_name: class_name
|
198
200
|
relation_params = update_mutation_params class_name: class_name
|
199
201
|
update_mutation_after_params class_name: class_name, relation_params: relation_params
|
@@ -203,6 +205,7 @@ module Souls
|
|
203
205
|
# 3. Mutation - Delete
|
204
206
|
def delete_mutation class_name: "souls"
|
205
207
|
file_path = "./app/graphql/mutations/#{class_name}/delete_#{class_name}.rb"
|
208
|
+
return "Mutation already exist! #{file_path}" if File.exist? file_path
|
206
209
|
File.open(file_path, "w") do |f|
|
207
210
|
f.write <<~EOS
|
208
211
|
module Mutations
|
@@ -230,6 +233,7 @@ module Souls
|
|
230
233
|
# 4. Mutation - Destroy Delete
|
231
234
|
def destroy_delete_mutation class_name: "souls"
|
232
235
|
file_path = "./app/graphql/mutations/#{class_name}/destroy_delete_#{class_name}.rb"
|
236
|
+
return "Mutation already exist! #{file_path}" if File.exist? file_path
|
233
237
|
File.open(file_path, "w") do |f|
|
234
238
|
f.write <<~EOS
|
235
239
|
module Mutations
|
@@ -258,7 +262,8 @@ module Souls
|
|
258
262
|
|
259
263
|
def mutation class_name: "souls"
|
260
264
|
singularized_class_name = class_name.singularize
|
261
|
-
|
265
|
+
file_path = "./app/graphql/mutations/#{singularized_class_name}/create_#{singularized_class_name}.rb"
|
266
|
+
return "Mutation already exist! #{file_path}" if File.exist? file_path
|
262
267
|
create_mutation_head class_name: singularized_class_name
|
263
268
|
relation_params = create_mutation_params class_name: singularized_class_name
|
264
269
|
create_mutation_after_params class_name: singularized_class_name, relation_params: relation_params
|
data/lib/souls/generate/query.rb
CHANGED
@@ -5,9 +5,7 @@ module Souls
|
|
5
5
|
def resolver_head class_name: "souls"
|
6
6
|
FileUtils.mkdir_p "./app/graphql/resolvers" unless Dir.exist? "./app/graphql/resolvers"
|
7
7
|
file_path = "./app/graphql/resolvers/#{class_name.singularize}_search.rb"
|
8
|
-
return "Resolver already exist! #{file_path}" if File.exist? file_path
|
9
8
|
@relation_params = []
|
10
|
-
return ["Resolver already exist! #{file_path}"] if File.exist? file_path
|
11
9
|
File.open(file_path, "w") do |f|
|
12
10
|
f.write <<~EOS
|
13
11
|
module Resolvers
|
@@ -143,6 +141,8 @@ module Souls
|
|
143
141
|
|
144
142
|
def resolver class_name: "souls"
|
145
143
|
singularized_class_name = class_name.singularize.underscore
|
144
|
+
file_path = "./app/graphql/resolvers/#{singularized_class_name}_search.rb"
|
145
|
+
return "Resolver already exist! #{file_path}" if File.exist? file_path
|
146
146
|
resolver_head class_name: singularized_class_name
|
147
147
|
resolver_params class_name: singularized_class_name
|
148
148
|
resolver_after_params class_name: singularized_class_name
|
@@ -4,7 +4,6 @@ module Souls
|
|
4
4
|
## Generate Rspec Factory
|
5
5
|
def rspec_factory_head class_name: "souls"
|
6
6
|
file_path = "./spec/factories/#{class_name.pluralize}.rb"
|
7
|
-
return "RspecFactory already exist! #{file_path}" if File.exist? file_path
|
8
7
|
File.open(file_path, "w") do |f|
|
9
8
|
f.write <<~EOS
|
10
9
|
FactoryBot.define do
|
@@ -53,6 +52,7 @@ module Souls
|
|
53
52
|
|
54
53
|
def rspec_factory class_name: "souls"
|
55
54
|
file_path = "./spec/factories/#{class_name.pluralize}.rb"
|
55
|
+
return "RspecFactory already exist! #{file_path}" if File.exist? file_path
|
56
56
|
singularized_class_name = class_name.singularize
|
57
57
|
rspec_factory_head class_name: singularized_class_name
|
58
58
|
rspec_factory_params class_name: singularized_class_name
|
@@ -4,7 +4,6 @@ module Souls
|
|
4
4
|
## Generate Rspec Mutation
|
5
5
|
def rspec_mutation_head class_name: "souls"
|
6
6
|
file_path = "./spec/mutations/#{class_name.singularize}_spec.rb"
|
7
|
-
return "RspecMutation already exist! #{file_path}" if File.exist? file_path
|
8
7
|
File.open(file_path, "w") do |f|
|
9
8
|
f.write <<~EOS
|
10
9
|
RSpec.describe \"#{class_name.camelize} Mutation テスト\" do
|
@@ -237,6 +236,8 @@ module Souls
|
|
237
236
|
|
238
237
|
def rspec_mutation class_name: "souls"
|
239
238
|
singularized_class_name = class_name.singularize
|
239
|
+
file_path = "./spec/mutations/#{singularized_class_name}_spec.rb"
|
240
|
+
return "RspecMutation already exist! #{file_path}" if File.exist? file_path
|
240
241
|
rspec_mutation_head class_name: singularized_class_name
|
241
242
|
rspec_mutation_after_head class_name: singularized_class_name
|
242
243
|
rspec_mutation_params class_name: singularized_class_name
|
@@ -4,7 +4,6 @@ module Souls
|
|
4
4
|
## Generate Rspec Query
|
5
5
|
def rspec_query_head class_name: "souls"
|
6
6
|
file_path = "./spec/queries/#{class_name.singularize}_spec.rb"
|
7
|
-
return "RspecQuery already exist! #{file_path}" if File.exist? file_path
|
8
7
|
File.open(file_path, "w") do |f|
|
9
8
|
f.write <<~EOS
|
10
9
|
RSpec.describe \"#{class_name.camelize} Query テスト\" do
|
@@ -160,6 +159,8 @@ module Souls
|
|
160
159
|
|
161
160
|
def rspec_query class_name: "souls"
|
162
161
|
singularized_class_name = class_name.singularize
|
162
|
+
file_path = "./spec/queries/#{singularized_class_name}_spec.rb"
|
163
|
+
return "RspecQuery already exist! #{file_path}" if File.exist? file_path
|
163
164
|
rspec_query_head class_name: singularized_class_name
|
164
165
|
rspec_query_after_head class_name: singularized_class_name
|
165
166
|
rspec_query_params class_name: singularized_class_name
|
data/lib/souls/generate/type.rb
CHANGED
@@ -71,6 +71,8 @@ module Souls
|
|
71
71
|
|
72
72
|
def type class_name: "souls"
|
73
73
|
singularized_class_name = class_name.singularize
|
74
|
+
file_path = "./app/graphql/types/#{singularized_class_name}_node_type.rb"
|
75
|
+
return "Type already exist! #{file_path}" if File.exist? file_path
|
74
76
|
create_type_head class_name: singularized_class_name
|
75
77
|
create_type_params class_name: singularized_class_name
|
76
78
|
[
|
data/lib/souls/version.rb
CHANGED