souls 0.25.19 → 0.26.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.
- checksums.yaml +4 -4
- data/exe/souls +3 -20
- data/lib/souls/generate/methods.rb +2 -0
- data/lib/souls/init.rb +110 -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 +30 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8dfb7d78b585890c670003133a6e687a7a39b4f70e906144c79c27e576d36936
|
4
|
+
data.tar.gz: 0b13c30a496b1c02d060eb845c03e41de79c7ea7ed8d615f53a62295d0cc0ce7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e261f29bba6a2e959f5690eee223cc8119e912a0c8b866348dea1ed6664973c910b124698b1c0ef7d4663860e42c9f36f5ddddaf7a54fd655e39b70192105395
|
7
|
+
data.tar.gz: baa9ce69af7d71d150be6a703a913f870da5a05c5f553bcca48728e3f487c92b16d3083e44142ae108652376f8bc7ab7e7fb545f1c019cf26b110f55e418ba8b
|
data/exe/souls
CHANGED
@@ -9,25 +9,8 @@ begin
|
|
9
9
|
souls_command = ARGV[0]
|
10
10
|
case souls_command
|
11
11
|
when "new"
|
12
|
-
|
13
|
-
|
14
|
-
if app_name.nil?
|
15
|
-
puts(Paint["you need to specify your app name", :red])
|
16
|
-
puts(Paint["`souls new app_name`", :yellow])
|
17
|
-
exit
|
18
|
-
end
|
19
|
-
|
20
|
-
prompt = TTY::Prompt.new
|
21
|
-
choices = ["1. SOULs GraphQL API", "2. SOULs Pub/Sub Worker", "3. SOULs Frontend Web"]
|
22
|
-
choice_num = prompt.select(Paint["Select Strain: ", :cyan], choices)[0].to_i
|
23
|
-
case choice_num
|
24
|
-
when 1, 2
|
25
|
-
service_name = (STRAINS[choice_num.to_i - 1]).to_s
|
26
|
-
Souls::Init.download_souls(app_name: app_name, service_name: service_name)
|
27
|
-
Souls::Init.initial_config_init(app_name: app_name, service_name: service_name)
|
28
|
-
else
|
29
|
-
puts(Paint["Coming Soon...", :blue])
|
30
|
-
end
|
12
|
+
args = ARGV
|
13
|
+
Souls::Init.return_method(args)
|
31
14
|
when "s", "server"
|
32
15
|
strain = Souls.configuration.strain
|
33
16
|
case strain
|
@@ -123,7 +106,7 @@ begin
|
|
123
106
|
when "g", "generate"
|
124
107
|
args = ARGV
|
125
108
|
status = Paint["Generating Files...", :yellow]
|
126
|
-
done = Paint["
|
109
|
+
done = Paint["You're All Set ☻", :yellow]
|
127
110
|
Whirly.start(spinner: "clock", interval: 420, stop: "🎉") do
|
128
111
|
Whirly.status = status
|
129
112
|
Souls::Generate.return_method(args)
|
data/lib/souls/init.rb
CHANGED
@@ -10,13 +10,15 @@ module Souls
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def self.initial_config_init(app_name: "souls", service_name: "api")
|
13
|
-
|
14
|
-
|
13
|
+
config_dir = "./#{app_name}/apps/#{service_name}/config"
|
14
|
+
FileUtils.mkdir_p(config_dir) unless Dir.exist?(config_dir)
|
15
|
+
FileUtils.touch("#{config_dir}/souls.rb")
|
16
|
+
file_path = "#{config_dir}/souls.rb"
|
15
17
|
File.open(file_path, "w") do |f|
|
16
18
|
f.write(<<~TEXT)
|
17
19
|
Souls.configure do |config|
|
18
20
|
config.app = "#{app_name}"
|
19
|
-
config.project_id = "souls-
|
21
|
+
config.project_id = "souls-app"
|
20
22
|
config.strain = "#{service_name}"
|
21
23
|
config.worker_endpoint = "https://worker.com"
|
22
24
|
config.fixed_gems = ["excluded_gem"]
|
@@ -27,13 +29,69 @@ module Souls
|
|
27
29
|
puts(e)
|
28
30
|
end
|
29
31
|
|
32
|
+
def self.download_github_actions
|
33
|
+
file_name = "github.tgz"
|
34
|
+
url = "https://storage.googleapis.com/souls-bucket/github_actions/github.tgz"
|
35
|
+
system("curl -OL #{url}")
|
36
|
+
FileUtils.mkdir("github")
|
37
|
+
system("tar -zxvf ./#{file_name} -C #{file_name}/")
|
38
|
+
FileUtils.rm(file_name)
|
39
|
+
end
|
40
|
+
|
41
|
+
def self.mother_config_init(app_name: "souls-app")
|
42
|
+
config_dir = "./#{app_name}/config"
|
43
|
+
FileUtils.mkdir_p(config_dir) unless Dir.exist?(config_dir)
|
44
|
+
FileUtils.touch("#{config_dir}/souls.rb")
|
45
|
+
file_path = "#{config_dir}/souls.rb"
|
46
|
+
File.open(file_path, "w") do |f|
|
47
|
+
f.write(<<~TEXT)
|
48
|
+
Souls.configure do |config|
|
49
|
+
config.app = "#{app_name}"
|
50
|
+
config.project_id = "souls-app"
|
51
|
+
config.strain = "mother"
|
52
|
+
config.api = true
|
53
|
+
config.worker = false
|
54
|
+
config.frontend = false
|
55
|
+
config.worker_endpoint = ""
|
56
|
+
config.fixed_gems = ["excluded_gem"]
|
57
|
+
end
|
58
|
+
TEXT
|
59
|
+
end
|
60
|
+
rescue StandardError => e
|
61
|
+
puts(e)
|
62
|
+
end
|
63
|
+
|
64
|
+
def self.return_method(args)
|
65
|
+
strains = %w[api worker console admin media doc].freeze
|
66
|
+
app_name = args[1]
|
67
|
+
if app_name.nil?
|
68
|
+
puts(Paint["you need to specify your app name", :red])
|
69
|
+
puts(Paint["`souls new souls-app`", :yellow])
|
70
|
+
exit
|
71
|
+
end
|
72
|
+
|
73
|
+
prompt = TTY::Prompt.new
|
74
|
+
choices = ["1. SOULs GraphQL API", "2. SOULs Pub/Sub Worker", "3. SOULs Frontend Web"]
|
75
|
+
choice_num = prompt.select(Paint["Select Strain: ", :cyan], choices)[0].to_i
|
76
|
+
case choice_num
|
77
|
+
when 1, 2
|
78
|
+
service_name = (strains[choice_num.to_i - 1]).to_s
|
79
|
+
Souls::Init.download_souls(app_name: app_name, service_name: service_name)
|
80
|
+
Souls::Init.mother_config_init(app_name: app_name)
|
81
|
+
Souls::Init.download_github_actions
|
82
|
+
Souls::Init.initial_config_init(app_name: app_name, service_name: service_name)
|
83
|
+
else
|
84
|
+
puts(Paint["Coming Soon...", :blue])
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
30
88
|
def self.download_souls(app_name: "souls", service_name: "api")
|
31
89
|
version = Souls.get_latest_version_txt(service_name: service_name).join(".")
|
32
90
|
file_name = "#{service_name}-v#{version}.tgz"
|
33
91
|
url = "https://storage.googleapis.com/souls-bucket/boilerplates/#{service_name.pluralize}/#{file_name}"
|
34
92
|
system("curl -OL #{url}")
|
35
|
-
system("mkdir -p #{app_name}/#{service_name}")
|
36
|
-
system("tar -zxvf ./#{file_name} -C #{app_name}/")
|
93
|
+
system("mkdir -p #{app_name}/apps/#{service_name}")
|
94
|
+
system("tar -zxvf ./#{file_name} -C #{app_name}/apps/")
|
37
95
|
FileUtils.rm(file_name)
|
38
96
|
line = Paint["====================================", :yellow]
|
39
97
|
puts("\n")
|
@@ -59,8 +117,54 @@ module Souls
|
|
59
117
|
puts(line)
|
60
118
|
endroll = <<~TEXT
|
61
119
|
Easy to Run
|
62
|
-
$ cd #{app_name}/#{service_name}
|
120
|
+
$ cd #{app_name}/apps/#{service_name}
|
121
|
+
$ bundle
|
122
|
+
$ souls s
|
123
|
+
Go To : http://localhost:4000
|
124
|
+
|
125
|
+
Doc: https://souls.elsoul.nl
|
126
|
+
TEXT
|
127
|
+
cd = Paint[endroll, :white]
|
128
|
+
puts(cd)
|
129
|
+
puts(line)
|
130
|
+
end
|
131
|
+
|
132
|
+
def self.download_worker
|
133
|
+
current_dir_name = FileUtils.pwd.to_s.match(%r{/([^/]+)/?$})[1]
|
134
|
+
version = Souls.get_latest_version_txt(service_name: "worker").join(".")
|
135
|
+
file_name = "worker-v#{version}.tgz"
|
136
|
+
url = "https://storage.googleapis.com/souls-bucket/boilerplates/workers/#{file_name}"
|
137
|
+
system("curl -OL #{url}")
|
138
|
+
system("mkdir -p ./apps/worker")
|
139
|
+
system("tar -zxvf ./#{file_name} -C ./apps/")
|
140
|
+
FileUtils.rm(file_name)
|
141
|
+
line = Paint["====================================", :yellow]
|
142
|
+
puts("\n")
|
143
|
+
puts(line)
|
144
|
+
txt2 = <<~TEXT
|
145
|
+
_____ ____ __ ____#{' '}
|
146
|
+
/ ___// __ \\/ / / / / %{red1}
|
147
|
+
\\__ \\/ / / / / / / / %{red2}
|
148
|
+
___/ / /_/ / /_/ / /___%{red3}#{' '}
|
149
|
+
/____/\\____/\\____/_____%{red4}#{' '}
|
150
|
+
TEXT
|
151
|
+
red1 = ["_____", :red]
|
152
|
+
red2 = ["/ ___/", :red]
|
153
|
+
red3 = ["(__ )", :red]
|
154
|
+
red4 = ["/____/", :red]
|
155
|
+
ms = Paint % [txt2, :cyan, { red1: red1, red2: red2, red3: red3, red4: red4 }]
|
156
|
+
puts(ms)
|
157
|
+
puts(line)
|
158
|
+
welcome = Paint["SOULs Worker Activated!", :white]
|
159
|
+
puts(welcome)
|
160
|
+
souls_ver = Paint["SOULs Version: #{Souls::VERSION}", :white]
|
161
|
+
puts(souls_ver)
|
162
|
+
puts(line)
|
163
|
+
endroll = <<~TEXT
|
164
|
+
Easy to Run
|
165
|
+
$ cd ./apps/worker
|
63
166
|
$ bundle
|
167
|
+
$ souls model:update
|
64
168
|
$ souls s
|
65
169
|
Go To : http://localhost:3000
|
66
170
|
|
data/lib/souls/version.rb
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.5.1
|
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.5.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.
|
4
|
+
version: 0.26.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- POPPIN-FUMI
|
@@ -10,8 +10,36 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: exe
|
12
12
|
cert_chain: []
|
13
|
-
date: 2021-08-
|
13
|
+
date: 2021-08-03 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: activesupport
|
17
|
+
requirement: !ruby/object:Gem::Requirement
|
18
|
+
requirements:
|
19
|
+
- - '='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: 6.1.4
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
requirements:
|
26
|
+
- - '='
|
27
|
+
- !ruby/object:Gem::Version
|
28
|
+
version: 6.1.4
|
29
|
+
- !ruby/object:Gem::Dependency
|
30
|
+
name: dotenv
|
31
|
+
requirement: !ruby/object:Gem::Requirement
|
32
|
+
requirements:
|
33
|
+
- - '='
|
34
|
+
- !ruby/object:Gem::Version
|
35
|
+
version: 2.7.6
|
36
|
+
type: :runtime
|
37
|
+
prerelease: false
|
38
|
+
version_requirements: !ruby/object:Gem::Requirement
|
39
|
+
requirements:
|
40
|
+
- - '='
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
version: 2.7.6
|
15
43
|
- !ruby/object:Gem::Dependency
|
16
44
|
name: paint
|
17
45
|
requirement: !ruby/object:Gem::Requirement
|