souls 1.17.3 → 1.18.0
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 +2 -2
- data/lib/souls/app/graphql/souls_connection.rb +2 -2
- data/lib/souls/app/graphql/souls_mutation.rb +5 -5
- data/lib/souls/app/graphql/souls_query.rb +2 -2
- data/lib/souls/app/graphql/types/base_argument.rb +1 -1
- data/lib/souls/app/graphql/types/base_enum.rb +1 -1
- data/lib/souls/app/graphql/types/base_field.rb +2 -2
- data/lib/souls/app/graphql/types/base_input_object.rb +2 -2
- data/lib/souls/app/graphql/types/base_interface.rb +2 -2
- data/lib/souls/app/graphql/types/base_object.rb +3 -3
- data/lib/souls/app/graphql/types/base_scalar.rb +1 -1
- data/lib/souls/app/graphql/types/base_union.rb +1 -1
- data/lib/souls/app/graphql/types/index.rb +1 -1
- data/lib/souls/app/index.rb +1 -1
- data/lib/souls/app/utils/painter.rb +1 -1
- data/lib/souls/app/utils/souls_logger.rb +3 -3
- data/lib/souls/cli/cli_exception.rb +1 -1
- data/lib/souls/cli/console/index.rb +1 -1
- data/lib/souls/cli/create/functions.rb +5 -5
- data/lib/souls/cli/create/index.rb +13 -13
- data/lib/souls/cli/db/create_migration.rb +5 -5
- data/lib/souls/cli/db/create_migration_rbs.rb +3 -3
- data/lib/souls/cli/db/index.rb +2 -2
- data/lib/souls/cli/db/model.rb +2 -2
- data/lib/souls/cli/db/model_rbs.rb +3 -3
- data/lib/souls/cli/db/rspec_model.rb +2 -2
- data/lib/souls/cli/delete/application.rb +3 -3
- data/lib/souls/cli/delete/connection.rb +2 -2
- data/lib/souls/cli/delete/connection_rbs.rb +3 -3
- data/lib/souls/cli/delete/edge.rb +2 -2
- data/lib/souls/cli/delete/edge_rbs.rb +3 -3
- data/lib/souls/cli/delete/index.rb +1 -1
- data/lib/souls/cli/delete/job.rb +4 -4
- data/lib/souls/cli/delete/job_rbs.rb +4 -4
- data/lib/souls/cli/delete/manager.rb +4 -4
- data/lib/souls/cli/delete/manager_rbs.rb +3 -3
- data/lib/souls/cli/delete/migration_file.rb +3 -3
- data/lib/souls/cli/delete/mutation.rb +3 -3
- data/lib/souls/cli/delete/mutation_rbs.rb +3 -3
- data/lib/souls/cli/delete/query.rb +2 -2
- data/lib/souls/cli/delete/query_rbs.rb +3 -3
- data/lib/souls/cli/delete/resolver.rb +2 -2
- data/lib/souls/cli/delete/resolver_rbs.rb +3 -3
- data/lib/souls/cli/delete/rspec_factory.rb +2 -2
- data/lib/souls/cli/delete/rspec_job.rb +2 -2
- data/lib/souls/cli/delete/rspec_manager.rb +2 -2
- data/lib/souls/cli/delete/rspec_mutation.rb +2 -2
- data/lib/souls/cli/delete/rspec_query.rb +2 -2
- data/lib/souls/cli/delete/rspec_resolver.rb +2 -2
- data/lib/souls/cli/delete/type.rb +2 -2
- data/lib/souls/cli/delete/type_rbs.rb +3 -3
- data/lib/souls/cli/docker/index.rb +1 -1
- data/lib/souls/cli/gcloud/compute/index.rb +24 -24
- data/lib/souls/cli/gcloud/functions/index.rb +18 -18
- data/lib/souls/cli/gcloud/iam/index.rb +12 -12
- data/lib/souls/cli/gcloud/index.rb +5 -5
- data/lib/souls/cli/gcloud/pubsub/subscriptions.rb +3 -3
- data/lib/souls/cli/gcloud/pubsub/topics.rb +1 -1
- data/lib/souls/cli/gcloud/run/index.rb +1 -1
- data/lib/souls/cli/gcloud/scheduler/index.rb +4 -4
- data/lib/souls/cli/gcloud/sql/index.rb +17 -17
- data/lib/souls/cli/generate/application.rb +4 -4
- data/lib/souls/cli/generate/connection.rb +2 -2
- data/lib/souls/cli/generate/connection_rbs.rb +3 -3
- data/lib/souls/cli/generate/edge.rb +2 -2
- data/lib/souls/cli/generate/edge_rbs.rb +3 -3
- data/lib/souls/cli/generate/index.rb +1 -1
- data/lib/souls/cli/generate/job.rb +9 -9
- data/lib/souls/cli/generate/job_rbs.rb +4 -4
- data/lib/souls/cli/generate/manager.rb +4 -4
- data/lib/souls/cli/generate/manager_rbs.rb +3 -3
- data/lib/souls/cli/generate/mutation.rb +15 -15
- data/lib/souls/cli/generate/mutation_rbs.rb +17 -17
- data/lib/souls/cli/generate/query.rb +3 -3
- data/lib/souls/cli/generate/query_rbs.rb +3 -3
- data/lib/souls/cli/generate/resolver.rb +8 -8
- data/lib/souls/cli/generate/resolver_rbs.rb +3 -3
- data/lib/souls/cli/generate/rspec_factory.rb +4 -4
- data/lib/souls/cli/generate/rspec_job.rb +4 -4
- data/lib/souls/cli/generate/rspec_manager.rb +3 -3
- data/lib/souls/cli/generate/rspec_mutation.rb +9 -9
- data/lib/souls/cli/generate/rspec_query.rb +7 -7
- data/lib/souls/cli/generate/rspec_resolver.rb +7 -7
- data/lib/souls/cli/generate/type.rb +5 -5
- data/lib/souls/cli/generate/type_rbs.rb +6 -6
- data/lib/souls/cli/github/index.rb +13 -13
- data/lib/souls/cli/index.rb +1 -1
- data/lib/souls/cli/init/index.rb +8 -8
- data/lib/souls/cli/release/release.rb +8 -8
- data/lib/souls/cli/server/index.rb +2 -2
- data/lib/souls/cli/sync/conf.rb +8 -8
- data/lib/souls/cli/sync/model.rb +13 -13
- data/lib/souls/cli/sync/pubsub.rb +9 -9
- data/lib/souls/cli/update/index.rb +2 -2
- data/lib/souls/cli/update/mutation.rb +8 -8
- data/lib/souls/cli/update/mutation_rbs.rb +11 -11
- data/lib/souls/cli/update/resolver.rb +5 -5
- data/lib/souls/cli/update/rspec_factory.rb +4 -4
- data/lib/souls/cli/update/rspec_mutation.rb +5 -5
- data/lib/souls/cli/update/rspec_resolver.rb +4 -4
- data/lib/souls/cli/update/type.rb +4 -4
- data/lib/souls/cli/update/type_rbs.rb +5 -5
- data/lib/souls/cli/upgrade/config.rb +3 -3
- data/lib/souls/cli/upgrade/gemfile.rb +4 -4
- data/lib/souls/cli/upgrade/submodule.rb +1 -1
- data/lib/souls/cli.rb +5 -5
- data/lib/souls/index.rb +1 -1
- data/lib/souls/souls_path.rb +2 -2
- data/lib/souls/utils/index.rb +7 -7
- data/lib/souls/version.rb +2 -2
- data/lib/souls/versions/.souls_api_version +1 -1
- data/lib/souls/versions/.souls_worker_version +1 -1
- data/lib/souls.rb +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5a9005c1b66ccc08bbc1997cbb81addf3489b5410717e88146e345db9fee8ca3
|
4
|
+
data.tar.gz: 2e727f7b8adb1f7b7fa9fac25d1e93e355da3bdcb4240611f2e74c367888b70c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 23bd0953ff05075cd6424540d7eaf71d91a62e253f03d0a54a248d78df7d4b0c41f004ee1821c3ed61e7075cd6e7788fdc804c8345aa53d50aa28cf8003a3ad5
|
7
|
+
data.tar.gz: 4105a106fc7fac76f6786490ea8115429a416957831458f1f5c0b85f5deb82686974a7e8bb7dd1fbb9caa830e1a3ca92fbf79a5d0a48ec7559e56349398b1373
|
data/README.md
CHANGED
@@ -145,4 +145,4 @@ The gem is available as open source under the terms of the [Apache-2.0 License](
|
|
145
145
|
|
146
146
|
## Code of Conduct
|
147
147
|
|
148
|
-
Everyone interacting in the
|
148
|
+
Everyone interacting in the SOULs project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/elsoul/souls/blob/master/CODE_OF_CONDUCT.md).
|
data/exe/souls
CHANGED
@@ -3,7 +3,7 @@ require "souls"
|
|
3
3
|
require "thor"
|
4
4
|
begin
|
5
5
|
souls_command = ARGV[0]
|
6
|
-
require(
|
6
|
+
require(SOULs.get_mother_path.to_s + "/config/souls") unless [
|
7
7
|
"new",
|
8
8
|
"docker",
|
9
9
|
"-v",
|
@@ -15,4 +15,4 @@ rescue StandardError
|
|
15
15
|
raise(StandardError, "No config! Please make `./config/souls.rb` File!")
|
16
16
|
end
|
17
17
|
|
18
|
-
|
18
|
+
SOULs::CLI.start
|
@@ -1,5 +1,5 @@
|
|
1
|
-
module
|
2
|
-
class
|
1
|
+
module SOULs
|
2
|
+
class SOULsMutation < GraphQL::Schema::RelayClassicMutation
|
3
3
|
def souls_fb_auth(token:)
|
4
4
|
FirebaseIdToken::Certificates.request!
|
5
5
|
sleep(3) if ENV["RACK_ENV"] == "development"
|
@@ -34,15 +34,15 @@ module Souls
|
|
34
34
|
end
|
35
35
|
|
36
36
|
def post_to_dev(worker_name: "", query_string: "")
|
37
|
-
app =
|
37
|
+
app = SOULs.configuration.app
|
38
38
|
port = get_worker(worker_name: "souls-#{app}-#{worker_name}")[0][:port]
|
39
|
-
endpoint =
|
39
|
+
endpoint = SOULs.configuration.endpoint
|
40
40
|
res = Net::HTTP.post_form(URI.parse("http://localhost:#{port}#{endpoint}"), { query: query_string })
|
41
41
|
res.body
|
42
42
|
end
|
43
43
|
|
44
44
|
def get_worker(worker_name: "")
|
45
|
-
workers =
|
45
|
+
workers = SOULs.configuration.workers
|
46
46
|
workers.filter { |n| n[:name] == worker_name }
|
47
47
|
end
|
48
48
|
|
@@ -1,8 +1,8 @@
|
|
1
|
-
module
|
1
|
+
module SOULs
|
2
2
|
module Types
|
3
3
|
class BaseObject < GraphQL::Schema::Object
|
4
|
-
field_class
|
5
|
-
connection_type_class
|
4
|
+
field_class SOULs::Types::BaseField
|
5
|
+
connection_type_class SOULs::SOULsConnection
|
6
6
|
end
|
7
7
|
end
|
8
8
|
end
|
data/lib/souls/app/index.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
module
|
2
|
-
module
|
1
|
+
module SOULs
|
2
|
+
module SOULsLogger
|
3
3
|
class Configuration
|
4
4
|
attr_accessor :logger
|
5
5
|
|
@@ -47,7 +47,7 @@ module Souls
|
|
47
47
|
entry.log_name = "error"
|
48
48
|
entry.resource.type = "cloud_run_revision"
|
49
49
|
entry.resource.labels[:service_name] = "souls"
|
50
|
-
entry.resource.labels[:revision_name] =
|
50
|
+
entry.resource.labels[:revision_name] = SOULs::VERSION
|
51
51
|
|
52
52
|
entry
|
53
53
|
end
|
@@ -1,10 +1,10 @@
|
|
1
1
|
require_relative "./templates/functions_env_yaml"
|
2
2
|
|
3
|
-
Dir["#{
|
3
|
+
Dir["#{SOULs::SOULS_PATH}/lib/souls/cli/create/templates/*/*.rb"].map do |f|
|
4
4
|
require f
|
5
5
|
end
|
6
6
|
|
7
|
-
module
|
7
|
+
module SOULs
|
8
8
|
class Create < Thor
|
9
9
|
desc "functions [name]", "Create SOULs functions"
|
10
10
|
def functions(function_name)
|
@@ -44,7 +44,7 @@ module Souls
|
|
44
44
|
end
|
45
45
|
file_name = file_dir.gsub("./apps/", "")
|
46
46
|
File.write(file_path, Object.const_get("Template::#{runtime}").__send__(method, file_name))
|
47
|
-
|
47
|
+
SOULs::Painter.create_file(file_path)
|
48
48
|
end
|
49
49
|
create_env_yaml(file_dir: file_dir)
|
50
50
|
end
|
@@ -57,12 +57,12 @@ module Souls
|
|
57
57
|
raise(StandardError, "Already Exist!") if File.exist?(file_path)
|
58
58
|
|
59
59
|
File.write(file_path, Template.functions_env_yaml)
|
60
|
-
|
60
|
+
SOULs::Painter.create_file(file_path)
|
61
61
|
file_path
|
62
62
|
end
|
63
63
|
|
64
64
|
def get_runtime_create_method(runtime:)
|
65
|
-
Dir["#{
|
65
|
+
Dir["#{SOULs::SOULS_PATH}/lib/souls/cli/create/templates/#{runtime}/*"].map do |n|
|
66
66
|
n.split("/").last.gsub(".rb", "")
|
67
67
|
end
|
68
68
|
end
|
@@ -1,16 +1,16 @@
|
|
1
1
|
require_relative "./functions"
|
2
|
-
module
|
2
|
+
module SOULs
|
3
3
|
class Create < Thor
|
4
4
|
desc "worker [name]", "Create SOULs Worker"
|
5
5
|
def worker(name)
|
6
|
-
require("#{
|
7
|
-
Dir.chdir(
|
6
|
+
require("#{SOULs.get_mother_path}/config/souls")
|
7
|
+
Dir.chdir(SOULs.get_mother_path.to_s) do
|
8
8
|
worker_name = "worker-#{name}"
|
9
9
|
file_dir = "apps/worker-#{name}"
|
10
10
|
raise(StandardError, "Same Worker Already Exist!") if Dir.exist?(file_dir)
|
11
11
|
|
12
|
-
workers =
|
13
|
-
app =
|
12
|
+
workers = SOULs.configuration.workers
|
13
|
+
app = SOULs.configuration.app
|
14
14
|
port = 3000 + workers.size
|
15
15
|
souls_worker_name = "souls-#{app}-#{worker_name}"
|
16
16
|
download_worker(worker_name: worker_name)
|
@@ -64,7 +64,7 @@ module Souls
|
|
64
64
|
end
|
65
65
|
|
66
66
|
def souls_conf_update(worker_name: "worker-mailer", strain: "mother")
|
67
|
-
workers =
|
67
|
+
workers = SOULs.configuration.workers
|
68
68
|
port = 3000 + workers.size
|
69
69
|
file_path = strain == "mother" ? "config/souls.rb" : "apps/api/config/souls.rb"
|
70
70
|
|
@@ -206,20 +206,20 @@ end
|
|
206
206
|
--set-env-vars="SOULS_PROJECT_ID=${{ secrets.SOULS_GCP_PROJECT_ID }}"
|
207
207
|
TEXT
|
208
208
|
end
|
209
|
-
|
209
|
+
SOULs::Painter.create_file(file_path.to_s)
|
210
210
|
file_path
|
211
211
|
end
|
212
212
|
|
213
213
|
def souls_config_init(worker_name: "worker-mailer")
|
214
|
-
app_name =
|
215
|
-
project_id =
|
214
|
+
app_name = SOULs.configuration.app
|
215
|
+
project_id = SOULs.configuration.project_id
|
216
216
|
config_dir = "apps/#{worker_name}/config"
|
217
217
|
FileUtils.mkdir_p(config_dir) unless Dir.exist?(config_dir)
|
218
218
|
FileUtils.touch("#{config_dir}/souls.rb")
|
219
219
|
file_path = "#{config_dir}/souls.rb"
|
220
220
|
File.open(file_path, "w") do |f|
|
221
221
|
f.write(<<~TEXT)
|
222
|
-
|
222
|
+
SOULs.configure do |config|
|
223
223
|
config.app = "#{app_name}"
|
224
224
|
config.project_id = "#{project_id}"
|
225
225
|
config.region = "asia-northeast1"
|
@@ -238,7 +238,7 @@ end
|
|
238
238
|
file_path = "#{file_dir}/souls_helper.rbs"
|
239
239
|
File.open(file_path, "w") do |f|
|
240
240
|
f.write(<<~TEXT)
|
241
|
-
module
|
241
|
+
module SOULsHelper
|
242
242
|
def self.export_csv: (untyped model_name) -> (String? | StandardError )
|
243
243
|
def self.export_model_to_csv: (untyped model_name) -> (untyped | StandardError )
|
244
244
|
def self.upload_to_gcs: (String file_path, String upload_path) -> untyped
|
@@ -274,7 +274,7 @@ end
|
|
274
274
|
end
|
275
275
|
|
276
276
|
def download_worker(worker_name: "worker-mailer")
|
277
|
-
version =
|
277
|
+
version = SOULs.get_latest_version_txt(service_name: "worker").join(".")
|
278
278
|
file_name = "worker-v#{version}.tgz"
|
279
279
|
url = "https://storage.googleapis.com/souls-bucket/boilerplates/workers/#{file_name}"
|
280
280
|
puts(url)
|
@@ -305,7 +305,7 @@ end
|
|
305
305
|
puts(line)
|
306
306
|
welcome = Paint["SOULs Worker is Ready!", :white]
|
307
307
|
puts(welcome)
|
308
|
-
souls_ver = Paint["SOULs Version: #{
|
308
|
+
souls_ver = Paint["SOULs Version: #{SOULs::VERSION}", :white]
|
309
309
|
puts(souls_ver)
|
310
310
|
puts(line)
|
311
311
|
endroll = <<~TEXT
|
@@ -1,13 +1,13 @@
|
|
1
|
-
module
|
1
|
+
module SOULs
|
2
2
|
class DB < Thor
|
3
3
|
desc "create_migration [CLASS_NAME]", "Create ActiveRecord Migration File"
|
4
4
|
def create_migration(class_name)
|
5
5
|
pluralized_class_name = class_name.underscore.pluralize
|
6
6
|
singularized_class_name = class_name.underscore.singularize
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
7
|
+
SOULs::DB.new.invoke(:model, [singularized_class_name], {})
|
8
|
+
SOULs::DB.new.invoke(:rspec_model, [singularized_class_name], {})
|
9
|
+
SOULs::DB.new.invoke(:model_rbs, [singularized_class_name], {})
|
10
|
+
SOULs::Painter.create_file("")
|
11
11
|
system("rake db:create_migration NAME=create_#{pluralized_class_name}")
|
12
12
|
file_path = Dir["db/migrate/*create_#{pluralized_class_name}.rb"].first
|
13
13
|
File.open(file_path, "w") do |f|
|
@@ -1,9 +1,9 @@
|
|
1
|
-
module
|
1
|
+
module SOULs
|
2
2
|
class DB < Thor
|
3
3
|
desc "create_migration_rbs [CLASS_NAME]", "Generate ActiveRecord Migration's RBS Template"
|
4
4
|
def create_migration_rbs(class_name)
|
5
5
|
file_path = ""
|
6
|
-
Dir.chdir(
|
6
|
+
Dir.chdir(SOULs.get_mother_path.to_s) do
|
7
7
|
file_dir = "./sig/api/db/migrate"
|
8
8
|
FileUtils.mkdir_p(file_dir) unless Dir.exist?(file_dir)
|
9
9
|
pluralized_class_name = class_name.underscore.pluralize
|
@@ -17,7 +17,7 @@ module Souls
|
|
17
17
|
end
|
18
18
|
TEXT
|
19
19
|
end
|
20
|
-
|
20
|
+
SOULs::Painter.create_file(file_path.to_s)
|
21
21
|
end
|
22
22
|
file_path
|
23
23
|
end
|
data/lib/souls/cli/db/index.rb
CHANGED
@@ -5,7 +5,7 @@ require_relative "./rspec_model"
|
|
5
5
|
require_relative "./model_rbs"
|
6
6
|
require_relative "../cli_exception"
|
7
7
|
|
8
|
-
module
|
8
|
+
module SOULs
|
9
9
|
class DB < Thor
|
10
10
|
desc "migrate", "Migrate Database"
|
11
11
|
method_option :env, aliases: "--e", default: "development", desc: "Difine APP Enviroment - development | production"
|
@@ -102,7 +102,7 @@ module Souls
|
|
102
102
|
private
|
103
103
|
|
104
104
|
def db_system(cmd)
|
105
|
-
system(cmd) or
|
105
|
+
system(cmd) or SOULs::Painter.error("DB is not running. Please run `souls docker psql`")
|
106
106
|
end
|
107
107
|
end
|
108
108
|
end
|
data/lib/souls/cli/db/model.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
module
|
1
|
+
module SOULs
|
2
2
|
class DB < Thor
|
3
3
|
desc "model [CLASS_NAME]", "Generate Model Template"
|
4
4
|
def model(class_name)
|
@@ -13,7 +13,7 @@ module Souls
|
|
13
13
|
end
|
14
14
|
TEXT
|
15
15
|
end
|
16
|
-
|
16
|
+
SOULs::Painter.create_file(file_path.to_s)
|
17
17
|
file_path
|
18
18
|
end
|
19
19
|
end
|
@@ -1,9 +1,9 @@
|
|
1
|
-
module
|
1
|
+
module SOULs
|
2
2
|
class DB < Thor
|
3
3
|
desc "model_rbs [CLASS_NAME]", "Generate GraphQL Model RBS from schema.rb"
|
4
4
|
def model_rbs(class_name)
|
5
5
|
file_path = ""
|
6
|
-
Dir.chdir(
|
6
|
+
Dir.chdir(SOULs.get_mother_path.to_s) do
|
7
7
|
file_dir = "./sig/api/app/models/"
|
8
8
|
FileUtils.mkdir_p(file_dir) unless Dir.exist?(file_dir)
|
9
9
|
singularized_class_name = class_name.underscore.singularize
|
@@ -14,7 +14,7 @@ module Souls
|
|
14
14
|
end
|
15
15
|
TEXT
|
16
16
|
end
|
17
|
-
|
17
|
+
SOULs::Painter.create_file(file_path.to_s)
|
18
18
|
end
|
19
19
|
file_path
|
20
20
|
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
module
|
1
|
+
module SOULs
|
2
2
|
class DB < Thor
|
3
3
|
desc "rspec_model [CLASS_NAME]", "Generate Rspec Model Test from schema.rb"
|
4
4
|
def rspec_model(class_name)
|
@@ -18,7 +18,7 @@ module Souls
|
|
18
18
|
end
|
19
19
|
TEXT
|
20
20
|
end
|
21
|
-
|
21
|
+
SOULs::Painter.create_file(file_path.to_s)
|
22
22
|
file_path
|
23
23
|
end
|
24
24
|
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
module
|
1
|
+
module SOULs
|
2
2
|
class Delete < Thor
|
3
3
|
desc "scaffold [CLASS_NAME]", "Delete Scaffold"
|
4
4
|
method_option :rbs, type: :boolean, aliases: "--rbs", default: false, desc: "Deletes Only RBS Files"
|
@@ -16,8 +16,8 @@ module Souls
|
|
16
16
|
method_option :rbs, type: :boolean, aliases: "--rbs", default: false, desc: "Deletes Only RBS Files"
|
17
17
|
def scaffold_all
|
18
18
|
puts(Paint["Delete All Scaffold Files!\n", :cyan])
|
19
|
-
|
20
|
-
|
19
|
+
SOULs.get_tables.each do |table|
|
20
|
+
SOULs::Delete.new.invoke(:scaffold, [table.singularize], { rbs: options[:rbs] })
|
21
21
|
end
|
22
22
|
true
|
23
23
|
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
module
|
1
|
+
module SOULs
|
2
2
|
class Delete < Thor
|
3
3
|
desc "connection [CLASS_NAME]", "Delete GraphQL Connection"
|
4
4
|
def connection(class_name)
|
@@ -6,7 +6,7 @@ module Souls
|
|
6
6
|
singularized_class_name = class_name.underscore.singularize
|
7
7
|
file_path = "#{file_dir}#{singularized_class_name}_connection.rb"
|
8
8
|
FileUtils.rm_f(file_path)
|
9
|
-
|
9
|
+
SOULs::Painter.delete_file(file_path)
|
10
10
|
file_path
|
11
11
|
end
|
12
12
|
end
|
@@ -1,14 +1,14 @@
|
|
1
|
-
module
|
1
|
+
module SOULs
|
2
2
|
class Delete < Thor
|
3
3
|
desc "connection_rbs [CLASS_NAME]", "Delete GraphQL Connection RBS"
|
4
4
|
def connection_rbs(class_name)
|
5
5
|
file_path = ""
|
6
|
-
Dir.chdir(
|
6
|
+
Dir.chdir(SOULs.get_mother_path.to_s) do
|
7
7
|
singularized_class_name = class_name.underscore.singularize
|
8
8
|
file_dir = "./sig/api/app/graphql/types/connections/"
|
9
9
|
file_path = "#{file_dir}#{singularized_class_name}_connection.rbs"
|
10
10
|
FileUtils.rm_f(file_path)
|
11
|
-
|
11
|
+
SOULs::Painter.delete_file(file_path.to_s)
|
12
12
|
end
|
13
13
|
file_path
|
14
14
|
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
module
|
1
|
+
module SOULs
|
2
2
|
class Delete < Thor
|
3
3
|
desc "edge [CLASS_NAME]", "Delete GraphQL Edge"
|
4
4
|
def edge(class_name)
|
@@ -6,7 +6,7 @@ module Souls
|
|
6
6
|
singularized_class_name = class_name.underscore.singularize
|
7
7
|
file_path = "#{file_dir}#{singularized_class_name}_edge.rb"
|
8
8
|
FileUtils.rm_f(file_path)
|
9
|
-
|
9
|
+
SOULs::Painter.delete_file(file_path.to_s)
|
10
10
|
file_path
|
11
11
|
end
|
12
12
|
end
|
@@ -1,13 +1,13 @@
|
|
1
|
-
module
|
1
|
+
module SOULs
|
2
2
|
class Delete < Thor
|
3
3
|
desc "edge_rbs [CLASS_NAME]", "Delete GraphQL Edge RBS"
|
4
4
|
def edge_rbs(class_name)
|
5
|
-
Dir.chdir(
|
5
|
+
Dir.chdir(SOULs.get_mother_path.to_s) do
|
6
6
|
file_dir = "./sig/api/app/graphql/types/edges/"
|
7
7
|
singularized_class_name = class_name.underscore.singularize
|
8
8
|
file_path = "#{file_dir}#{singularized_class_name}_edge.rbs"
|
9
9
|
FileUtils.rm_f(file_path)
|
10
|
-
|
10
|
+
SOULs::Painter.delete_file(file_path)
|
11
11
|
file_path
|
12
12
|
end
|
13
13
|
end
|
data/lib/souls/cli/delete/job.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
module
|
1
|
+
module SOULs
|
2
2
|
class Delete < Thor
|
3
3
|
desc "job [CLASS_NAME]", "Delete Job File in Worker"
|
4
4
|
method_option :mailer, type: :boolean, aliases: "--mailer", default: false, desc: "Mailer Option"
|
@@ -7,9 +7,9 @@ module Souls
|
|
7
7
|
file_path = "#{file_dir}#{class_name.singularize}.rb"
|
8
8
|
|
9
9
|
FileUtils.rm_f(file_path)
|
10
|
-
|
11
|
-
|
12
|
-
|
10
|
+
SOULs::Painter.delete_file(file_path.to_s)
|
11
|
+
SOULs::Delete.new.invoke(:job_rbs, [class_name], {})
|
12
|
+
SOULs::Delete.new.invoke(:rspec_job, [class_name], {})
|
13
13
|
end
|
14
14
|
end
|
15
15
|
end
|
@@ -1,20 +1,20 @@
|
|
1
|
-
module
|
1
|
+
module SOULs
|
2
2
|
class Delete < Thor
|
3
3
|
desc "job_rbs [CLASS_NAME]", "Delete SOULs Job Mutation RBS Template"
|
4
4
|
def job_rbs(class_name)
|
5
5
|
file_path = ""
|
6
6
|
worker_name = FileUtils.pwd.split("/").last
|
7
7
|
if worker_name == "api" || FileUtils.pwd.split("/")[-2] != "apps"
|
8
|
-
raise(
|
8
|
+
raise(SOULs::CLIException, "This task must be run from within a worker directory")
|
9
9
|
end
|
10
10
|
|
11
|
-
Dir.chdir(
|
11
|
+
Dir.chdir(SOULs.get_mother_path.to_s) do
|
12
12
|
singularized_class_name = class_name.underscore.singularize
|
13
13
|
file_dir = "./sig/#{worker_name}/app/graphql/queries/"
|
14
14
|
FileUtils.mkdir_p(file_dir) unless Dir.exist?(file_dir)
|
15
15
|
file_path = "#{file_dir}#{singularized_class_name}.rbs"
|
16
16
|
FileUtils.rm_f(file_path)
|
17
|
-
|
17
|
+
SOULs::Painter.delete_file(file_path.to_s)
|
18
18
|
end
|
19
19
|
file_path
|
20
20
|
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
module
|
1
|
+
module SOULs
|
2
2
|
class Delete < Thor
|
3
3
|
desc "manager [MANAGER_NAME]", "Delete GraphQL Mutation Template"
|
4
4
|
method_option :mutation, aliases: "--mutation", required: true, desc: "Mutation File Name"
|
@@ -8,9 +8,9 @@ module Souls
|
|
8
8
|
file_path = "#{file_dir}/#{options[:mutation]}.rb"
|
9
9
|
|
10
10
|
FileUtils.rm_f(file_path)
|
11
|
-
|
12
|
-
|
13
|
-
|
11
|
+
SOULs::Painter.delete_file(file_path.to_s)
|
12
|
+
SOULs::Delete.new.invoke(:manager_rbs, [singularized_class_name], { mutation: options[:mutation] })
|
13
|
+
SOULs::Delete.new.invoke(:rspec_manager, [singularized_class_name], { mutation: options[:mutation] })
|
14
14
|
file_path
|
15
15
|
end
|
16
16
|
end
|
@@ -1,15 +1,15 @@
|
|
1
|
-
module
|
1
|
+
module SOULs
|
2
2
|
class Delete < Thor
|
3
3
|
desc "manager_rbs [CLASS_NAME]", "Delete SOULs Manager RBS Template"
|
4
4
|
method_option :mutation, aliases: "--mutation", required: true, desc: "Mutation File Name"
|
5
5
|
def manager_rbs(class_name)
|
6
6
|
file_path = ""
|
7
7
|
singularized_class_name = class_name.underscore.singularize
|
8
|
-
Dir.chdir(
|
8
|
+
Dir.chdir(SOULs.get_mother_path.to_s) do
|
9
9
|
file_dir = "./sig/api/app/graphql/mutations/managers/#{singularized_class_name}_manager"
|
10
10
|
file_path = "#{file_dir}/#{options[:mutation]}.rbs"
|
11
11
|
FileUtils.rm_f(file_path)
|
12
|
-
|
12
|
+
SOULs::Painter.delete_file(file_path.to_s)
|
13
13
|
end
|
14
14
|
file_path
|
15
15
|
end
|