souls 0.68.6 → 0.70.1

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.
Files changed (39) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/lib/souls/cli/delete/application.rb +67 -0
  4. data/lib/souls/cli/delete/connection.rb +16 -0
  5. data/lib/souls/cli/delete/connection_rbs.rb +19 -0
  6. data/lib/souls/cli/delete/edge.rb +16 -0
  7. data/lib/souls/cli/delete/edge_rbs.rb +19 -0
  8. data/lib/souls/cli/delete/index.rb +18 -0
  9. data/lib/souls/cli/delete/job.rb +39 -0
  10. data/lib/souls/cli/delete/job_rbs.rb +20 -0
  11. data/lib/souls/cli/delete/manager.rb +20 -0
  12. data/lib/souls/cli/delete/manager_rbs.rb +20 -0
  13. data/lib/souls/cli/delete/mutation.rb +17 -0
  14. data/lib/souls/cli/delete/mutation_rbs.rb +17 -0
  15. data/lib/souls/cli/delete/policy.rb +15 -0
  16. data/lib/souls/cli/delete/policy_rbs.rb +19 -0
  17. data/lib/souls/cli/delete/query.rb +14 -0
  18. data/lib/souls/cli/delete/query_rbs.rb +16 -0
  19. data/lib/souls/cli/delete/resolver.rb +14 -0
  20. data/lib/souls/cli/delete/resolver_rbs.rb +19 -0
  21. data/lib/souls/cli/delete/rspec_factory.rb +13 -0
  22. data/lib/souls/cli/delete/rspec_job.rb +14 -0
  23. data/lib/souls/cli/delete/rspec_manager.rb +15 -0
  24. data/lib/souls/cli/delete/rspec_mutation.rb +14 -0
  25. data/lib/souls/cli/delete/rspec_policy.rb +14 -0
  26. data/lib/souls/cli/delete/rspec_query.rb +14 -0
  27. data/lib/souls/cli/delete/rspec_resolver.rb +14 -0
  28. data/lib/souls/cli/delete/type.rb +14 -0
  29. data/lib/souls/cli/delete/type_rbs.rb +19 -0
  30. data/lib/souls/cli/generate/application.rb +0 -24
  31. data/lib/souls/cli/generate/type.rb +1 -4
  32. data/lib/souls/cli/index.rb +1 -0
  33. data/lib/souls/cli/sync/model.rb +1 -1
  34. data/lib/souls/cli/upgrade/submodule.rb +1 -1
  35. data/lib/souls/cli.rb +4 -0
  36. data/lib/souls/version.rb +1 -1
  37. data/lib/souls/versions/.souls_api_version +1 -1
  38. data/lib/souls/versions/.souls_worker_version +1 -1
  39. metadata +29 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2c82689bc6d741389543a8c4f1a30938f0e517dc784d66e7acc19a7d787c5e2e
4
- data.tar.gz: 96ce10b2a5f6ef62806e9a1933a91bb85d33cf545232be946bce48bb670babb7
3
+ metadata.gz: e3a397035f6d28d12e2a81013b5dcbb7a9ac484017ef2665525e7d7cacdc6dd5
4
+ data.tar.gz: ff6c174834e355ea58a24c86ee6d882441b8c162b644308e07e80dcf23f2a0f4
5
5
  SHA512:
6
- metadata.gz: 39bf1ef6c6e444c7346c5f79494647aa166478019904133ede408aebb2fdb87cf23956c2f78c2ffca6a2d257e4b56eae6abea73ef0c680e891c183e87f628590
7
- data.tar.gz: 16422f4a70febe17b558c89e6acaa366205c5e32a981f9170a099f3bd55f8a24151676bd2791f7a1a17f632678f67831fb4cd866373eba62fa2969d935d749b8
6
+ metadata.gz: ad7b79f92e568270686b946aa3c9e19e2503c555d948d815e1487c744f847d6d736c87aa19b264fe8955176bf29ce17172cba53ae3f9f8281f6eb47458a19df6
7
+ data.tar.gz: b3f5bd8df452a32e85baffe282025ac1388dd6d98e73be73457eaa62199b1724a825d829e22c54873f7b36fecc39fe4a4098bc4acfa4d311b9a41c1704e4bb65
data/README.md CHANGED
@@ -36,7 +36,7 @@ Powered by Ruby GraphQL, RBS/Steep, Active Record, RSpec, RuboCop, and Google Cl
36
36
  ![画像](https://souls.elsoul.nl/imgs/docs/SOULs-architecture.jpg)
37
37
 
38
38
 
39
- SOULs creates 2 types of framework.
39
+ SOULs creates 2 types of APP.
40
40
 
41
41
  1. API - GraphQL (Ruby) - Simple API - Cloud Run
42
42
  2. Worker - Google Pub/Sub Messaging Worker API (Ruby) - Cloud Run
@@ -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")
@@ -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"
@@ -15,7 +15,7 @@ module Souls
15
15
 
16
16
  def cp_and_dl_files(dir: "db")
17
17
  require("#{Souls.get_mother_path}/config/souls")
18
- worker_paths = Souls.configuration.workers.map { |n| n[:name] }
18
+ worker_paths = Souls.configuration.workers.map { |n| n[:name].split("-").last }
19
19
  worker_paths.each do |path|
20
20
  cp_path = "./apps/api/#{dir}"
21
21
  old_path = "./apps/#{path}/#{dir}"
@@ -5,4 +5,4 @@ module Souls
5
5
  system("git submodule update --init https://github.com/ruby/gem_rbs_collection.git vendor/rbs/gem_rbs_collection")
6
6
  end
7
7
  end
8
- end
8
+ end
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,4 +1,4 @@
1
1
  module Souls
2
- VERSION = "0.68.6".freeze
2
+ VERSION = "0.70.1".freeze
3
3
  public_constant :VERSION
4
4
  end
@@ -1 +1 @@
1
- 0.47.6
1
+ 0.49.1
@@ -1 +1 @@
1
- 0.47.6
1
+ 0.49.1
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.68.6
4
+ version: 0.70.1
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-10-06 00:00:00.000000000 Z
13
+ date: 2021-10-11 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activesupport
@@ -134,6 +134,33 @@ files:
134
134
  - lib/souls/cli/db/model.rb
135
135
  - lib/souls/cli/db/model_rbs.rb
136
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
137
164
  - lib/souls/cli/docker/index.rb
138
165
  - lib/souls/cli/gcloud/compute/index.rb
139
166
  - lib/souls/cli/gcloud/iam/index.rb