souls 0.21.6 → 0.21.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +3 -3
- data/Gemfile.lock +9 -9
- data/README.md +1 -1
- data/lib/souls/generate/mutation.rb +14 -13
- data/lib/souls/generate/resolver.rb +1 -2
- data/lib/souls/generate/rspec_factory.rb +1 -0
- data/lib/souls/generate/rspec_mutation.rb +6 -6
- data/lib/souls/generate/rspec_query.rb +1 -2
- data/lib/souls/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 499a395ac34e3e202310dbe492af5735bf57244af647ca9aea839c29636ca1b8
|
4
|
+
data.tar.gz: 0122ccd831be8640e4ba0faa010a9bc3229dbe0dcefb9eedc42a5d5a33cb2ad9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0f31eda96afd418bb9dbb61cf020c3518f1183ce019aa28fa977755f1c0074f806b4ced0b0355727cf59b9cd9e1c287e734769aff632f17b722846e54570ddf2
|
7
|
+
data.tar.gz: 2b1d1774879089a7dd4584751508a2831bc914219dc68d680f92ae5d75371204875c239393d7dafad7eb9086e1341aaa2dc0b51319e0ae9c14de2b856eaefe27
|
data/Gemfile
CHANGED
@@ -3,9 +3,9 @@ source "https://rubygems.org"
|
|
3
3
|
# Specify your gem's dependencies in souls.gemspec
|
4
4
|
gemspec
|
5
5
|
|
6
|
-
gem "activesupport", "6.1.
|
6
|
+
gem "activesupport", "6.1.4"
|
7
7
|
gem "parser", "3.0.1.1"
|
8
|
-
gem "rake", "13.0.
|
8
|
+
gem "rake", "13.0.4"
|
9
9
|
gem "rspec", "3.10.0"
|
10
|
-
gem "rubocop", "1.
|
10
|
+
gem "rubocop", "1.18.3"
|
11
11
|
gem "steep", "0.44.1"
|
data/Gemfile.lock
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
souls (0.21.
|
4
|
+
souls (0.21.6)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
8
8
|
specs:
|
9
|
-
activesupport (6.1.
|
9
|
+
activesupport (6.1.4)
|
10
10
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
11
11
|
i18n (>= 1.6, < 2)
|
12
12
|
minitest (>= 5.1)
|
@@ -15,7 +15,7 @@ GEM
|
|
15
15
|
ast (2.4.2)
|
16
16
|
concurrent-ruby (1.1.9)
|
17
17
|
diff-lcs (1.4.4)
|
18
|
-
ffi (1.15.
|
18
|
+
ffi (1.15.3)
|
19
19
|
i18n (1.8.10)
|
20
20
|
concurrent-ruby (~> 1.0)
|
21
21
|
language_server-protocol (3.16.0.1)
|
@@ -27,7 +27,7 @@ GEM
|
|
27
27
|
parser (3.0.1.1)
|
28
28
|
ast (~> 2.4.1)
|
29
29
|
rainbow (3.0.0)
|
30
|
-
rake (13.0.
|
30
|
+
rake (13.0.4)
|
31
31
|
rb-fsevent (0.11.0)
|
32
32
|
rb-inotify (0.10.1)
|
33
33
|
ffi (~> 1.0)
|
@@ -47,7 +47,7 @@ GEM
|
|
47
47
|
diff-lcs (>= 1.2.0, < 2.0)
|
48
48
|
rspec-support (~> 3.10.0)
|
49
49
|
rspec-support (3.10.2)
|
50
|
-
rubocop (1.
|
50
|
+
rubocop (1.18.3)
|
51
51
|
parallel (~> 1.10)
|
52
52
|
parser (>= 3.0.0.0)
|
53
53
|
rainbow (>= 2.2.2, < 4.0)
|
@@ -79,13 +79,13 @@ PLATFORMS
|
|
79
79
|
x86_64-linux
|
80
80
|
|
81
81
|
DEPENDENCIES
|
82
|
-
activesupport (= 6.1.
|
82
|
+
activesupport (= 6.1.4)
|
83
83
|
parser (= 3.0.1.1)
|
84
|
-
rake (= 13.0.
|
84
|
+
rake (= 13.0.4)
|
85
85
|
rspec (= 3.10.0)
|
86
|
-
rubocop (= 1.
|
86
|
+
rubocop (= 1.18.3)
|
87
87
|
souls!
|
88
88
|
steep (= 0.44.1)
|
89
89
|
|
90
90
|
BUNDLED WITH
|
91
|
-
2.2.
|
91
|
+
2.2.21
|
data/README.md
CHANGED
@@ -5,9 +5,9 @@ module Souls
|
|
5
5
|
## 1.Mutation - Create
|
6
6
|
def create_mutation_head class_name: "user"
|
7
7
|
singularized_class_name = class_name.singularize.underscore
|
8
|
-
dir_name = "./app/graphql/mutations/#{singularized_class_name}"
|
8
|
+
dir_name = "./app/graphql/mutations/base/#{singularized_class_name}"
|
9
9
|
FileUtils.mkdir_p dir_name unless Dir.exist? dir_name
|
10
|
-
file_path = "./app/graphql/mutations/#{singularized_class_name}/create_#{singularized_class_name}.rb"
|
10
|
+
file_path = "./app/graphql/mutations/base/#{singularized_class_name}/create_#{singularized_class_name}.rb"
|
11
11
|
File.open(file_path, "w") do |new_line|
|
12
12
|
new_line.write <<~EOS
|
13
13
|
module Mutations
|
@@ -22,7 +22,7 @@ module Souls
|
|
22
22
|
end
|
23
23
|
|
24
24
|
def create_mutation_params class_name: "souls"
|
25
|
-
file_path = "./app/graphql/mutations/#{class_name}/create_#{class_name}.rb"
|
25
|
+
file_path = "./app/graphql/mutations/base/#{class_name}/create_#{class_name}.rb"
|
26
26
|
path = "./db/schema.rb"
|
27
27
|
@on = false
|
28
28
|
@user_exist = false
|
@@ -70,7 +70,7 @@ module Souls
|
|
70
70
|
|
71
71
|
def create_mutation_after_params class_name: "article", relation_params: []
|
72
72
|
return false if relation_params.empty?
|
73
|
-
file_path = "./app/graphql/mutations/#{class_name}/create_#{class_name}.rb"
|
73
|
+
file_path = "./app/graphql/mutations/base/#{class_name}/create_#{class_name}.rb"
|
74
74
|
relation_params.each do |params_name|
|
75
75
|
File.open(file_path, "a") do |new_line|
|
76
76
|
new_line.write " _, args[:#{params_name}] = SoulsApiSchema.from_global_id(args[:#{params_name}])\n"
|
@@ -80,7 +80,7 @@ module Souls
|
|
80
80
|
end
|
81
81
|
|
82
82
|
def create_mutation_end class_name: "souls"
|
83
|
-
file_path = "./app/graphql/mutations/#{class_name}/create_#{class_name}.rb"
|
83
|
+
file_path = "./app/graphql/mutations/base/#{class_name}/create_#{class_name}.rb"
|
84
84
|
File.open(file_path, "a") do |new_line|
|
85
85
|
new_line.write <<~EOS
|
86
86
|
#{class_name} = ::#{class_name.camelize}.new args
|
@@ -102,7 +102,7 @@ module Souls
|
|
102
102
|
|
103
103
|
## 2.Mutation - Update
|
104
104
|
def update_mutation_head class_name: "souls"
|
105
|
-
file_path = "./app/graphql/mutations/#{class_name}/update_#{class_name}.rb"
|
105
|
+
file_path = "./app/graphql/mutations/base/#{class_name}/update_#{class_name}.rb"
|
106
106
|
File.open(file_path, "w") do |new_line|
|
107
107
|
new_line.write <<~EOS
|
108
108
|
module Mutations
|
@@ -117,7 +117,7 @@ module Souls
|
|
117
117
|
end
|
118
118
|
|
119
119
|
def update_mutation_params class_name: "souls"
|
120
|
-
file_path = "./app/graphql/mutations/#{class_name}/update_#{class_name}.rb"
|
120
|
+
file_path = "./app/graphql/mutations/base/#{class_name}/update_#{class_name}.rb"
|
121
121
|
path = "./db/schema.rb"
|
122
122
|
@on = false
|
123
123
|
@user_exist = false
|
@@ -167,7 +167,7 @@ module Souls
|
|
167
167
|
|
168
168
|
def update_mutation_after_params class_name: "article", relation_params: []
|
169
169
|
return false if relation_params.empty?
|
170
|
-
file_path = "./app/graphql/mutations/#{class_name}/update_#{class_name}.rb"
|
170
|
+
file_path = "./app/graphql/mutations/base/#{class_name}/update_#{class_name}.rb"
|
171
171
|
relation_params.each do |params_name|
|
172
172
|
File.open(file_path, "a") do |new_line|
|
173
173
|
new_line.write " _, args[:#{params_name}] = SoulsApiSchema.from_global_id(args[:#{params_name}])\n"
|
@@ -177,7 +177,7 @@ module Souls
|
|
177
177
|
end
|
178
178
|
|
179
179
|
def update_mutation_end class_name: "souls"
|
180
|
-
file_path = "./app/graphql/mutations/#{class_name}/update_#{class_name}.rb"
|
180
|
+
file_path = "./app/graphql/mutations/base/#{class_name}/update_#{class_name}.rb"
|
181
181
|
File.open(file_path, "a") do |new_line|
|
182
182
|
new_line.write <<~EOS
|
183
183
|
#{class_name} = ::#{class_name.camelize}.find args[:id]
|
@@ -195,7 +195,7 @@ module Souls
|
|
195
195
|
end
|
196
196
|
|
197
197
|
def update_mutation class_name: "souls"
|
198
|
-
file_path = "./app/graphql/mutations/#{class_name}/update_#{class_name}.rb"
|
198
|
+
file_path = "./app/graphql/mutations/base/#{class_name}/update_#{class_name}.rb"
|
199
199
|
return "Mutation already exist! #{file_path}" if File.exist? file_path
|
200
200
|
update_mutation_head class_name: class_name
|
201
201
|
relation_params = update_mutation_params class_name: class_name
|
@@ -205,7 +205,7 @@ module Souls
|
|
205
205
|
|
206
206
|
# 3. Mutation - Delete
|
207
207
|
def delete_mutation class_name: "souls"
|
208
|
-
file_path = "./app/graphql/mutations/#{class_name}/delete_#{class_name}.rb"
|
208
|
+
file_path = "./app/graphql/mutations/base/#{class_name}/delete_#{class_name}.rb"
|
209
209
|
return "Mutation already exist! #{file_path}" if File.exist? file_path
|
210
210
|
File.open(file_path, "w") do |f|
|
211
211
|
f.write <<~EOS
|
@@ -233,7 +233,7 @@ module Souls
|
|
233
233
|
|
234
234
|
# 4. Mutation - Destroy Delete
|
235
235
|
def destroy_delete_mutation class_name: "souls"
|
236
|
-
file_path = "./app/graphql/mutations/#{class_name}/destroy_delete_#{class_name}.rb"
|
236
|
+
file_path = "./app/graphql/mutations/base/#{class_name}/destroy_delete_#{class_name}.rb"
|
237
237
|
return "Mutation already exist! #{file_path}" if File.exist? file_path
|
238
238
|
File.open(file_path, "w") do |f|
|
239
239
|
f.write <<~EOS
|
@@ -263,11 +263,12 @@ module Souls
|
|
263
263
|
|
264
264
|
def mutation class_name: "souls"
|
265
265
|
singularized_class_name = class_name.singularize
|
266
|
-
file_path = "./app/graphql/mutations/#{singularized_class_name}/create_#{singularized_class_name}.rb"
|
266
|
+
file_path = "./app/graphql/mutations/base/#{singularized_class_name}/create_#{singularized_class_name}.rb"
|
267
267
|
return "Mutation already exist! #{file_path}" if File.exist? file_path
|
268
268
|
create_mutation_head class_name: singularized_class_name
|
269
269
|
relation_params = create_mutation_params class_name: singularized_class_name
|
270
270
|
create_mutation_after_params class_name: singularized_class_name, relation_params: relation_params
|
271
|
+
# puts "File Created!\n#{file_path}"
|
271
272
|
[
|
272
273
|
create_mutation_end(class_name: singularized_class_name),
|
273
274
|
update_mutation(class_name: singularized_class_name),
|
@@ -59,7 +59,6 @@ module Souls
|
|
59
59
|
file_path = "./app/graphql/resolvers/#{class_name.singularize}_search.rb"
|
60
60
|
File.open(file_path, "a") do |f|
|
61
61
|
f.write <<-EOS
|
62
|
-
argument :is_deleted, Boolean, required: false
|
63
62
|
argument :start_date, String, required: false
|
64
63
|
argument :end_date, String, required: false
|
65
64
|
end
|
@@ -124,7 +123,6 @@ module Souls
|
|
124
123
|
file_path = "./app/graphql/resolvers/#{class_name.singularize}_search.rb"
|
125
124
|
File.open(file_path, "a") do |f|
|
126
125
|
f.write <<~EOS
|
127
|
-
scope = scope.where(is_deleted: value[:is_deleted]) unless value[:is_deleted].nil?
|
128
126
|
scope = scope.where("created_at >= ?", value[:start_date]) if value[:start_date]
|
129
127
|
scope = scope.where("created_at <= ?", value[:end_date]) if value[:end_date]
|
130
128
|
branches << scope
|
@@ -146,6 +144,7 @@ module Souls
|
|
146
144
|
resolver_params class_name: singularized_class_name
|
147
145
|
resolver_after_params class_name: singularized_class_name
|
148
146
|
resolver_before_end class_name: singularized_class_name
|
147
|
+
# puts "File Created!\n#{file_path}"
|
149
148
|
resolver_end class_name: singularized_class_name
|
150
149
|
end
|
151
150
|
end
|
@@ -4,6 +4,7 @@ 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
|
+
FileUtils.mkdir_p "./spec/factories/" unless Dir.exist? "./spec/factories/"
|
7
8
|
File.open(file_path, "w") do |f|
|
8
9
|
f.write <<~EOS
|
9
10
|
FactoryBot.define do
|
@@ -3,7 +3,7 @@ module Souls
|
|
3
3
|
class << self
|
4
4
|
## Generate Rspec Mutation
|
5
5
|
def rspec_mutation_head class_name: "souls"
|
6
|
-
file_path = "./spec/mutations/#{class_name.singularize}_spec.rb"
|
6
|
+
file_path = "./spec/mutations/base/#{class_name.singularize}_spec.rb"
|
7
7
|
File.open(file_path, "w") do |f|
|
8
8
|
f.write <<~EOS
|
9
9
|
RSpec.describe \"#{class_name.camelize} Mutation テスト\" do
|
@@ -13,7 +13,7 @@ module Souls
|
|
13
13
|
end
|
14
14
|
|
15
15
|
def rspec_mutation_after_head class_name: "souls"
|
16
|
-
file_path = "./spec/mutations/#{class_name.singularize}_spec.rb"
|
16
|
+
file_path = "./spec/mutations/base/#{class_name.singularize}_spec.rb"
|
17
17
|
path = "./db/schema.rb"
|
18
18
|
@on = false
|
19
19
|
@user_exist = false
|
@@ -62,7 +62,7 @@ module Souls
|
|
62
62
|
end
|
63
63
|
|
64
64
|
def rspec_mutation_params class_name: "souls"
|
65
|
-
file_path = "./spec/mutations/#{class_name.singularize}_spec.rb"
|
65
|
+
file_path = "./spec/mutations/base/#{class_name.singularize}_spec.rb"
|
66
66
|
path = "./db/schema.rb"
|
67
67
|
@on = false
|
68
68
|
@user_exist = false
|
@@ -106,7 +106,7 @@ module Souls
|
|
106
106
|
end
|
107
107
|
|
108
108
|
def rspec_mutation_params_response class_name: "souls"
|
109
|
-
file_path = "./spec/mutations/#{class_name.singularize}_spec.rb"
|
109
|
+
file_path = "./spec/mutations/base/#{class_name.singularize}_spec.rb"
|
110
110
|
path = "./db/schema.rb"
|
111
111
|
@on = false
|
112
112
|
File.open(file_path, "a") do |new_line|
|
@@ -188,7 +188,7 @@ module Souls
|
|
188
188
|
end
|
189
189
|
|
190
190
|
def rspec_mutation_end class_name: "souls"
|
191
|
-
file_path = "./spec/mutations/#{class_name.singularize}_spec.rb"
|
191
|
+
file_path = "./spec/mutations/base/#{class_name.singularize}_spec.rb"
|
192
192
|
path = "./db/schema.rb"
|
193
193
|
@on = false
|
194
194
|
File.open(file_path, "a") do |new_line|
|
@@ -236,7 +236,7 @@ module Souls
|
|
236
236
|
|
237
237
|
def rspec_mutation class_name: "souls"
|
238
238
|
singularized_class_name = class_name.singularize
|
239
|
-
file_path = "./spec/mutations/#{singularized_class_name}_spec.rb"
|
239
|
+
file_path = "./spec/mutations/base/#{singularized_class_name}_spec.rb"
|
240
240
|
return "RspecMutation already exist! #{file_path}" if File.exist? file_path
|
241
241
|
rspec_mutation_head class_name: singularized_class_name
|
242
242
|
rspec_mutation_after_head class_name: singularized_class_name
|
@@ -33,7 +33,6 @@ module Souls
|
|
33
33
|
#{class_name.singularize.camelize(:lower)}(id: \\"\#{data_id}\\") {
|
34
34
|
id
|
35
35
|
EOS
|
36
|
-
break
|
37
36
|
else
|
38
37
|
new_line.write <<-EOS
|
39
38
|
let(:#{class_name}) { FactoryBot.create(:#{class_name}, #{@relation_params.join(", ")}) }
|
@@ -44,8 +43,8 @@ module Souls
|
|
44
43
|
#{class_name.singularize.camelize(:lower)}(id: \\"\#{data_id}\\") {
|
45
44
|
id
|
46
45
|
EOS
|
47
|
-
break
|
48
46
|
end
|
47
|
+
break
|
49
48
|
end
|
50
49
|
_, name = line.split(",")[0].gsub("\"", "").scan(/((?<=t\.).+(?=\s)) (.+)/)[0]
|
51
50
|
case name
|
data/lib/souls/version.rb
CHANGED
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.21.
|
4
|
+
version: 0.21.7
|
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-
|
13
|
+
date: 2021-07-07 00:00:00.000000000 Z
|
14
14
|
dependencies: []
|
15
15
|
description: SOULS is a GraphQL Based Web Application Framework for Microservices
|
16
16
|
on Multi Cloud Platform such as Google Cloud Platform, Amazon Web Services, and
|