souls 0.21.1 → 0.21.6
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 +4 -4
- data/Gemfile +1 -1
- data/Gemfile.lock +7 -8
- data/README.md +1 -1
- data/exe/souls +3 -3
- data/lib/souls/generate/application.rb +17 -0
- data/lib/souls/generate/mutation.rb +7 -1
- data/lib/souls/generate/query.rb +1 -0
- data/lib/souls/generate/resolver.rb +12 -13
- data/lib/souls/generate/rspec_factory.rb +1 -1
- data/lib/souls/generate/rspec_mutation.rb +2 -1
- data/lib/souls/generate/rspec_policy.rb +1 -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 +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 78d9e2a7d00d0a8d4089ef534c67a1389d19274548f121d106cd3e3cc09aff0f
|
4
|
+
data.tar.gz: 0ae0546a47fdbedbc348fa333ca6563958e7902ac08b0f2b79170031321829b0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 03b04be4d7334667d60874fb49982d279c0dfe055e8322d66d4ed924ded0d00d63c81dda241aed706f12d5692e18c626a42100382a67c4662a6cc0e96a5d6c9a
|
7
|
+
data.tar.gz: 5d3d0d212fd42181e5e50ca309b1f156f3ebe9b7bd5f9da0eab0e39f387938040755b89173a2b3de3ca8d6c45749db7ce87fd6115003f7430b6c1405f055938a
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
souls (0.21.
|
4
|
+
souls (0.21.5)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
@@ -13,7 +13,7 @@ GEM
|
|
13
13
|
tzinfo (~> 2.0)
|
14
14
|
zeitwerk (~> 2.3)
|
15
15
|
ast (2.4.2)
|
16
|
-
concurrent-ruby (1.1.
|
16
|
+
concurrent-ruby (1.1.9)
|
17
17
|
diff-lcs (1.4.4)
|
18
18
|
ffi (1.15.1)
|
19
19
|
i18n (1.8.10)
|
@@ -47,16 +47,16 @@ 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.16.1)
|
51
51
|
parallel (~> 1.10)
|
52
52
|
parser (>= 3.0.0.0)
|
53
53
|
rainbow (>= 2.2.2, < 4.0)
|
54
54
|
regexp_parser (>= 1.8, < 3.0)
|
55
55
|
rexml
|
56
|
-
rubocop-ast (>= 1.
|
56
|
+
rubocop-ast (>= 1.7.0, < 2.0)
|
57
57
|
ruby-progressbar (~> 1.7)
|
58
58
|
unicode-display_width (>= 1.4.0, < 3.0)
|
59
|
-
rubocop-ast (1.
|
59
|
+
rubocop-ast (1.7.0)
|
60
60
|
parser (>= 3.0.1.1)
|
61
61
|
ruby-progressbar (1.11.0)
|
62
62
|
steep (0.44.1)
|
@@ -76,7 +76,6 @@ GEM
|
|
76
76
|
zeitwerk (2.4.2)
|
77
77
|
|
78
78
|
PLATFORMS
|
79
|
-
x86_64-darwin-20
|
80
79
|
x86_64-linux
|
81
80
|
|
82
81
|
DEPENDENCIES
|
@@ -84,9 +83,9 @@ DEPENDENCIES
|
|
84
83
|
parser (= 3.0.1.1)
|
85
84
|
rake (= 13.0.3)
|
86
85
|
rspec (= 3.10.0)
|
87
|
-
rubocop (= 1.
|
86
|
+
rubocop (= 1.16.1)
|
88
87
|
souls!
|
89
88
|
steep (= 0.44.1)
|
90
89
|
|
91
90
|
BUNDLED WITH
|
92
|
-
2.2.
|
91
|
+
2.2.19
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
[![SOULs](https://
|
1
|
+
[![SOULs](https://storage.googleapis.com/souls/souls-ogp-vertical.jpg)](https://rubygems.org/gems/souls)
|
2
2
|
|
3
3
|
<p align="center">
|
4
4
|
<a aria-label="Ruby logo" href="https://el-soul.com">
|
data/exe/souls
CHANGED
@@ -99,7 +99,7 @@ begin
|
|
99
99
|
when "migration"
|
100
100
|
system "rake db:create_migration NAME=create_#{ARGV[2]}"
|
101
101
|
when "update"
|
102
|
-
Souls::Generate.
|
102
|
+
Souls::Generate.update_delete class_name: ARGV[2]
|
103
103
|
Souls::Generate.single_migrate class_name: ARGV[2]
|
104
104
|
else
|
105
105
|
"SOULs!"
|
@@ -138,8 +138,8 @@ begin
|
|
138
138
|
system "rubocop -a"
|
139
139
|
system "bundle exec rspec"
|
140
140
|
when "run"
|
141
|
-
system "docker build . -t souls
|
142
|
-
system "docker run --rm -p 3000:3000 souls:latest"
|
141
|
+
system "docker build . -t souls -f Dockerfile.dev"
|
142
|
+
system "docker run --rm --env-file .env -p 3000:3000 souls:latest"
|
143
143
|
when "deploy"
|
144
144
|
system "gcloud builds submit --config=cloudbuild.yml --project #{ARGV[1]}"
|
145
145
|
else
|
@@ -134,6 +134,23 @@ module Souls
|
|
134
134
|
puts error
|
135
135
|
end
|
136
136
|
|
137
|
+
def update_delete class_name: "souls"
|
138
|
+
singularized_class_name = class_name.singularize.underscore
|
139
|
+
pluralized_class_name = class_name.pluralize.underscore
|
140
|
+
FileUtils.rm_rf "./app/graphql/mutations/#{singularized_class_name}"
|
141
|
+
FileUtils.rm "./app/graphql/queries/#{singularized_class_name}.rb"
|
142
|
+
FileUtils.rm "./app/graphql/queries/#{pluralized_class_name}.rb"
|
143
|
+
FileUtils.rm "./app/graphql/resolvers/#{singularized_class_name}_search.rb"
|
144
|
+
FileUtils.rm "./app/graphql/types/#{singularized_class_name}_type.rb"
|
145
|
+
FileUtils.rm "./app/graphql/types/#{singularized_class_name}_node_type.rb"
|
146
|
+
FileUtils.rm "./spec/mutations/#{singularized_class_name}_spec.rb"
|
147
|
+
FileUtils.rm "./spec/queries/#{singularized_class_name}_spec.rb"
|
148
|
+
FileUtils.rm "./spec/resolvers/#{singularized_class_name}_search_spec.rb"
|
149
|
+
puts "deleted #{class_name.camelize} CRUD!"
|
150
|
+
rescue StandardError => error
|
151
|
+
puts error
|
152
|
+
end
|
153
|
+
|
137
154
|
def single_migrate class_name: "user"
|
138
155
|
puts "◆◆◆ Let's Auto Generate CRUD API SET ◆◆◆\n"
|
139
156
|
migrate class_name: class_name
|
@@ -113,6 +113,7 @@ module Souls
|
|
113
113
|
argument :id, String, required: true
|
114
114
|
EOS
|
115
115
|
end
|
116
|
+
file_path
|
116
117
|
end
|
117
118
|
|
118
119
|
def update_mutation_params class_name: "souls"
|
@@ -194,6 +195,8 @@ module Souls
|
|
194
195
|
end
|
195
196
|
|
196
197
|
def update_mutation class_name: "souls"
|
198
|
+
file_path = "./app/graphql/mutations/#{class_name}/update_#{class_name}.rb"
|
199
|
+
return "Mutation already exist! #{file_path}" if File.exist? file_path
|
197
200
|
update_mutation_head class_name: class_name
|
198
201
|
relation_params = update_mutation_params class_name: class_name
|
199
202
|
update_mutation_after_params class_name: class_name, relation_params: relation_params
|
@@ -203,6 +206,7 @@ module Souls
|
|
203
206
|
# 3. Mutation - Delete
|
204
207
|
def delete_mutation class_name: "souls"
|
205
208
|
file_path = "./app/graphql/mutations/#{class_name}/delete_#{class_name}.rb"
|
209
|
+
return "Mutation already exist! #{file_path}" if File.exist? file_path
|
206
210
|
File.open(file_path, "w") do |f|
|
207
211
|
f.write <<~EOS
|
208
212
|
module Mutations
|
@@ -230,6 +234,7 @@ module Souls
|
|
230
234
|
# 4. Mutation - Destroy Delete
|
231
235
|
def destroy_delete_mutation class_name: "souls"
|
232
236
|
file_path = "./app/graphql/mutations/#{class_name}/destroy_delete_#{class_name}.rb"
|
237
|
+
return "Mutation already exist! #{file_path}" if File.exist? file_path
|
233
238
|
File.open(file_path, "w") do |f|
|
234
239
|
f.write <<~EOS
|
235
240
|
module Mutations
|
@@ -258,7 +263,8 @@ module Souls
|
|
258
263
|
|
259
264
|
def mutation class_name: "souls"
|
260
265
|
singularized_class_name = class_name.singularize
|
261
|
-
|
266
|
+
file_path = "./app/graphql/mutations/#{singularized_class_name}/create_#{singularized_class_name}.rb"
|
267
|
+
return "Mutation already exist! #{file_path}" if File.exist? file_path
|
262
268
|
create_mutation_head class_name: singularized_class_name
|
263
269
|
relation_params = create_mutation_params class_name: singularized_class_name
|
264
270
|
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
|
@@ -61,6 +59,7 @@ module Souls
|
|
61
59
|
file_path = "./app/graphql/resolvers/#{class_name.singularize}_search.rb"
|
62
60
|
File.open(file_path, "a") do |f|
|
63
61
|
f.write <<-EOS
|
62
|
+
argument :is_deleted, Boolean, required: false
|
64
63
|
argument :start_date, String, required: false
|
65
64
|
argument :end_date, String, required: false
|
66
65
|
end
|
@@ -125,17 +124,15 @@ module Souls
|
|
125
124
|
file_path = "./app/graphql/resolvers/#{class_name.singularize}_search.rb"
|
126
125
|
File.open(file_path, "a") do |f|
|
127
126
|
f.write <<~EOS
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
end
|
138
|
-
end
|
127
|
+
scope = scope.where(is_deleted: value[:is_deleted]) unless value[:is_deleted].nil?
|
128
|
+
scope = scope.where("created_at >= ?", value[:start_date]) if value[:start_date]
|
129
|
+
scope = scope.where("created_at <= ?", value[:end_date]) if value[:end_date]
|
130
|
+
branches << scope
|
131
|
+
value[:OR].inject(branches) { |s, v| normalize_filters(v, s) } if value[:OR].present?
|
132
|
+
branches
|
133
|
+
end
|
134
|
+
end
|
135
|
+
end
|
139
136
|
EOS
|
140
137
|
end
|
141
138
|
file_path
|
@@ -143,6 +140,8 @@ module Souls
|
|
143
140
|
|
144
141
|
def resolver class_name: "souls"
|
145
142
|
singularized_class_name = class_name.singularize.underscore
|
143
|
+
file_path = "./app/graphql/resolvers/#{singularized_class_name}_search.rb"
|
144
|
+
return "Resolver already exist! #{file_path}" if File.exist? file_path
|
146
145
|
resolver_head class_name: singularized_class_name
|
147
146
|
resolver_params class_name: singularized_class_name
|
148
147
|
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
|
@@ -33,7 +33,7 @@ module Souls
|
|
33
33
|
context "being a staff" do
|
34
34
|
let(:user) { FactoryBot.create(:user, user_role: 3) }
|
35
35
|
|
36
|
-
it { is_expected.to permit_actions([:create, :update
|
36
|
+
it { is_expected.to permit_actions([:create, :update]) }
|
37
37
|
end
|
38
38
|
|
39
39
|
context "being an administrator" do
|
@@ -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
metadata
CHANGED
@@ -1,16 +1,16 @@
|
|
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.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- POPPIN-FUMI
|
8
8
|
- KishiTheMechanic
|
9
9
|
- James Neve
|
10
|
-
autorequire:
|
10
|
+
autorequire:
|
11
11
|
bindir: exe
|
12
12
|
cert_chain: []
|
13
|
-
date: 2021-
|
13
|
+
date: 2021-06-14 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
|
@@ -69,7 +69,7 @@ metadata:
|
|
69
69
|
homepage_uri: https://github.com/elsoul/souls
|
70
70
|
source_code_uri: https://github.com/elsoul/souls
|
71
71
|
changelog_uri: https://github.com/elsoul/souls
|
72
|
-
post_install_message:
|
72
|
+
post_install_message:
|
73
73
|
rdoc_options: []
|
74
74
|
require_paths:
|
75
75
|
- lib
|
@@ -85,7 +85,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
85
85
|
version: '0'
|
86
86
|
requirements: []
|
87
87
|
rubygems_version: 3.2.15
|
88
|
-
signing_key:
|
88
|
+
signing_key:
|
89
89
|
specification_version: 4
|
90
90
|
summary: SOULS is a GraphQL Based Web Application Framework for Microservices on Multi
|
91
91
|
Cloud Platform such as Google Cloud Platform, Amazon Web Services, and Alibaba Cloud.
|