souls 0.68.4 → 0.69.0
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/README.md +9 -4
- data/lib/souls/cli/delete/application.rb +67 -0
- data/lib/souls/cli/delete/connection.rb +16 -0
- data/lib/souls/cli/delete/connection_rbs.rb +19 -0
- data/lib/souls/cli/delete/edge.rb +16 -0
- data/lib/souls/cli/delete/edge_rbs.rb +19 -0
- data/lib/souls/cli/delete/index.rb +18 -0
- data/lib/souls/cli/delete/job.rb +39 -0
- data/lib/souls/cli/delete/job_rbs.rb +20 -0
- data/lib/souls/cli/delete/manager.rb +20 -0
- data/lib/souls/cli/delete/manager_rbs.rb +20 -0
- data/lib/souls/cli/delete/mutation.rb +17 -0
- data/lib/souls/cli/delete/mutation_rbs.rb +17 -0
- data/lib/souls/cli/delete/policy.rb +15 -0
- data/lib/souls/cli/delete/policy_rbs.rb +19 -0
- data/lib/souls/cli/delete/query.rb +14 -0
- data/lib/souls/cli/delete/query_rbs.rb +16 -0
- data/lib/souls/cli/delete/resolver.rb +14 -0
- data/lib/souls/cli/delete/resolver_rbs.rb +19 -0
- data/lib/souls/cli/delete/rspec_factory.rb +13 -0
- data/lib/souls/cli/delete/rspec_job.rb +14 -0
- data/lib/souls/cli/delete/rspec_manager.rb +15 -0
- data/lib/souls/cli/delete/rspec_mutation.rb +14 -0
- data/lib/souls/cli/delete/rspec_policy.rb +14 -0
- data/lib/souls/cli/delete/rspec_query.rb +14 -0
- data/lib/souls/cli/delete/rspec_resolver.rb +14 -0
- data/lib/souls/cli/delete/type.rb +14 -0
- data/lib/souls/cli/delete/type_rbs.rb +19 -0
- data/lib/souls/cli/generate/application.rb +0 -24
- data/lib/souls/cli/generate/type.rb +1 -4
- data/lib/souls/cli/index.rb +1 -0
- data/lib/souls/cli/upgrade/submodule.rb +1 -1
- data/lib/souls/cli.rb +4 -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 +36 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6b61a64dda33348af32114cd6c7b6894b6cb98751b7989caebc381d10fd135ef
|
4
|
+
data.tar.gz: ef0ae0691b1b1f36c28b1ed550e5c1ee235e1ecd2aed12a29f15c0911a424810
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f517555e97d304344a3f9af0b55bfcfc30f5ddf88e16be81110a9a1676cc3efa7a0b72c9cafd86700892e18da795d663d6f4675c1fa253e2a18cf1eb5f2f2298
|
7
|
+
data.tar.gz: 8c1887fdee4fc99e0bda89a85aae9221f0db583102f7ce8e56825510567d3ab7b51339be7c77db7979cb39b4a4064109f4b77acbf4d63b021fbd4130d0b234dc
|
data/README.md
CHANGED
@@ -17,10 +17,18 @@
|
|
17
17
|
</a>
|
18
18
|
</p>
|
19
19
|
|
20
|
+
## SOULs Serverless Application Framework Document
|
21
|
+
|
22
|
+
- [Go to SOULs Document](https://souls.elsoul.nl/)
|
23
|
+
|
24
|
+
|
20
25
|
## What's SOULs?
|
21
26
|
|
22
27
|
Welcome to SOULs Serverless Application Framework!
|
23
28
|
|
29
|
+
Build Serverless Apps faster like Rails.
|
30
|
+
Powered by Ruby GraphQL, RBS/Steep, Active Record, RSpec, RuboCop, and Google Cloud.
|
31
|
+
|
24
32
|
- Focus on business logic in serverless environment
|
25
33
|
- Maximize development efficiency with CI / CD standard schema-driven Scaffold
|
26
34
|
- Achieve global scale with lower management costs
|
@@ -28,7 +36,7 @@ Welcome to SOULs Serverless Application Framework!
|
|
28
36
|

|
29
37
|
|
30
38
|
|
31
|
-
SOULs creates 2 types of
|
39
|
+
SOULs creates 2 types of APP.
|
32
40
|
|
33
41
|
1. API - GraphQL (Ruby) - Simple API - Cloud Run
|
34
42
|
2. Worker - Google Pub/Sub Messaging Worker API (Ruby) - Cloud Run
|
@@ -81,9 +89,6 @@ Check your GraphQL PlayGround
|
|
81
89
|
[localhost:4000/playground](localhost:4000/playground)
|
82
90
|
|
83
91
|
|
84
|
-
## SOULs Serverless Application Framework Document
|
85
|
-
|
86
|
-
- [SOULs Document](https://souls.elsoul.nl/)
|
87
92
|
|
88
93
|
## Development
|
89
94
|
|
@@ -0,0 +1,67 @@
|
|
1
|
+
module Souls
|
2
|
+
class Delete < Thor
|
3
|
+
desc "scaffold [CLASS_NAME]", "Delete Scaffold"
|
4
|
+
method_option :rbs, type: :boolean, aliases: "--rbs", default: false, desc: "Deletes Only RBS Files"
|
5
|
+
def scaffold(class_name)
|
6
|
+
singularized_class_name = class_name.singularize
|
7
|
+
if options[:rbs]
|
8
|
+
run_rbs_scaffold(class_name: singularized_class_name)
|
9
|
+
else
|
10
|
+
run_scaffold(class_name: singularized_class_name)
|
11
|
+
end
|
12
|
+
true
|
13
|
+
rescue Thor::Error => e
|
14
|
+
raise(Thor::Error, e)
|
15
|
+
end
|
16
|
+
|
17
|
+
desc "scaffold_all", "Delete Scaffold All Tables from schema.rb"
|
18
|
+
method_option :rbs, type: :boolean, aliases: "--rbs", default: false, desc: "Deletes Only RBS Files"
|
19
|
+
def scaffold_all
|
20
|
+
puts(Paint["Delete All Scaffold Files!\n", :cyan])
|
21
|
+
Souls.get_tables.each do |table|
|
22
|
+
if options[:rbs]
|
23
|
+
Souls::Delete.new.invoke(:scaffold, [table.singularize], { rbs: options[:rbs] })
|
24
|
+
else
|
25
|
+
Souls::Delete.new.invoke(:scaffold, [table.singularize], {})
|
26
|
+
end
|
27
|
+
end
|
28
|
+
true
|
29
|
+
rescue Thor::Error => e
|
30
|
+
raise(Thor::Error, e)
|
31
|
+
end
|
32
|
+
|
33
|
+
private
|
34
|
+
|
35
|
+
def run_scaffold(class_name: "user")
|
36
|
+
type(class_name)
|
37
|
+
type_rbs(class_name)
|
38
|
+
query(class_name)
|
39
|
+
query_rbs(class_name)
|
40
|
+
mutation(class_name)
|
41
|
+
mutation_rbs(class_name)
|
42
|
+
policy(class_name)
|
43
|
+
policy_rbs(class_name)
|
44
|
+
edge(class_name)
|
45
|
+
edge_rbs(class_name)
|
46
|
+
connection(class_name)
|
47
|
+
connection_rbs(class_name)
|
48
|
+
resolver(class_name)
|
49
|
+
resolver_rbs(class_name)
|
50
|
+
rspec_factory(class_name)
|
51
|
+
rspec_mutation(class_name)
|
52
|
+
rspec_query(class_name)
|
53
|
+
rspec_resolver(class_name)
|
54
|
+
rspec_policy(class_name)
|
55
|
+
end
|
56
|
+
|
57
|
+
def run_rbs_scaffold(class_name: "user")
|
58
|
+
type_rbs(class_name)
|
59
|
+
query_rbs(class_name)
|
60
|
+
mutation_rbs(class_name)
|
61
|
+
policy_rbs(class_name)
|
62
|
+
edge_rbs(class_name)
|
63
|
+
connection_rbs(class_name)
|
64
|
+
resolver_rbs(class_name)
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module Souls
|
2
|
+
class Delete < Thor
|
3
|
+
desc "connection [CLASS_NAME]", "Delete GraphQL Connection"
|
4
|
+
def connection(class_name)
|
5
|
+
file_dir = "./app/graphql/types/connections/"
|
6
|
+
FileUtils.mkdir_p(file_dir) unless Dir.exist?(file_dir)
|
7
|
+
singularized_class_name = class_name.underscore.singularize
|
8
|
+
file_path = "./app/graphql/types/connections/#{singularized_class_name}_connection.rb"
|
9
|
+
FileUtils.rm(file_path)
|
10
|
+
puts(Paint % ["Delete file! : %{white_text}", :yellow, { white_text: [file_path.to_s, :white] }])
|
11
|
+
file_path
|
12
|
+
rescue Thor::Error => e
|
13
|
+
raise(Thor::Error, e)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module Souls
|
2
|
+
class Delete < Thor
|
3
|
+
desc "connection_rbs [CLASS_NAME]", "Delete GraphQL Connection RBS"
|
4
|
+
def connection_rbs(class_name)
|
5
|
+
file_path = ""
|
6
|
+
Dir.chdir(Souls.get_mother_path.to_s) do
|
7
|
+
file_dir = "./sig/api/app/graphql/types/connections/"
|
8
|
+
FileUtils.mkdir_p(file_dir) unless Dir.exist?(file_dir)
|
9
|
+
singularized_class_name = class_name.underscore.singularize
|
10
|
+
file_path = "#{file_dir}#{singularized_class_name}_connection.rbs"
|
11
|
+
FileUtils.rm(file_path)
|
12
|
+
puts(Paint % ["Deleted file! : %{white_text}", :yellow, { white_text: [file_path.to_s, :white] }])
|
13
|
+
end
|
14
|
+
file_path
|
15
|
+
rescue Thor::Error => e
|
16
|
+
raise(Thor::Error, e)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module Souls
|
2
|
+
class Delete < Thor
|
3
|
+
desc "edge [CLASS_NAME]", "Delete GraphQL Edge"
|
4
|
+
def edge(class_name)
|
5
|
+
file_dir = "./app/graphql/types/edges"
|
6
|
+
FileUtils.mkdir_p(file_dir) unless Dir.exist?(file_dir)
|
7
|
+
singularized_class_name = class_name.underscore.singularize
|
8
|
+
file_path = "./app/graphql/types/edges/#{singularized_class_name}_edge.rb"
|
9
|
+
FileUtils.rm(file_path)
|
10
|
+
puts(Paint % ["Deleted file! : %{white_text}", :yellow, { white_text: [file_path.to_s, :white] }])
|
11
|
+
file_path
|
12
|
+
rescue Thor::Error => e
|
13
|
+
raise(Thor::Error, e)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module Souls
|
2
|
+
class Delete < Thor
|
3
|
+
desc "edge_rbs [CLASS_NAME]", "Delete GraphQL Edge RBS"
|
4
|
+
def edge_rbs(class_name)
|
5
|
+
file_path = ""
|
6
|
+
Dir.chdir(Souls.get_mother_path.to_s) do
|
7
|
+
file_dir = "./sig/api/app/graphql/types/edges/"
|
8
|
+
FileUtils.mkdir_p(file_dir) unless Dir.exist?(file_dir)
|
9
|
+
singularized_class_name = class_name.underscore.singularize
|
10
|
+
file_path = "#{file_dir}#{singularized_class_name}_edge.rbs"
|
11
|
+
FileUtils.rm(file_path)
|
12
|
+
puts(Paint % ["Delete file! : %{white_text}", :yellow, { white_text: [file_path.to_s, :white] }])
|
13
|
+
end
|
14
|
+
file_path
|
15
|
+
rescue Thor::Error => e
|
16
|
+
raise(Thor::Error, e)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
require_paths = []
|
2
|
+
dev_path = "lib/souls/cli/delete/*"
|
3
|
+
souls_path = Dir["#{Gem.dir}/gems/souls-*"].last
|
4
|
+
gem_path = "#{souls_path}/lib/souls/cli/delete/*"
|
5
|
+
file_paths = File.exist?("souls.gemspec") ? dev_path : gem_path
|
6
|
+
Dir[file_paths].map do |n|
|
7
|
+
next if n.include?("index.rb")
|
8
|
+
|
9
|
+
require_paths << n.split("/").last.gsub(".rb", "")
|
10
|
+
end
|
11
|
+
require_paths.each do |path|
|
12
|
+
require_relative "./#{path}"
|
13
|
+
end
|
14
|
+
|
15
|
+
module Souls
|
16
|
+
class Delete < Thor
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
module Souls
|
2
|
+
class Delete < Thor
|
3
|
+
desc "job [CLASS_NAME]", "Delete Job File in Worker"
|
4
|
+
method_option :mailer, type: :boolean, aliases: "--mailer", default: false, desc: "Mailer Option"
|
5
|
+
def job(class_name)
|
6
|
+
if options[:mailer]
|
7
|
+
mailgun_mailer(class_name: class_name)
|
8
|
+
else
|
9
|
+
delete_job_mutation(class_name: class_name)
|
10
|
+
end
|
11
|
+
Souls::Delete.new.invoke(:job_rbs, [class_name], {})
|
12
|
+
Souls::Delete.new.invoke(:rspec_job, [class_name], {})
|
13
|
+
rescue Thor::Error => e
|
14
|
+
raise(Thor::Error, e)
|
15
|
+
end
|
16
|
+
|
17
|
+
private
|
18
|
+
|
19
|
+
def delete_job_mutation(class_name: "send-mailer")
|
20
|
+
file_dir = "./app/graphql/mutations/"
|
21
|
+
FileUtils.mkdir_p(file_dir) unless Dir.exist?(file_dir)
|
22
|
+
file_path = "#{file_dir}#{class_name.singularize}.rb"
|
23
|
+
|
24
|
+
FileUtils.rm(file_path)
|
25
|
+
puts(Paint % ["Deleted file! : %{white_text}", :yellow, { white_text: [file_path.to_s, :white] }])
|
26
|
+
file_path
|
27
|
+
end
|
28
|
+
|
29
|
+
def mailgun_mailer(class_name: "mailer")
|
30
|
+
file_dir = "./app/graphql/mutations/"
|
31
|
+
FileUtils.mkdir_p(file_dir) unless Dir.exist?(file_dir)
|
32
|
+
file_path = "#{file_dir}#{class_name.singularize}.rb"
|
33
|
+
|
34
|
+
FileUtils.rm(file_path)
|
35
|
+
puts(Paint % ["Deleted file! : %{white_text}", :yellow, { white_text: [file_path.to_s, :white] }])
|
36
|
+
file_path
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module Souls
|
2
|
+
class Delete < Thor
|
3
|
+
desc "job_rbs [CLASS_NAME]", "Delete SOULs Job Mutation RBS Template"
|
4
|
+
def job_rbs(class_name)
|
5
|
+
file_path = ""
|
6
|
+
worker_name = FileUtils.pwd.split("/").last
|
7
|
+
Dir.chdir(Souls.get_mother_path.to_s) do
|
8
|
+
singularized_class_name = class_name.underscore.singularize
|
9
|
+
file_dir = "./sig/#{worker_name}/app/graphql/mutations/"
|
10
|
+
FileUtils.mkdir_p(file_dir) unless Dir.exist?(file_dir)
|
11
|
+
file_path = "#{file_dir}#{singularized_class_name}.rbs"
|
12
|
+
FileUtils.rm(file_path)
|
13
|
+
puts(Paint % ["Deleted file! : %{white_text}", :yellow, { white_text: [file_path.to_s, :white] }])
|
14
|
+
end
|
15
|
+
file_path
|
16
|
+
rescue Thor::Error => e
|
17
|
+
raise(Thor::Error, e)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module Souls
|
2
|
+
class Delete < Thor
|
3
|
+
desc "manager [MANAGER_NAME]", "Delete GraphQL Mutation Template"
|
4
|
+
method_option :mutation, aliases: "--mutation", required: true, desc: "Mutation File Name"
|
5
|
+
def manager(class_name)
|
6
|
+
singularized_class_name = class_name.underscore.singularize
|
7
|
+
file_dir = "./app/graphql/mutations/managers/#{singularized_class_name}_manager"
|
8
|
+
FileUtils.mkdir_p(file_dir) unless Dir.exist?(file_dir)
|
9
|
+
file_path = "#{file_dir}/#{options[:mutation]}.rb"
|
10
|
+
|
11
|
+
FileUtils.rm(file_path)
|
12
|
+
puts(Paint % ["Created file! : %{white_text}", :green, { white_text: [file_path.to_s, :white] }])
|
13
|
+
Souls::Delete.new.invoke(:manager_rbs, [singularized_class_name], { mutation: options[:mutation] })
|
14
|
+
Souls::Delete.new.invoke(:rspec_manager, [singularized_class_name], { mutation: options[:mutation] })
|
15
|
+
file_path
|
16
|
+
rescue Thor::Error => e
|
17
|
+
raise(Thor::Error, e)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module Souls
|
2
|
+
class Delete < Thor
|
3
|
+
desc "manager_rbs [CLASS_NAME]", "Delete SOULs Manager RBS Template"
|
4
|
+
method_option :mutation, aliases: "--mutation", required: true, desc: "Mutation File Name"
|
5
|
+
def manager_rbs(class_name)
|
6
|
+
file_path = ""
|
7
|
+
singularized_class_name = class_name.underscore.singularize
|
8
|
+
Dir.chdir(Souls.get_mother_path.to_s) do
|
9
|
+
file_dir = "./sig/api/app/graphql/mutations/managers/#{singularized_class_name}_manager"
|
10
|
+
FileUtils.mkdir_p(file_dir) unless Dir.exist?(file_dir)
|
11
|
+
file_path = "#{file_dir}/#{options[:mutation]}.rbs"
|
12
|
+
FileUtils.rm(file_path)
|
13
|
+
puts(Paint % ["Deleted file! : %{white_text}", :yellow, { white_text: [file_path.to_s, :white] }])
|
14
|
+
end
|
15
|
+
file_path
|
16
|
+
rescue Thor::Error => e
|
17
|
+
raise(Thor::Error, e)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module Souls
|
2
|
+
class Delete < Thor
|
3
|
+
desc "mutation [CLASS_NAME]", "Delete GraphQL Mutation"
|
4
|
+
def mutation(class_name)
|
5
|
+
singularized_class_name = class_name.singularize
|
6
|
+
file_path = ""
|
7
|
+
Dir.chdir(Souls.get_api_path.to_s) do
|
8
|
+
file_path = "./app/graphql/mutations/base/#{singularized_class_name}/"
|
9
|
+
FileUtils.rm_rf(file_path)
|
10
|
+
end
|
11
|
+
puts(Paint % ["Deleted file! : %{white_text}", :yellow, { white_text: [file_path.to_s, :white] }])
|
12
|
+
file_path
|
13
|
+
rescue Thor::Error => e
|
14
|
+
raise(Thor::Error, e)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module Souls
|
2
|
+
class Delete < Thor
|
3
|
+
desc "mutation_rbs [CLASS_NAME]", "Delete GraphQL Mutation RBS"
|
4
|
+
def mutation_rbs(class_name)
|
5
|
+
singularized_class_name = class_name.underscore.singularize
|
6
|
+
file_path = ""
|
7
|
+
Dir.chdir(Souls.get_mother_path.to_s) do
|
8
|
+
file_dir = "./sig/api/app/graphql/mutations/base/#{singularized_class_name}"
|
9
|
+
FileUtils.rm_rf(file_dir)
|
10
|
+
end
|
11
|
+
puts(Paint % ["Deleted file! : %{white_text}", :yellow, { white_text: [file_path.to_s, :white] }])
|
12
|
+
file_path
|
13
|
+
rescue Thor::Error => e
|
14
|
+
raise(Thor::Error, e)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module Souls
|
2
|
+
class Delete < Thor
|
3
|
+
desc "policy [CLASS_NAME]", "Delete Policy File Template"
|
4
|
+
def policy(class_name)
|
5
|
+
dir_name = "./app/policies"
|
6
|
+
FileUtils.mkdir_p(dir_name) unless Dir.exist?(dir_name)
|
7
|
+
file_path = "#{dir_name}/#{class_name.singularize}_policy.rb"
|
8
|
+
FileUtils.rm(file_path)
|
9
|
+
puts(Paint % ["Deleted file! : %{white_text}", :yellow, { white_text: [file_path.to_s, :white] }])
|
10
|
+
file_path
|
11
|
+
rescue Thor::Error => e
|
12
|
+
raise(Thor::Error, e)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module Souls
|
2
|
+
class Delete < Thor
|
3
|
+
desc "policy_rbs [CLASS_NAME]", "Delete Policy RBS"
|
4
|
+
def policy_rbs(class_name)
|
5
|
+
file_path = ""
|
6
|
+
Dir.chdir(Souls.get_mother_path.to_s) do
|
7
|
+
file_dir = "./sig/api/app/graphql/policies/"
|
8
|
+
FileUtils.mkdir_p(file_dir) unless Dir.exist?(file_dir)
|
9
|
+
singularized_class_name = class_name.underscore.singularize
|
10
|
+
file_path = "#{file_dir}#{singularized_class_name}_policy.rbs"
|
11
|
+
FileUtils.rm(file_path)
|
12
|
+
puts(Paint % ["Deleted file! : %{white_text}", :yellow, { white_text: [file_path.to_s, :white] }])
|
13
|
+
end
|
14
|
+
file_path
|
15
|
+
rescue Thor::Error => e
|
16
|
+
raise(Thor::Error, e)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
module Souls
|
2
|
+
class Delete < Thor
|
3
|
+
desc "query [CLASS_NAME]", "Delete GraphQL Query"
|
4
|
+
def query(class_name)
|
5
|
+
singularized_class_name = class_name.singularize
|
6
|
+
file_path = "./app/graphql/queries/#{singularized_class_name}*.rb"
|
7
|
+
FileUtils.rm(file_path)
|
8
|
+
puts(Paint % ["Deleted file! : %{white_text}", :yellow, { white_text: [file_path.to_s, :white] }])
|
9
|
+
file_path
|
10
|
+
rescue Thor::Error => e
|
11
|
+
raise(Thor::Error, e)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module Souls
|
2
|
+
class Delete < Thor
|
3
|
+
desc "query_rbs [CLASS_NAME]", "Delete GraphQL Query RBS"
|
4
|
+
def query_rbs(class_name)
|
5
|
+
file_path = ""
|
6
|
+
Dir.chdir(Souls.get_mother_path.to_s) do
|
7
|
+
file_dir = "./sig/api/app/graphql/queries/"
|
8
|
+
singularized_class_name = class_name.underscore.singularize
|
9
|
+
file_path = "#{file_dir}#{singularized_class_name}*.rbs"
|
10
|
+
FileUtils.rm(file_path)
|
11
|
+
puts(Paint % ["Deleted file! : %{white_text}", :yellow, { white_text: [file_path.to_s, :white] }])
|
12
|
+
file_path
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
module Souls
|
2
|
+
class Delete < Thor
|
3
|
+
desc "resolver [CLASS_NAME]", "Delete GraphQL Resolver"
|
4
|
+
def resolver(class_name)
|
5
|
+
singularized_class_name = class_name.singularize.underscore
|
6
|
+
file_path = "./app/graphql/resolvers/#{singularized_class_name}_search.rb"
|
7
|
+
FileUtils.rm(file_path)
|
8
|
+
puts(Paint % ["Deleted file! : %{white_text}", :yellow, { white_text: [file_path.to_s, :white] }])
|
9
|
+
file_path
|
10
|
+
rescue Thor::Error => e
|
11
|
+
raise(Thor::Error, e)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module Souls
|
2
|
+
class Delete < Thor
|
3
|
+
desc "resolver_rbs [CLASS_NAME]", "Delete GraphQL Resolver RBS"
|
4
|
+
def resolver_rbs(class_name)
|
5
|
+
singularized_class_name = class_name.underscore.singularize
|
6
|
+
file_path = ""
|
7
|
+
Dir.chdir(Souls.get_mother_path.to_s) do
|
8
|
+
file_dir = "./sig/api/app/graphql/resolvers"
|
9
|
+
FileUtils.mkdir_p(file_dir) unless Dir.exist?(file_dir)
|
10
|
+
file_path = "#{file_dir}/#{singularized_class_name}_search.rbs"
|
11
|
+
FileUtils.rm(file_path)
|
12
|
+
end
|
13
|
+
puts(Paint % ["Deleted file! : %{white_text}", :yellow, { white_text: [file_path.to_s, :white] }])
|
14
|
+
file_path
|
15
|
+
rescue Thor::Error => e
|
16
|
+
raise(Thor::Error, e)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
module Souls
|
2
|
+
class Delete < Thor
|
3
|
+
desc "rspec_factory [CLASS_NAME]", "Delete Rspec Factory Test from schema.rb"
|
4
|
+
def rspec_factory(class_name)
|
5
|
+
file_path = "./spec/factories/#{class_name.pluralize}.rb"
|
6
|
+
FileUtils.rm(file_path)
|
7
|
+
puts(Paint % ["Deleted file! : %{white_text}", :yellow, { white_text: [file_path.to_s, :white] }])
|
8
|
+
file_path
|
9
|
+
rescue Thor::Error => e
|
10
|
+
raise(Thor::Error, e)
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
module Souls
|
2
|
+
class Delete < Thor
|
3
|
+
desc "rspec_job [CLASS_NAME]", "Delete Rspec Job Test Template"
|
4
|
+
def rspec_job(class_name)
|
5
|
+
singularized_class_name = class_name.underscore.singularize
|
6
|
+
file_path = "#{file_dir}/#{singularized_class_name}_spec.rb"
|
7
|
+
FileUtils.rm(file_path)
|
8
|
+
puts(Paint % ["Deleted file! : %{white_text}", :yellow, { white_text: [file_path.to_s, :white] }])
|
9
|
+
file_path
|
10
|
+
rescue Thor::Error => e
|
11
|
+
raise(Thor::Error, e)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module Souls
|
2
|
+
class Delete < Thor
|
3
|
+
desc "rspec_manager [CLASS_NAME]", "Delete Rspec Manager Test Template"
|
4
|
+
method_option :mutation, aliases: "--mutation", required: true, desc: "Mutation File Name"
|
5
|
+
def rspec_manager(class_name)
|
6
|
+
singularized_class_name = class_name.underscore.singularize
|
7
|
+
file_path = "./spec/mutations/managers/#{singularized_class_name}/#{options[:mutation]}_spec.rb"
|
8
|
+
FileUtils.rm(file_path)
|
9
|
+
puts(Paint % ["Deleted file! : %{white_text}", :yellow, { white_text: [file_path.to_s, :white] }])
|
10
|
+
file_path
|
11
|
+
rescue Thor::Error => e
|
12
|
+
raise(Thor::Error, e)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
module Souls
|
2
|
+
class Delete < Thor
|
3
|
+
desc "rspec_mutation [CLASS_NAME]", "Delete Rspec Mutation Test from schema.rb"
|
4
|
+
def rspec_mutation(class_name)
|
5
|
+
singularized_class_name = class_name.singularize
|
6
|
+
file_path = "./spec/mutations/base/#{singularized_class_name}_spec.rb"
|
7
|
+
FileUtils.rm(file_path)
|
8
|
+
puts(Paint % ["Deleted file! : %{white_text}", :yellow, { white_text: [file_path.to_s, :white] }])
|
9
|
+
file_path
|
10
|
+
rescue StandardError => e
|
11
|
+
raise(StandardError, e)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
module Souls
|
2
|
+
class Delete < Thor
|
3
|
+
desc "rspec_policy [CLASS_NAME]", "Delete Rspec Policy Test"
|
4
|
+
def rspec_policy(class_name)
|
5
|
+
singularized_class_name = class_name.singularize
|
6
|
+
file_path = "./spec/policies/#{singularized_class_name}_policy_spec.rb"
|
7
|
+
FileUtils.rm(file_path)
|
8
|
+
puts(Paint % ["Deleted file! : %{white_text}", :yellow, { white_text: [file_path.to_s, :white] }])
|
9
|
+
file_path
|
10
|
+
rescue Thor::Error => e
|
11
|
+
raise(Thor::Error, e)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
module Souls
|
2
|
+
class Delete < Thor
|
3
|
+
desc "rspec_query [CLASS_NAME]", "Delete Rspec Query Test"
|
4
|
+
def rspec_query(class_name)
|
5
|
+
singularized_class_name = class_name.singularize
|
6
|
+
file_path = "./spec/queries/#{singularized_class_name}_spec.rb"
|
7
|
+
FileUtils.rm(file_path)
|
8
|
+
puts(Paint % ["Deleted file! : %{white_text}", :yellow, { white_text: [file_path.to_s, :white] }])
|
9
|
+
file_path
|
10
|
+
rescue Thor::Error => e
|
11
|
+
raise(Thor::Error, e)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
module Souls
|
2
|
+
class Delete < Thor
|
3
|
+
desc "rspec_resolver [CLASS_NAME]", "Delete Rspec Resolver Test"
|
4
|
+
def rspec_resolver(class_name)
|
5
|
+
singularized_class_name = class_name.singularize
|
6
|
+
file_path = "./spec/resolvers/#{singularized_class_name}_search_spec.rb"
|
7
|
+
FileUtils.rm(file_path)
|
8
|
+
puts(Paint % ["Deleted file! : %{white_text}", :yellow, { white_text: [file_path.to_s, :white] }])
|
9
|
+
file_path
|
10
|
+
rescue Thor::Error => e
|
11
|
+
raise(Thor::Error, e)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
module Souls
|
2
|
+
class Delete < Thor
|
3
|
+
desc "type [CLASS_NAME]", "Delete GraphQL Type"
|
4
|
+
def type(class_name)
|
5
|
+
singularized_class_name = class_name.singularize
|
6
|
+
file_path = "./app/graphql/types/#{singularized_class_name}_type.rb"
|
7
|
+
FileUtils.rm(file_path)
|
8
|
+
puts(Paint % ["Deleted file! : %{white_text}", :yellow, { white_text: [file_path.to_s, :white] }])
|
9
|
+
file_path
|
10
|
+
rescue Thor::Error => e
|
11
|
+
raise(Thor::Error, e)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module Souls
|
2
|
+
class Delete < Thor
|
3
|
+
desc "type_rbs [CLASS_NAME]", "Delete GraphQL Type RBS"
|
4
|
+
def type_rbs(class_name)
|
5
|
+
singularized_class_name = class_name.underscore.singularize
|
6
|
+
file_path = ""
|
7
|
+
Dir.chdir(Souls.get_mother_path.to_s) do
|
8
|
+
file_dir = "./sig/api/app/graphql/types"
|
9
|
+
FileUtils.mkdir_p(file_dir) unless Dir.exist?(file_dir)
|
10
|
+
file_path = "#{file_dir}/#{singularized_class_name}_type.rbs"
|
11
|
+
FileUtils.rm(file_path)
|
12
|
+
end
|
13
|
+
puts(Paint % ["Deleted file! : %{white_text}", :yellow, { white_text: [file_path.to_s, :white] }])
|
14
|
+
file_path
|
15
|
+
rescue Thor::Error => e
|
16
|
+
raise(Thor::Error, e)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -30,30 +30,6 @@ module Souls
|
|
30
30
|
raise(Thor::Error, e)
|
31
31
|
end
|
32
32
|
|
33
|
-
desc "delete_all [CLASS_NAME]", "Generate Scaffold All Tables from schema.rb"
|
34
|
-
def delete_all(class_name)
|
35
|
-
singularized_class_name = class_name.singularize.underscore
|
36
|
-
pluralized_class_name = class_name.pluralize.underscore
|
37
|
-
FileUtils.rm("./app/models/#{singularized_class_name}.rb")
|
38
|
-
FileUtils.rm("./app/policies/#{singularized_class_name}_policy.rb")
|
39
|
-
FileUtils.rm_rf("./app/graphql/mutations/base/#{singularized_class_name}")
|
40
|
-
FileUtils.rm("./app/graphql/queries/#{singularized_class_name}.rb")
|
41
|
-
FileUtils.rm("./app/graphql/queries/#{pluralized_class_name}.rb")
|
42
|
-
FileUtils.rm("./app/graphql/resolvers/#{singularized_class_name}_search.rb")
|
43
|
-
FileUtils.rm("./app/graphql/types/#{singularized_class_name}_type.rb")
|
44
|
-
FileUtils.rm("./app/graphql/types/edges/#{singularized_class_name}_edge.rb")
|
45
|
-
FileUtils.rm("./app/graphql/types/connections/#{singularized_class_name}_connection.rb")
|
46
|
-
FileUtils.rm("./spec/factories/#{pluralized_class_name}.rb")
|
47
|
-
FileUtils.rm("./spec/mutations/base/#{singularized_class_name}_spec.rb")
|
48
|
-
FileUtils.rm("./spec/models/#{singularized_class_name}_spec.rb")
|
49
|
-
FileUtils.rm("./spec/queries/#{singularized_class_name}_spec.rb")
|
50
|
-
FileUtils.rm("./spec/policies/#{singularized_class_name}_policy_spec.rb")
|
51
|
-
FileUtils.rm("./spec/resolvers/#{singularized_class_name}_search_spec.rb")
|
52
|
-
puts(Paint["deleted #{class_name.camelize} CRUD!", :yellow])
|
53
|
-
rescue Thor::Error => e
|
54
|
-
raise(Thor::Error, e)
|
55
|
-
end
|
56
|
-
|
57
33
|
private
|
58
34
|
|
59
35
|
def run_scaffold(class_name: "user")
|
@@ -49,10 +49,7 @@ module Souls
|
|
49
49
|
" field :#{name.gsub(
|
50
50
|
'_id',
|
51
51
|
''
|
52
|
-
)}, Types::#{name.gsub(
|
53
|
-
'_id',
|
54
|
-
''
|
55
|
-
).singularize.camelize}Type, null: false\n"
|
52
|
+
)}, Types::#{name.gsub('_id', '').singularize.camelize}Type, null: false\n"
|
56
53
|
)
|
57
54
|
else
|
58
55
|
new_line.write(" field :#{name}, #{field}, null: true\n")
|
data/lib/souls/cli/index.rb
CHANGED
@@ -3,6 +3,7 @@ require_relative "./generate/index"
|
|
3
3
|
require_relative "./update/index"
|
4
4
|
require_relative "./create/index"
|
5
5
|
require_relative "./db/index"
|
6
|
+
require_relative "./delete/index"
|
6
7
|
require_relative "./docker/index"
|
7
8
|
require_relative "./gcloud/index"
|
8
9
|
require_relative "./init/index"
|
data/lib/souls/cli.rb
CHANGED
@@ -13,6 +13,9 @@ module Souls
|
|
13
13
|
desc "db [COMMAND]", "SOULs DB Commands"
|
14
14
|
subcommand "db", DB
|
15
15
|
|
16
|
+
desc "delete [COMMAND]", "SOULs Delete Commands"
|
17
|
+
subcommand "delete", Delete
|
18
|
+
|
16
19
|
desc "docker [COMMAND]", "SOULs Docker Commands"
|
17
20
|
subcommand "docker", Docker
|
18
21
|
|
@@ -30,6 +33,7 @@ module Souls
|
|
30
33
|
map "s" => :server
|
31
34
|
map "g" => :generate
|
32
35
|
map "t" => :test
|
36
|
+
map "d" => :delete
|
33
37
|
map ["-v", "--v", "--version", "-version"] => :version
|
34
38
|
# rubocop:enable Style/StringHashKeys
|
35
39
|
|
data/lib/souls/version.rb
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.48.0
|
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.48.0
|
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.
|
4
|
+
version: 0.69.0
|
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-10-
|
13
|
+
date: 2021-10-11 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activesupport
|
@@ -110,13 +110,8 @@ dependencies:
|
|
110
110
|
- - ">="
|
111
111
|
- !ruby/object:Gem::Version
|
112
112
|
version: 1.1.0
|
113
|
-
description:
|
114
|
-
|
115
|
-
- Ruby GraphQL with RBS/Steep - Run like Rails! - Focus on business logic in serverless environment
|
116
|
-
|
117
|
-
- Maximize development efficiency with CI / CD standard schema-driven Scaffold
|
118
|
-
|
119
|
-
- Achieve global scale with lower management costs - Rails like Scaffold
|
113
|
+
description: "Build Serverless Apps faster like Rails.\n Powered by Ruby GraphQL,
|
114
|
+
RBS/Steep, Active Record, RSpec, RuboCop, and Google Cloud. "
|
120
115
|
email:
|
121
116
|
- f.kawasaki@elsoul.nl
|
122
117
|
- s.kishi@elsoul.nl
|
@@ -139,6 +134,33 @@ files:
|
|
139
134
|
- lib/souls/cli/db/model.rb
|
140
135
|
- lib/souls/cli/db/model_rbs.rb
|
141
136
|
- lib/souls/cli/db/rspec_model.rb
|
137
|
+
- lib/souls/cli/delete/application.rb
|
138
|
+
- lib/souls/cli/delete/connection.rb
|
139
|
+
- lib/souls/cli/delete/connection_rbs.rb
|
140
|
+
- lib/souls/cli/delete/edge.rb
|
141
|
+
- lib/souls/cli/delete/edge_rbs.rb
|
142
|
+
- lib/souls/cli/delete/index.rb
|
143
|
+
- lib/souls/cli/delete/job.rb
|
144
|
+
- lib/souls/cli/delete/job_rbs.rb
|
145
|
+
- lib/souls/cli/delete/manager.rb
|
146
|
+
- lib/souls/cli/delete/manager_rbs.rb
|
147
|
+
- lib/souls/cli/delete/mutation.rb
|
148
|
+
- lib/souls/cli/delete/mutation_rbs.rb
|
149
|
+
- lib/souls/cli/delete/policy.rb
|
150
|
+
- lib/souls/cli/delete/policy_rbs.rb
|
151
|
+
- lib/souls/cli/delete/query.rb
|
152
|
+
- lib/souls/cli/delete/query_rbs.rb
|
153
|
+
- lib/souls/cli/delete/resolver.rb
|
154
|
+
- lib/souls/cli/delete/resolver_rbs.rb
|
155
|
+
- lib/souls/cli/delete/rspec_factory.rb
|
156
|
+
- lib/souls/cli/delete/rspec_job.rb
|
157
|
+
- lib/souls/cli/delete/rspec_manager.rb
|
158
|
+
- lib/souls/cli/delete/rspec_mutation.rb
|
159
|
+
- lib/souls/cli/delete/rspec_policy.rb
|
160
|
+
- lib/souls/cli/delete/rspec_query.rb
|
161
|
+
- lib/souls/cli/delete/rspec_resolver.rb
|
162
|
+
- lib/souls/cli/delete/type.rb
|
163
|
+
- lib/souls/cli/delete/type_rbs.rb
|
142
164
|
- lib/souls/cli/docker/index.rb
|
143
165
|
- lib/souls/cli/gcloud/compute/index.rb
|
144
166
|
- lib/souls/cli/gcloud/iam/index.rb
|
@@ -208,7 +230,7 @@ metadata:
|
|
208
230
|
homepage_uri: https://souls.elsoul.nl
|
209
231
|
source_code_uri: https://github.com/elsoul/souls
|
210
232
|
changelog_uri: https://github.com/elsoul/souls
|
211
|
-
post_install_message:
|
233
|
+
post_install_message:
|
212
234
|
rdoc_options: []
|
213
235
|
require_paths:
|
214
236
|
- lib
|
@@ -224,10 +246,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
224
246
|
version: '0'
|
225
247
|
requirements: []
|
226
248
|
rubygems_version: 3.2.22
|
227
|
-
signing_key:
|
249
|
+
signing_key:
|
228
250
|
specification_version: 4
|
229
|
-
summary:
|
230
|
-
|
231
|
-
development efficiency with CI / CD standard schema-driven Scaffold - Achieve global
|
232
|
-
scale with lower management costs - Rails like Scaffold
|
251
|
+
summary: Build Serverless Apps faster like Rails. Powered by Ruby GraphQL, RBS/Steep,
|
252
|
+
Active Record, RSpec, RuboCop, and Google Cloud.
|
233
253
|
test_files: []
|