souls 0.25.12 → 0.25.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/exe/souls +8 -50
- data/lib/souls/generate.rb +1 -0
- data/lib/souls/generate/application.rb +5 -25
- data/lib/souls/generate/connection.rb +2 -0
- data/lib/souls/generate/edge.rb +2 -0
- data/lib/souls/generate/methods.rb +62 -0
- data/lib/souls/generate/mutation.rb +2 -0
- data/lib/souls/generate/query.rb +2 -0
- data/lib/souls/generate/rspec_model.rb +2 -0
- data/lib/souls/generate/rspec_mutation.rb +2 -0
- data/lib/souls/generate/rspec_query.rb +2 -0
- data/lib/souls/generate/rspec_resolver.rb +3 -1
- data/lib/souls/generate/type.rb +2 -0
- 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 +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7142d4a473970f13230e3378201c217db36aee80976b8f82ad54b5f725fd6dab
|
4
|
+
data.tar.gz: af428562d11da66a658cd1f83607d704cd5a7acff91a14ff4ce6d44fbc319733
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 575ea8d5d6509a9ffde78fdce1ffb1c04bf604f2e56def0ab3bbc50344add169ccb01d0e93211148bfb7f91f6d2b75900215159d7dbd591f068dff01874bdd41
|
7
|
+
data.tar.gz: 8c0276edc2e6b6dbe26bcec59846c4c39a9899c82c51570f37a5fcef586e58b1da70a21e51d1d979c690a7005944a353093aec7dc7242e30064c7edaa60c131a
|
data/README.md
CHANGED
@@ -25,7 +25,7 @@ SOULs is a Serverless Application Framework with Ruby GraphQL.
|
|
25
25
|
SOULs has six strains, API, Worker, Console, Admin, Media, Doc, and can be used in combination according to the purpose. SOULs Backend GraphQL Ruby & Frontend Relay are Scalable and Easy to deploy to Google Cloud. No more routing for Backends!
|
26
26
|
You can focus on your business logic. No more infra problems.
|
27
27
|
|
28
|
-
![画像](https://storage.googleapis.com/souls-bucket/imgs/
|
28
|
+
![画像](https://storage.googleapis.com/souls-bucket/imgs/souls-structure.jpg)
|
29
29
|
|
30
30
|
SOULs creates 6 types of framework.
|
31
31
|
|
data/exe/souls
CHANGED
@@ -128,57 +128,15 @@ begin
|
|
128
128
|
puts(Paint["Wrong Argument!", :red])
|
129
129
|
end
|
130
130
|
when "g", "generate"
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
when "mutation"
|
139
|
-
Souls::Generate.mutation(class_name: class_name)
|
140
|
-
when "query"
|
141
|
-
Souls::Generate.query(class_name: class_name)
|
142
|
-
when "type"
|
143
|
-
Souls::Generate.type(class_name: class_name)
|
144
|
-
when "edge"
|
145
|
-
Souls::Generate.edge(class_name: class_name)
|
146
|
-
when "connection"
|
147
|
-
Souls::Generate.connection(class_name: class_name)
|
148
|
-
when "resolver"
|
149
|
-
Souls::Generate.resolver(class_name: class_name)
|
150
|
-
when "policy"
|
151
|
-
Souls::Generate.policy(class_name: class_name)
|
152
|
-
when "rspec_factory"
|
153
|
-
Souls::Generate.rspec_factory(class_name: class_name)
|
154
|
-
when "rspec_model"
|
155
|
-
Souls::Generate.rspec_model(class_name: class_name)
|
156
|
-
when "rspec_mutation"
|
157
|
-
Souls::Generate.rspec_mutation(class_name: class_name)
|
158
|
-
when "rspec_query"
|
159
|
-
Souls::Generate.rspec_query(class_name: class_name)
|
160
|
-
when "rspec_resolver"
|
161
|
-
Souls::Generate.rspec_resolver(class_name: class_name)
|
162
|
-
when "rspec_policy"
|
163
|
-
Souls::Generate.rspec_policy(class_name: class_name)
|
164
|
-
when "node_type"
|
165
|
-
Souls::Generate.node_type(class_name: class_name)
|
166
|
-
when "job"
|
167
|
-
Souls::Generate.job(class_name: class_name)
|
168
|
-
when "migrate"
|
169
|
-
Souls::Generate.single_migrate(class_name: class_name)
|
170
|
-
when "migrate_all"
|
171
|
-
Souls::Generate.migrate_all
|
172
|
-
when "migration"
|
173
|
-
pluralized_class_name = class_name.underscore.pluralize
|
174
|
-
system("rake db:create_migration NAME=create_#{pluralized_class_name}")
|
175
|
-
when "update"
|
176
|
-
Souls::Generate.update_delete(class_name: class_name)
|
177
|
-
Souls::Generate.single_migrate(class_name: class_name)
|
178
|
-
else
|
179
|
-
"SOULs!"
|
131
|
+
args = ARGV
|
132
|
+
status = Paint["Generating Files...", :yellow]
|
133
|
+
done = Paint["Generated SOULs CRUD Files☻", :yellow]
|
134
|
+
Whirly.start(spinner: "clock", interval: 420, stop: "🎉") do
|
135
|
+
Whirly.status = status
|
136
|
+
Souls::Generate.return_method(args)
|
137
|
+
Whirly.status = done
|
180
138
|
end
|
181
|
-
when "d"
|
139
|
+
when "d", "delete"
|
182
140
|
class_name = ARGV[1]
|
183
141
|
Souls::Generate.delete_all(class_name: class_name)
|
184
142
|
when "db:create"
|
data/lib/souls/generate.rb
CHANGED
@@ -121,7 +121,7 @@ module Souls
|
|
121
121
|
pluralized_class_name = class_name.pluralize.underscore
|
122
122
|
FileUtils.rm("./app/models/#{singularized_class_name}.rb")
|
123
123
|
FileUtils.rm("./app/policies/#{singularized_class_name}_policy.rb")
|
124
|
-
FileUtils.rm_rf("./app/graphql/mutations/#{singularized_class_name}")
|
124
|
+
FileUtils.rm_rf("./app/graphql/mutations/base/#{singularized_class_name}")
|
125
125
|
FileUtils.rm("./app/graphql/queries/#{singularized_class_name}.rb")
|
126
126
|
FileUtils.rm("./app/graphql/queries/#{pluralized_class_name}.rb")
|
127
127
|
FileUtils.rm("./app/graphql/resolvers/#{singularized_class_name}_search.rb")
|
@@ -129,14 +129,14 @@ module Souls
|
|
129
129
|
FileUtils.rm("./app/graphql/types/edges/#{singularized_class_name}_edge.rb")
|
130
130
|
FileUtils.rm("./app/graphql/types/connections/#{singularized_class_name}_connection.rb")
|
131
131
|
FileUtils.rm("./spec/factories/#{pluralized_class_name}.rb")
|
132
|
-
FileUtils.rm("./spec/mutations/#{singularized_class_name}_spec.rb")
|
132
|
+
FileUtils.rm("./spec/mutations/base/#{singularized_class_name}_spec.rb")
|
133
133
|
FileUtils.rm("./spec/models/#{singularized_class_name}_spec.rb")
|
134
134
|
FileUtils.rm("./spec/queries/#{singularized_class_name}_spec.rb")
|
135
135
|
FileUtils.rm("./spec/policies/#{singularized_class_name}_policy_spec.rb")
|
136
136
|
FileUtils.rm("./spec/resolvers/#{singularized_class_name}_search_spec.rb")
|
137
|
-
puts("deleted #{class_name.camelize} CRUD!")
|
137
|
+
puts(Paint["deleted #{class_name.camelize} CRUD!", :yellow])
|
138
138
|
rescue StandardError => e
|
139
|
-
|
139
|
+
raise(StandardError, e)
|
140
140
|
end
|
141
141
|
|
142
142
|
def self.update_delete(class_name: "souls")
|
@@ -154,27 +154,7 @@ module Souls
|
|
154
154
|
FileUtils.rm("./spec/resolvers/#{singularized_class_name}_search_spec.rb")
|
155
155
|
puts("deleted #{class_name.camelize} CRUD!")
|
156
156
|
rescue StandardError => e
|
157
|
-
|
158
|
-
end
|
159
|
-
|
160
|
-
def self.single_migrate(class_name: "user")
|
161
|
-
puts("◆◆◆ Let's Auto Generate CRUD API SET ◆◆◆\n")
|
162
|
-
migrate(class_name: class_name)
|
163
|
-
puts("Generated #{class_name.camelize} CRUD Files\n")
|
164
|
-
Souls::Generate.generated_paths(class_name: class_name).each { |f| puts(f) }
|
165
|
-
puts("\nAll files created from ./db/schema.rb")
|
166
|
-
puts("\n\n")
|
167
|
-
end
|
168
|
-
|
169
|
-
def self.migrate_all
|
170
|
-
puts("◆◆◆ SOULs CRUD Assist ◆◆◆\n")
|
171
|
-
get_tables.each do |class_name|
|
172
|
-
migrate(class_name: class_name.singularize)
|
173
|
-
puts("Generated #{class_name.camelize} CRUD Files\n")
|
174
|
-
Souls::Generate.generated_paths(class_name: class_name).each { |f| puts(f) }
|
175
|
-
puts("\n")
|
176
|
-
end
|
177
|
-
puts("\nAll files created from ./db/schema.rb\n\n You're all set ;)")
|
157
|
+
raise(StandardError, e)
|
178
158
|
end
|
179
159
|
end
|
180
160
|
end
|
@@ -1,6 +1,8 @@
|
|
1
1
|
module Souls
|
2
2
|
module Generate
|
3
3
|
def self.connection(class_name: "souls")
|
4
|
+
file_dir = "./app/graphql/types/connections/"
|
5
|
+
FileUtils.mkdir_p(file_dir) unless Dir.exist?(file_dir)
|
4
6
|
singularized_class_name = class_name.underscore.singularize
|
5
7
|
file_path = "./app/graphql/types/connections/#{singularized_class_name}_connection.rb"
|
6
8
|
File.open(file_path, "w") do |f|
|
data/lib/souls/generate/edge.rb
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
module Souls
|
2
2
|
module Generate
|
3
3
|
def self.edge(class_name: "souls")
|
4
|
+
file_dir = "./app/graphql/types/edges"
|
5
|
+
FileUtils.mkdir_p(file_dir) unless Dir.exist?(file_dir)
|
4
6
|
singularized_class_name = class_name.underscore.singularize
|
5
7
|
file_path = "./app/graphql/types/edges/#{singularized_class_name}_edge.rb"
|
6
8
|
File.open(file_path, "w") do |f|
|
@@ -0,0 +1,62 @@
|
|
1
|
+
module Souls
|
2
|
+
module Generate
|
3
|
+
class << self
|
4
|
+
def return_method(args)
|
5
|
+
graphql_class = args[1]
|
6
|
+
class_name = args[2]
|
7
|
+
case graphql_class
|
8
|
+
when "test_dir"
|
9
|
+
Souls::Generate.test_dir
|
10
|
+
when "model"
|
11
|
+
Souls::Generate.model(class_name: class_name)
|
12
|
+
when "mutation"
|
13
|
+
Souls::Generate.mutation(class_name: class_name)
|
14
|
+
when "query"
|
15
|
+
Souls::Generate.query(class_name: class_name)
|
16
|
+
when "type"
|
17
|
+
Souls::Generate.type(class_name: class_name)
|
18
|
+
when "edge"
|
19
|
+
Souls::Generate.edge(class_name: class_name)
|
20
|
+
when "connection"
|
21
|
+
Souls::Generate.connection(class_name: class_name)
|
22
|
+
when "resolver"
|
23
|
+
Souls::Generate.resolver(class_name: class_name)
|
24
|
+
when "policy"
|
25
|
+
Souls::Generate.policy(class_name: class_name)
|
26
|
+
when "rspec_factory"
|
27
|
+
Souls::Generate.rspec_factory(class_name: class_name)
|
28
|
+
when "rspec_model"
|
29
|
+
Souls::Generate.rspec_model(class_name: class_name)
|
30
|
+
when "rspec_mutation"
|
31
|
+
Souls::Generate.rspec_mutation(class_name: class_name)
|
32
|
+
when "rspec_query"
|
33
|
+
Souls::Generate.rspec_query(class_name: class_name)
|
34
|
+
when "rspec_resolver"
|
35
|
+
Souls::Generate.rspec_resolver(class_name: class_name)
|
36
|
+
when "rspec_policy"
|
37
|
+
Souls::Generate.rspec_policy(class_name: class_name)
|
38
|
+
when "node_type"
|
39
|
+
Souls::Generate.node_type(class_name: class_name)
|
40
|
+
when "job"
|
41
|
+
Souls::Generate.job(class_name: class_name)
|
42
|
+
when "migrate"
|
43
|
+
Souls::Generate.migrate(class_name: class_name)
|
44
|
+
when "migrate_all"
|
45
|
+
puts(Paint["Let's Go SOULs AUTO CRUD Assist!\n", :cyan])
|
46
|
+
Souls::Generate.get_tables.each do |table|
|
47
|
+
Souls::Generate.migrate(class_name: table.singularize)
|
48
|
+
puts(Paint["Generated #{table.camelize} CRUD Files\n", :yellow])
|
49
|
+
end
|
50
|
+
when "migration"
|
51
|
+
pluralized_class_name = class_name.underscore.pluralize
|
52
|
+
system("rake db:create_migration NAME=create_#{pluralized_class_name}")
|
53
|
+
when "update"
|
54
|
+
Souls::Generate.update_delete(class_name: class_name)
|
55
|
+
Souls::Generate.migrate(class_name: class_name)
|
56
|
+
else
|
57
|
+
"SOULs!"
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
@@ -265,6 +265,8 @@ module Souls
|
|
265
265
|
|
266
266
|
def self.mutation(class_name: "souls")
|
267
267
|
singularized_class_name = class_name.singularize
|
268
|
+
file_dir = "./app/graphql/mutations/base"
|
269
|
+
FileUtils.mkdir_p(file_dir) unless Dir.exist?(file_dir)
|
268
270
|
file_path = "./app/graphql/mutations/base/#{singularized_class_name}/create_#{singularized_class_name}.rb"
|
269
271
|
return "Mutation already exist! #{file_path}" if File.exist?(file_path)
|
270
272
|
|
data/lib/souls/generate/query.rb
CHANGED
@@ -54,6 +54,8 @@ module Souls
|
|
54
54
|
end
|
55
55
|
|
56
56
|
def self.query(class_name: "souls")
|
57
|
+
file_dir = "./app/graphql/queries/"
|
58
|
+
FileUtils.mkdir_p(file_dir) unless Dir.exist?(file_dir)
|
57
59
|
singularized_class_name = class_name.singularize
|
58
60
|
create_query(class_name: singularized_class_name)
|
59
61
|
create_queries(class_name: singularized_class_name)
|
@@ -2,6 +2,8 @@ module Souls
|
|
2
2
|
module Generate
|
3
3
|
## Generate Rspec Model
|
4
4
|
def self.rspec_model(class_name: "souls")
|
5
|
+
file_dir = "./spec/models/"
|
6
|
+
FileUtils.mkdir_p(file_dir) unless Dir.exist?(file_dir)
|
5
7
|
file_path = "./spec/models/#{class_name}_spec.rb"
|
6
8
|
return "RspecModel already exist! #{file_path}" if File.exist?(file_path)
|
7
9
|
|
@@ -2,6 +2,8 @@ module Souls
|
|
2
2
|
module Generate
|
3
3
|
## Generate Rspec Mutation
|
4
4
|
def self.rspec_mutation_head(class_name: "souls")
|
5
|
+
file_dir = "./spec/mutations/base/"
|
6
|
+
FileUtils.mkdir_p(file_dir) unless Dir.exist?(file_dir)
|
5
7
|
file_path = "./spec/mutations/base/#{class_name.singularize}_spec.rb"
|
6
8
|
File.open(file_path, "w") do |f|
|
7
9
|
f.write(<<~TEXT)
|
@@ -2,6 +2,8 @@ module Souls
|
|
2
2
|
module Generate
|
3
3
|
## Generate Rspec Query
|
4
4
|
def self.rspec_query_head(class_name: "souls")
|
5
|
+
file_dir = "./spec/queries/"
|
6
|
+
FileUtils.mkdir_p(file_dir) unless Dir.exist?(file_dir)
|
5
7
|
file_path = "./spec/queries/#{class_name.singularize}_spec.rb"
|
6
8
|
File.open(file_path, "w") do |f|
|
7
9
|
f.write(<<~TEXT)
|
@@ -2,6 +2,8 @@ module Souls
|
|
2
2
|
module Generate
|
3
3
|
## Generate Rspec Resolver
|
4
4
|
def self.rspec_resolver_head(class_name: "souls")
|
5
|
+
file_dir = "./spec/resolvers/"
|
6
|
+
FileUtils.mkdir_p(file_dir) unless Dir.exist?(file_dir)
|
5
7
|
file_path = "./spec/resolvers/#{class_name.singularize}_search_spec.rb"
|
6
8
|
File.open(file_path, "w") do |f|
|
7
9
|
f.write(<<~TEXT)
|
@@ -170,7 +172,7 @@ module Souls
|
|
170
172
|
|
171
173
|
def self.rspec_resolver(class_name: "souls")
|
172
174
|
singularized_class_name = class_name.singularize
|
173
|
-
file_path = "
|
175
|
+
file_path = "./spec/resolvers/#{singularized_class_name}_search_spec.rb"
|
174
176
|
return "Resolver already exist! #{file_path}" if File.exist?(file_path)
|
175
177
|
|
176
178
|
rspec_resolver_head(class_name: singularized_class_name)
|
data/lib/souls/generate/type.rb
CHANGED
@@ -3,6 +3,8 @@ module Souls
|
|
3
3
|
class << self
|
4
4
|
## Generate Type
|
5
5
|
def create_type_head(class_name: "souls")
|
6
|
+
file_dir = "./app/graphql/types/"
|
7
|
+
FileUtils.mkdir_p(file_dir) unless Dir.exist?(file_dir)
|
6
8
|
file_path = "./app/graphql/types/#{class_name}_type.rb"
|
7
9
|
File.open(file_path, "w") do |f|
|
8
10
|
f.write(<<~TEXT)
|
data/lib/souls/version.rb
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.4.
|
1
|
+
0.4.16
|
@@ -1 +1 @@
|
|
1
|
-
0.4.
|
1
|
+
0.4.16
|
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.25.
|
4
|
+
version: 0.25.13
|
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-07-
|
13
|
+
date: 2021-07-28 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: paint
|
@@ -81,6 +81,7 @@ files:
|
|
81
81
|
- lib/souls/generate/application.rb
|
82
82
|
- lib/souls/generate/connection.rb
|
83
83
|
- lib/souls/generate/edge.rb
|
84
|
+
- lib/souls/generate/methods.rb
|
84
85
|
- lib/souls/generate/model.rb
|
85
86
|
- lib/souls/generate/mutation.rb
|
86
87
|
- lib/souls/generate/policy.rb
|