souls 0.36.2 → 0.38.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/lib/souls/cli/create/index.rb +4 -1
- data/lib/souls/cli/sync/model.rb +11 -76
- data/lib/souls/index.rb +1 -0
- data/lib/souls/utils/index.rb +11 -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
- data/lib/souls.rb +1 -0
- metadata +6 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '049da55255f0a909b27e5544543ad15d2c69e34bcde5a69c818cc027637e830a'
|
4
|
+
data.tar.gz: 7d620b1a60b67bd023053c4a258484413cc5352b9b1bd4c667be1eb01b252ca1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2aa11ba07192c948ec5fcaae3bf6530c44f7e42e7a3f9ac18a790fa7263283b40d2e3642888a216792f1073371f474348f5025eb383e19dfd31265566b1f3c15
|
7
|
+
data.tar.gz: 52f888741dd723188944ba13663807ed01dda6c2ce1daae685b5c44781f52766ce4e3209341c963f179d8a2e095feb9d359664af5a298a2fd3dc5fcab03d2d2d
|
@@ -2,6 +2,9 @@ module Souls
|
|
2
2
|
module Create
|
3
3
|
class << self
|
4
4
|
def worker(worker_name: "mailer")
|
5
|
+
file_dir = "apps/#{worker_name}"
|
6
|
+
raise(StandardError, "Same Worker Already Exist!") if Dir.exist?(file_dir)
|
7
|
+
|
5
8
|
workers = Souls.configuration.workers
|
6
9
|
port = 3000 + workers.size
|
7
10
|
download_worker(worker_name: worker_name)
|
@@ -175,7 +178,7 @@ end
|
|
175
178
|
end
|
176
179
|
|
177
180
|
def souls_config_init(worker_name: "mailer")
|
178
|
-
app_name = Souls.configuration.
|
181
|
+
app_name = Souls.configuration.app
|
179
182
|
project_id = Souls.configuration.project_id
|
180
183
|
config_dir = "apps/#{worker_name}/config"
|
181
184
|
FileUtils.mkdir_p(config_dir) unless Dir.exist?(config_dir)
|
data/lib/souls/cli/sync/model.rb
CHANGED
@@ -2,88 +2,23 @@ module Souls
|
|
2
2
|
module Sync
|
3
3
|
class << self
|
4
4
|
def model
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
raise(StandardError, "You are at wrong directory!Go to API or Worker Directory!")
|
9
|
-
end
|
10
|
-
|
11
|
-
cp_dir = get_models_path(service_name: current_dir_name)
|
12
|
-
cp_dir.each do |path|
|
13
|
-
cp_and_dl_files(api_dir: path[:api], worker_dir: path[:worker])
|
5
|
+
cp_dir = %w[db app/models spec/factories]
|
6
|
+
cp_dir.each do |dir|
|
7
|
+
cp_and_dl_files(dir: dir)
|
14
8
|
end
|
15
9
|
end
|
16
10
|
|
17
11
|
private
|
18
12
|
|
19
|
-
def
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
last_update = s.mtime.to_s
|
28
|
-
last_status_change = s.ctime.to_s
|
29
|
-
last_access = s.atime.to_s
|
30
|
-
{
|
31
|
-
last_update: last_update,
|
32
|
-
last_status_change: last_status_change,
|
33
|
-
last_access: last_access
|
34
|
-
}
|
35
|
-
end
|
36
|
-
|
37
|
-
def cp_and_dl_files(api_dir: "", worker_dir: "")
|
38
|
-
if Dir["#{worker_dir}/*.rb"].blank?
|
39
|
-
|
40
|
-
api_latest_date = 1
|
41
|
-
worker_latest_date = 0
|
42
|
-
else
|
43
|
-
api_file_data = file_diff(Dir["#{api_dir}/*.rb"])
|
44
|
-
worker_file_data = file_diff(Dir["#{worker_dir}/*.rb"])
|
45
|
-
# rubocop:disable Style/DateTime
|
46
|
-
api_latest_date = DateTime.parse(api_file_data.max)
|
47
|
-
worker_latest_date = DateTime.parse(worker_file_data.max)
|
48
|
-
# rubocop:enable Style/DateTime
|
49
|
-
end
|
50
|
-
|
51
|
-
if api_latest_date < worker_latest_date
|
52
|
-
FileUtils.rm_rf(api_dir) if Dir.exist?(api_dir)
|
53
|
-
FileUtils.mkdir(api_dir) unless Dir.exist?(api_dir)
|
54
|
-
system("cp -r #{worker_dir}/* #{api_dir}")
|
55
|
-
else
|
56
|
-
FileUtils.rm_rf(worker_dir) if Dir.exist?(worker_dir)
|
57
|
-
FileUtils.mkdir(worker_dir) unless Dir.exist?(worker_dir)
|
58
|
-
system("cp -r #{api_dir}/* #{worker_dir}")
|
59
|
-
end
|
60
|
-
rescue StandardError => e
|
61
|
-
puts(Paint[e, :red])
|
62
|
-
end
|
63
|
-
|
64
|
-
def get_models_path(service_name: "api")
|
65
|
-
case service_name
|
66
|
-
when "api"
|
67
|
-
api_path = "."
|
68
|
-
worker_path = "../worker"
|
69
|
-
when "worker"
|
70
|
-
api_path = "../api"
|
71
|
-
worker_path = "."
|
13
|
+
def cp_and_dl_files(dir: "db")
|
14
|
+
worker_paths = Souls.configuration.workers.map { |n| n[:name] }
|
15
|
+
worker_paths.each do |path|
|
16
|
+
cp_path = "./apps/api/#{dir}"
|
17
|
+
old_path = "./apps/#{path}/#{dir}"
|
18
|
+
FileUtils.rm_rf(old_path) if Dir.exist?(old_path)
|
19
|
+
FileUtils.mkdir(old_path) unless Dir.exist?(old_path)
|
20
|
+
system("cp -r #{cp_path}/* #{old_path}", chdir: Souls.get_mother_path)
|
72
21
|
end
|
73
|
-
[
|
74
|
-
{
|
75
|
-
api: "#{api_path}/db",
|
76
|
-
worker: "#{worker_path}/db"
|
77
|
-
},
|
78
|
-
{
|
79
|
-
api: "#{api_path}/app/models",
|
80
|
-
worker: "#{worker_path}/app/models"
|
81
|
-
},
|
82
|
-
{
|
83
|
-
api: "#{api_path}/spec/factories",
|
84
|
-
worker: "#{worker_path}/spec/factories"
|
85
|
-
}
|
86
|
-
]
|
87
22
|
end
|
88
23
|
end
|
89
24
|
end
|
data/lib/souls/index.rb
CHANGED
@@ -0,0 +1,11 @@
|
|
1
|
+
module Souls
|
2
|
+
module Utils
|
3
|
+
def get_mother_path
|
4
|
+
FileUtils.pwd.split(Souls.configuration.app)[0] + Souls.configuration.app
|
5
|
+
end
|
6
|
+
|
7
|
+
def get_api_path
|
8
|
+
FileUtils.pwd.split(Souls.configuration.app)[0] + Souls.configuration.app + "/apps/api"
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
data/lib/souls/version.rb
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.17.0
|
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.17.0
|
data/lib/souls.rb
CHANGED
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.38.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-09-
|
13
|
+
date: 2021-09-02 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activesupport
|
@@ -144,6 +144,7 @@ files:
|
|
144
144
|
- lib/souls/cli/upgrade/index.rb
|
145
145
|
- lib/souls/index.rb
|
146
146
|
- lib/souls/init.rb
|
147
|
+
- lib/souls/utils/index.rb
|
147
148
|
- lib/souls/version.rb
|
148
149
|
- lib/souls/versions/.souls_api_version
|
149
150
|
- lib/souls/versions/.souls_worker_version
|
@@ -158,7 +159,7 @@ metadata:
|
|
158
159
|
homepage_uri: https://souls.elsoul.nl
|
159
160
|
source_code_uri: https://github.com/elsoul/souls
|
160
161
|
changelog_uri: https://github.com/elsoul/souls
|
161
|
-
post_install_message:
|
162
|
+
post_install_message:
|
162
163
|
rdoc_options: []
|
163
164
|
require_paths:
|
164
165
|
- lib
|
@@ -174,7 +175,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
174
175
|
version: '0'
|
175
176
|
requirements: []
|
176
177
|
rubygems_version: 3.2.22
|
177
|
-
signing_key:
|
178
|
+
signing_key:
|
178
179
|
specification_version: 4
|
179
180
|
summary: SOULs はサーバーレスフルスタックフレームワークです。柔軟な Ruby GraphQL API と Worker はルーティングの必要がありません。
|
180
181
|
クラウド環境への自動デプロイ、CI/CD ワークフローを標準装備。開発者がビジネスロジックに集中し、楽しくコードが書けるような環境を目指しています。
|