souls 1.4.4 → 1.4.8
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 +3 -0
- data/lib/souls/cli/create/index.rb +19 -19
- data/lib/souls/cli/gcloud/compute/index.rb +1 -1
- data/lib/souls/cli/gcloud/iam/index.rb +1 -1
- data/lib/souls/cli/gcloud/sql/index.rb +4 -3
- data/lib/souls/cli/generate/mutation.rb +8 -8
- data/lib/souls/cli/generate/mutation_rbs.rb +5 -5
- data/lib/souls/cli/update/mutation.rb +6 -6
- 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 +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f08c7ec99a1de1b84996141a2ac4c47955f116d97e868bca9e555e61a3d5cf42
|
4
|
+
data.tar.gz: c92858cdab4dc6ee344340df0c8f76fad89d307e127c11271af81f33b38a994c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 189723b20b0400449b4969f113f6f2c6699d6b1b3fa7997aa1d7b55524f7cb8947d42e063f72992cf7a5793b6f3399e9eab4a88cf35fa8637c2573f5c270d920
|
7
|
+
data.tar.gz: 7d3be8283464cb5d4196cc34d2207326ab8fde1e3ac9cb24c2a676ef101d7cf9c06704a6b930c40141e9cee1620978abdaf160e3fe0a682a95e1dae8adbb4592
|
data/README.md
CHANGED
@@ -4,6 +4,9 @@
|
|
4
4
|
<a aria-label="Ruby logo" href="https://el-soul.com">
|
5
5
|
<img src="https://badgen.net/badge/icon/Made%20by%20ELSOUL?icon=ruby&label&color=black&labelColor=black">
|
6
6
|
</a>
|
7
|
+
<a href="https://twitter.com/intent/follow?screen_name=SOULsOpenSource">
|
8
|
+
<img src="https://img.shields.io/twitter/follow/SOULsOpenSource.svg?label=Follow%20@SOULsOpenSource" alt="Follow @SOULsOpenSource" />
|
9
|
+
</a>
|
7
10
|
<br/>
|
8
11
|
|
9
12
|
<a aria-label="Ruby Gem version" href="https://rubygems.org/gems/souls">
|
@@ -12,24 +12,24 @@ module Souls
|
|
12
12
|
app = Souls.configuration.app
|
13
13
|
port = 3000 + workers.size
|
14
14
|
souls_worker_name = "souls-#{app}-#{options[:name]}"
|
15
|
-
download_worker(options[:name])
|
16
|
-
souls_conf_update(souls_worker_name)
|
17
|
-
souls_conf_update(souls_worker_name, "api")
|
18
|
-
workflow(options[:name])
|
19
|
-
procfile(options[:name], port)
|
20
|
-
mother_procfile(options[:name])
|
21
|
-
souls_config_init(options[:name])
|
22
|
-
steepfile(options[:name])
|
23
|
-
souls_helper_rbs(options[:name])
|
15
|
+
download_worker(worker_name: options[:name])
|
16
|
+
souls_conf_update(worker_name: souls_worker_name)
|
17
|
+
souls_conf_update(worker_name: souls_worker_name, strain: "api")
|
18
|
+
workflow(worker_name: options[:name])
|
19
|
+
procfile(worker_name: options[:name], port: port)
|
20
|
+
mother_procfile(worker_name: options[:name])
|
21
|
+
souls_config_init(worker_name: options[:name])
|
22
|
+
steepfile(worker_name: options[:name])
|
23
|
+
souls_helper_rbs(worker_name: options[:name])
|
24
24
|
system("cd apps/#{options[:name]} && bundle")
|
25
|
-
souls_worker_credit(options[:name])
|
25
|
+
souls_worker_credit(worker_name: options[:name])
|
26
26
|
end
|
27
27
|
true
|
28
28
|
end
|
29
29
|
|
30
30
|
private
|
31
31
|
|
32
|
-
def steepfile(worker_name)
|
32
|
+
def steepfile(worker_name: "mailer")
|
33
33
|
file_path = "./Steepfile"
|
34
34
|
|
35
35
|
write_txt = ""
|
@@ -48,21 +48,21 @@ module Souls
|
|
48
48
|
File.open(file_path, "w") { |f| f.write(write_txt) }
|
49
49
|
end
|
50
50
|
|
51
|
-
def procfile(worker_name, port)
|
51
|
+
def procfile(worker_name: "mailer", port: 123)
|
52
52
|
file_path = "apps/#{worker_name}/Procfile.dev"
|
53
53
|
File.open(file_path, "w") do |f|
|
54
54
|
f.write("#{worker_name}: bundle exec puma -p #{port} -e development")
|
55
55
|
end
|
56
56
|
end
|
57
57
|
|
58
|
-
def mother_procfile(worker_name)
|
58
|
+
def mother_procfile(worker_name: "mailer")
|
59
59
|
file_path = "Procfile.dev"
|
60
60
|
File.open(file_path, "a") do |f|
|
61
61
|
f.write("\n#{worker_name}: foreman start -f ./apps/#{worker_name}/Procfile.dev")
|
62
62
|
end
|
63
63
|
end
|
64
64
|
|
65
|
-
def souls_conf_update(worker_name, strain
|
65
|
+
def souls_conf_update(worker_name: "mailer", strain: "mother")
|
66
66
|
workers = Souls.configuration.workers
|
67
67
|
port = 3000 + workers.size
|
68
68
|
file_path = strain == "mother" ? "config/souls.rb" : "apps/api/config/souls.rb"
|
@@ -104,7 +104,7 @@ end
|
|
104
104
|
File.open(file_path, "w") { |f| f.write(write_txt) }
|
105
105
|
end
|
106
106
|
|
107
|
-
def workflow(worker_name)
|
107
|
+
def workflow(worker_name: "mailer")
|
108
108
|
file_dir = ".github/workflows"
|
109
109
|
FileUtils.mkdir_p(file_dir) unless Dir.exist?(file_dir)
|
110
110
|
file_path = "#{file_dir}/#{worker_name}.yml"
|
@@ -204,7 +204,7 @@ end
|
|
204
204
|
file_path
|
205
205
|
end
|
206
206
|
|
207
|
-
def souls_config_init(worker_name)
|
207
|
+
def souls_config_init(worker_name: "mailer")
|
208
208
|
app_name = Souls.configuration.app
|
209
209
|
project_id = Souls.configuration.project_id
|
210
210
|
config_dir = "apps/#{worker_name}/config"
|
@@ -228,7 +228,7 @@ end
|
|
228
228
|
puts(e)
|
229
229
|
end
|
230
230
|
|
231
|
-
def souls_helper_rbs(worker_name)
|
231
|
+
def souls_helper_rbs(worker_name: "mailer")
|
232
232
|
file_dir = "./sig/#{worker_name}/app/utils"
|
233
233
|
FileUtils.mkdir_p(file_dir) unless Dir.exist?(file_dir)
|
234
234
|
file_path = "#{file_dir}/souls_helper.rbs"
|
@@ -269,7 +269,7 @@ end
|
|
269
269
|
end
|
270
270
|
end
|
271
271
|
|
272
|
-
def download_worker(worker_name)
|
272
|
+
def download_worker(worker_name: "mailer")
|
273
273
|
version = Souls.get_latest_version_txt(service_name: "worker").join(".")
|
274
274
|
file_name = "worker-v#{version}.tgz"
|
275
275
|
url = "https://storage.googleapis.com/souls-bucket/boilerplates/workers/#{file_name}"
|
@@ -280,7 +280,7 @@ end
|
|
280
280
|
FileUtils.rm(file_name)
|
281
281
|
end
|
282
282
|
|
283
|
-
def souls_worker_credit(worker_name)
|
283
|
+
def souls_worker_credit(worker_name: "mailer")
|
284
284
|
line = Paint["====================================", :yellow]
|
285
285
|
puts("\n")
|
286
286
|
puts(line)
|
@@ -2,9 +2,10 @@ module Souls
|
|
2
2
|
class Sql < Thor
|
3
3
|
desc "create_instance", "Create Google Cloud SQL - PostgreSQL13"
|
4
4
|
method_option :region, default: "", aliases: "--region", desc: "Google Cloud Platform Region"
|
5
|
-
method_option :root_password, default: "", aliases: "--root-password", desc: "Set Cloud SQL Root Password"
|
6
5
|
method_option :mysql, type: :boolean, default: false, aliases: "--mysql", desc: "Set Cloud SQL Type to MySQL"
|
7
6
|
def create_instance
|
7
|
+
prompt = TTY::Prompt.new
|
8
|
+
password = prompt.mask("Set DB PassWord:")
|
8
9
|
app_name = Souls.configuration.app
|
9
10
|
project_id = Souls.configuration.project_id
|
10
11
|
instance_name = Souls.configuration.instance_name if instance_name.blank?
|
@@ -15,14 +16,14 @@ module Souls
|
|
15
16
|
system(
|
16
17
|
"gcloud sql instances create #{instance_name} \
|
17
18
|
--database-version=#{db_type} --cpu=1 --memory=3750MB --zone=#{zone} \
|
18
|
-
--root-password='#{
|
19
|
+
--root-password='#{password}' --database-flags cloudsql.iam_authentication=on"
|
19
20
|
)
|
20
21
|
Dir.chdir(Souls.get_api_path.to_s) do
|
21
22
|
file_path = ".env"
|
22
23
|
File.open(file_path, "w") do |line|
|
23
24
|
line.write(<<~TEXT)
|
24
25
|
SOULS_DB_HOST=#{get_sql_ip.strip}
|
25
|
-
SOULS_DB_PW=#{
|
26
|
+
SOULS_DB_PW=#{password}
|
26
27
|
SOULS_DB_USER=postgres
|
27
28
|
SOULS_GCP_PROJECT_ID=#{project_id}
|
28
29
|
SOULS_SECRET_KEY_BASE="#{SecureRandom.base64(64)}"
|
@@ -10,10 +10,10 @@ module Souls
|
|
10
10
|
file_path = "./app/graphql/mutations/base/#{singularized_class_name}/create_#{singularized_class_name}.rb"
|
11
11
|
return "Mutation already exist! #{file_path}" if File.exist?(file_path)
|
12
12
|
|
13
|
-
create_mutation(singularized_class_name)
|
14
|
-
update_mutation(singularized_class_name)
|
15
|
-
delete_mutation(singularized_class_name)
|
16
|
-
destroy_delete_mutation(singularized_class_name)
|
13
|
+
create_mutation(class_name: singularized_class_name)
|
14
|
+
update_mutation(class_name: singularized_class_name)
|
15
|
+
delete_mutation(class_name: singularized_class_name)
|
16
|
+
destroy_delete_mutation(class_name: singularized_class_name)
|
17
17
|
end
|
18
18
|
rescue Thor::Error => e
|
19
19
|
raise(Thor::Error, e)
|
@@ -21,7 +21,7 @@ module Souls
|
|
21
21
|
|
22
22
|
private
|
23
23
|
|
24
|
-
def create_mutation(class_name)
|
24
|
+
def create_mutation(class_name: "user")
|
25
25
|
singularized_class_name = class_name.singularize.underscore
|
26
26
|
file_dir = "./app/graphql/mutations/base/#{singularized_class_name}"
|
27
27
|
FileUtils.mkdir_p(file_dir) unless Dir.exist?(file_dir)
|
@@ -91,7 +91,7 @@ module Souls
|
|
91
91
|
file_path
|
92
92
|
end
|
93
93
|
|
94
|
-
def update_mutation(class_name)
|
94
|
+
def update_mutation(class_name: "user")
|
95
95
|
singularized_class_name = class_name.singularize.underscore
|
96
96
|
file_dir = "./app/graphql/mutations/base/#{singularized_class_name}"
|
97
97
|
FileUtils.mkdir_p(file_dir) unless Dir.exist?(file_dir)
|
@@ -165,7 +165,7 @@ module Souls
|
|
165
165
|
end
|
166
166
|
|
167
167
|
# 3. Mutation - Delete
|
168
|
-
def delete_mutation(class_name)
|
168
|
+
def delete_mutation(class_name: "user")
|
169
169
|
file_path = "./app/graphql/mutations/base/#{class_name}/delete_#{class_name}.rb"
|
170
170
|
return "Mutation already exist! #{file_path}" if File.exist?(file_path)
|
171
171
|
|
@@ -195,7 +195,7 @@ module Souls
|
|
195
195
|
end
|
196
196
|
|
197
197
|
# 4. Mutation - Destroy Delete
|
198
|
-
def destroy_delete_mutation(class_name)
|
198
|
+
def destroy_delete_mutation(class_name: "user")
|
199
199
|
file_path = "./app/graphql/mutations/base/#{class_name}/destroy_delete_#{class_name}.rb"
|
200
200
|
return "Mutation already exist! #{file_path}" if File.exist?(file_path)
|
201
201
|
|
@@ -13,7 +13,7 @@ module Souls
|
|
13
13
|
|
14
14
|
private
|
15
15
|
|
16
|
-
def create_rbs_mutation(class_name)
|
16
|
+
def create_rbs_mutation(class_name: "user")
|
17
17
|
file_path = ""
|
18
18
|
Dir.chdir(Souls.get_mother_path.to_s) do
|
19
19
|
file_dir = "./sig/api/app/graphql/mutations/base/#{class_name}"
|
@@ -96,14 +96,14 @@ module Souls
|
|
96
96
|
raise(Thor::Error, e)
|
97
97
|
end
|
98
98
|
|
99
|
-
def update_rbs_mutation(class_name)
|
99
|
+
def update_rbs_mutation(class_name: "user")
|
100
100
|
file_path = ""
|
101
101
|
Dir.chdir(Souls.get_mother_path.to_s) do
|
102
102
|
file_dir = "./sig/api/app/graphql/mutations/base/#{class_name}"
|
103
103
|
FileUtils.mkdir_p(file_dir) unless Dir.exist?(file_dir)
|
104
104
|
file_path = "#{file_dir}/update_#{class_name}.rbs"
|
105
105
|
params = Souls.get_relation_params(class_name: class_name, col: "mutation")
|
106
|
-
params[:params]
|
106
|
+
params[:params] << { column_name: "id", type: "string", array: false }
|
107
107
|
File.open(file_path, "w") do |f|
|
108
108
|
f.write(<<~TEXT)
|
109
109
|
module Mutations
|
@@ -175,7 +175,7 @@ module Souls
|
|
175
175
|
file_path
|
176
176
|
end
|
177
177
|
|
178
|
-
def delete_rbs_mutation(class_name)
|
178
|
+
def delete_rbs_mutation(class_name: "user")
|
179
179
|
file_path = ""
|
180
180
|
Dir.chdir(Souls.get_mother_path.to_s) do
|
181
181
|
file_dir = "./sig/api/app/graphql/mutations/base/#{class_name}"
|
@@ -206,7 +206,7 @@ module Souls
|
|
206
206
|
raise(Thor::Error, e)
|
207
207
|
end
|
208
208
|
|
209
|
-
def destroy_delete_rbs_mutation(class_name)
|
209
|
+
def destroy_delete_rbs_mutation(class_name: "user")
|
210
210
|
file_path = ""
|
211
211
|
Dir.chdir(Souls.get_mother_path.to_s) do
|
212
212
|
file_dir = "./sig/api/app/graphql/mutations/base/#{class_name}"
|
@@ -11,8 +11,8 @@ module Souls
|
|
11
11
|
raise Souls::CLIException.new("File #{file_path} is missing. Please recreate it and then run this command again.") unless
|
12
12
|
File.exist? file_path
|
13
13
|
|
14
|
-
mutation_argument = check_mutation_argument(class_name, "create")
|
15
|
-
overwrite_class_file(mutation_argument, file_path, new_cols)
|
14
|
+
mutation_argument = check_mutation_argument(class_name: "user", action: "create")
|
15
|
+
overwrite_class_file(mutation_argument: mutation_argument, file_path: file_path, new_cols: new_cols)
|
16
16
|
puts(Paint % ["Updated file! : %{white_text}", :green, { white_text: [file_path.to_s, :white] }])
|
17
17
|
end
|
18
18
|
|
@@ -25,15 +25,15 @@ module Souls
|
|
25
25
|
raise Souls::CLIException.new("File #{file_path} is missing. Please recreate it and then run this command again.") unless
|
26
26
|
File.exist? file_path
|
27
27
|
|
28
|
-
mutation_argument = check_mutation_argument(class_name, "update")
|
29
|
-
overwrite_class_file(mutation_argument, file_path, new_cols)
|
28
|
+
mutation_argument = check_mutation_argument(class_name: class_name, action: "update")
|
29
|
+
overwrite_class_file(mutation_argument: mutation_argument, file_path: file_path, new_cols: new_cols)
|
30
30
|
|
31
31
|
puts(Paint % ["Updated file! : %{white_text}", :green, { white_text: [file_path.to_s, :white] }])
|
32
32
|
end
|
33
33
|
|
34
34
|
private
|
35
35
|
|
36
|
-
def overwrite_class_file(mutation_argument, file_path, new_cols)
|
36
|
+
def overwrite_class_file(mutation_argument: "arg", file_path: "path", new_cols: 1)
|
37
37
|
write_txt = String.new
|
38
38
|
File.open(file_path, "r") do |f|
|
39
39
|
f.each_line do |line|
|
@@ -55,7 +55,7 @@ module Souls
|
|
55
55
|
File.open(file_path, "w") { |f| f.write(write_txt) }
|
56
56
|
end
|
57
57
|
|
58
|
-
def check_mutation_argument(class_name, action)
|
58
|
+
def check_mutation_argument(class_name: "user", action: "action")
|
59
59
|
singularized_class_name = class_name.singularize.underscore
|
60
60
|
dir_name = "./app/graphql/mutations/base/#{singularized_class_name}"
|
61
61
|
file_path = "#{dir_name}/#{action}_#{singularized_class_name}.rb"
|
data/lib/souls/version.rb
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.4.
|
1
|
+
1.4.8
|
@@ -1 +1 @@
|
|
1
|
-
1.4.
|
1
|
+
1.4.8
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: souls
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.8
|
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
13
|
date: 2021-11-08 00:00:00.000000000 Z
|
@@ -232,7 +232,7 @@ metadata:
|
|
232
232
|
homepage_uri: https://souls.elsoul.nl
|
233
233
|
source_code_uri: https://github.com/elsoul/souls
|
234
234
|
changelog_uri: https://github.com/elsoul/souls
|
235
|
-
post_install_message:
|
235
|
+
post_install_message:
|
236
236
|
rdoc_options: []
|
237
237
|
require_paths:
|
238
238
|
- lib
|
@@ -248,7 +248,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
248
248
|
version: '0'
|
249
249
|
requirements: []
|
250
250
|
rubygems_version: 3.2.22
|
251
|
-
signing_key:
|
251
|
+
signing_key:
|
252
252
|
specification_version: 4
|
253
253
|
summary: Build Serverless Apps faster like Rails. Powered by Ruby GraphQL, RBS/Steep,
|
254
254
|
Active Record, RSpec, RuboCop, and Google Cloud.
|