souls 2.0.4 → 3.0.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/README.md +1 -23
- data/lib/souls/cli/create/index.rb +0 -62
- data/lib/souls/cli/db/create_migration.rb +0 -1
- data/lib/souls/cli/db/index.rb +0 -2
- data/lib/souls/cli/delete/application.rb +2 -18
- data/lib/souls/cli/delete/job.rb +0 -1
- data/lib/souls/cli/delete/manager.rb +0 -1
- data/lib/souls/cli/delete/migration_file.rb +0 -1
- data/lib/souls/cli/generate/application.rb +2 -26
- data/lib/souls/cli/generate/job.rb +0 -1
- data/lib/souls/cli/generate/manager.rb +0 -1
- data/lib/souls/cli/generate/mutation.rb +2 -2
- data/lib/souls/cli/init/index.rb +0 -8
- data/lib/souls/cli/update/index.rb +0 -7
- data/lib/souls/cli/upgrade/index.rb +0 -1
- data/lib/souls/cli.rb +2 -20
- data/lib/souls/utils/index.rb +0 -13
- 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 -25
- data/lib/souls/cli/db/create_migration_rbs.rb +0 -25
- data/lib/souls/cli/db/model_rbs.rb +0 -22
- data/lib/souls/cli/delete/connection_rbs.rb +0 -16
- data/lib/souls/cli/delete/edge_rbs.rb +0 -15
- data/lib/souls/cli/delete/job_rbs.rb +0 -22
- data/lib/souls/cli/delete/manager_rbs.rb +0 -17
- data/lib/souls/cli/delete/mutation_rbs.rb +0 -15
- data/lib/souls/cli/delete/query_rbs.rb +0 -16
- data/lib/souls/cli/delete/resolver_rbs.rb +0 -16
- data/lib/souls/cli/delete/type_rbs.rb +0 -16
- data/lib/souls/cli/generate/connection_rbs.rb +0 -25
- data/lib/souls/cli/generate/edge_rbs.rb +0 -28
- data/lib/souls/cli/generate/job_rbs.rb +0 -40
- data/lib/souls/cli/generate/manager_rbs.rb +0 -32
- data/lib/souls/cli/generate/mutation_rbs.rb +0 -241
- data/lib/souls/cli/generate/query_rbs.rb +0 -38
- data/lib/souls/cli/generate/resolver_rbs.rb +0 -42
- data/lib/souls/cli/generate/type_rbs.rb +0 -56
- data/lib/souls/cli/update/mutation_rbs.rb +0 -126
- data/lib/souls/cli/update/type_rbs.rb +0 -44
- data/lib/souls/cli/upgrade/submodule.rb +0 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ed1493ecfd8c9362066553fa365ad0d0acf931282bb2d0ed3d0b9de8bb3b6100
|
4
|
+
data.tar.gz: 58087fb63a27c133e8b0a224f28b49eaca6b8724e6971bdec6e3bd992b4fa3dd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 04a23fa0905c0668274d45e8c447a241ace03438e06c402bf8b0c9c7aef0ce1b9f69ca736722ea1551828de2212d274adaad7d5fbcfde45fb974c44c47a50abe
|
7
|
+
data.tar.gz: 8a6f2a3e39a95cce2f29b4ce4f5960491cc648dab6659589283bf944ea84c84194b36ddccf66d86ae914b493d9b75396526234881aac04f9f0e816df6fa823af
|
data/README.md
CHANGED
@@ -44,7 +44,7 @@ Ruby Serverless Framework 'SOULs'.
|
|
44
44
|
The SOULs project was launched with the goal of reducing software development, operation and maintenance costs.
|
45
45
|
|
46
46
|
Build Serverless Apps faster like Rails.
|
47
|
-
Powered by Ruby GraphQL,
|
47
|
+
Powered by Ruby GraphQL, Active Record, RSpec, RuboCop, and Google Cloud.
|
48
48
|
|
49
49
|
- Focus on business logic in serverless environment
|
50
50
|
- Maximize development efficiency with CI / CD standard schema-driven Scaffold
|
@@ -58,23 +58,6 @@ SOULs creates 3 types of App.
|
|
58
58
|
2. Worker - Google Pub/Sub Messaging Worker API (Ruby) - Cloud Run
|
59
59
|
3. Functions - Google Cloud Functions
|
60
60
|
|
61
|
-
## Ruby type checking
|
62
|
-
The SOULs framework uses RBS / Steep, which appeared in Ruby 3.0.
|
63
|
-
|
64
|
-
- [RBS](https://github.com/ruby/rbs/)
|
65
|
-
- [Steep](https://github.com/soutaro/steep/)
|
66
|
-
|
67
|
-
As a result, typos, column types, etc.
|
68
|
-
|
69
|
-
It is a development environment where you can immediately notice the mistakes that occur frequently.
|
70
|
-
|
71
|
-
<p>
|
72
|
-
<a aria-label="RBS Demo" href="https://souls.elsoul.nl/ja/docs/guides/basic/type-check/">
|
73
|
-
<img src="https://souls.elsoul.nl/imgs/gifs/rbs-video.gif">
|
74
|
-
</a>
|
75
|
-
</p>
|
76
|
-
|
77
|
-
|
78
61
|
## Dependency
|
79
62
|
|
80
63
|
- [Google SDK](https://cloud.google.com/sdk/docs)
|
@@ -123,11 +106,6 @@ And Create Your APP
|
|
123
106
|
|
124
107
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `souls t` to run the tests. You can also run `souls c` for an interactive prompt that will allow you to experiment.
|
125
108
|
|
126
|
-
You need to add submodule
|
127
|
-
|
128
|
-
```bash
|
129
|
-
git submodule add -f https://github.com/ruby/gem_rbs_collection.git vendor/rbs/gem_rbs_collection
|
130
|
-
```
|
131
109
|
|
132
110
|
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org/gems/souls).
|
133
111
|
|
@@ -18,8 +18,6 @@ module SOULs
|
|
18
18
|
procfile(worker_name:, port:)
|
19
19
|
mother_procfile(worker_name:)
|
20
20
|
souls_config_init(worker_name:)
|
21
|
-
steepfile(worker_name:)
|
22
|
-
souls_helper_rbs(worker_name:)
|
23
21
|
system("cd #{file_dir} && bundle")
|
24
22
|
system("cd #{file_dir} && mv .env.sample .env")
|
25
23
|
souls_worker_credit(worker_name:)
|
@@ -29,25 +27,6 @@ module SOULs
|
|
29
27
|
|
30
28
|
private
|
31
29
|
|
32
|
-
def steepfile(worker_name: "worker-mailer")
|
33
|
-
file_path = "./Steepfile"
|
34
|
-
|
35
|
-
write_txt = ""
|
36
|
-
File.open(file_path, "r") do |f|
|
37
|
-
f.each_line do |line|
|
38
|
-
if line.strip.to_s == "end"
|
39
|
-
["app", "db/seeds.rb", "constants", "app.rb"].each do |path|
|
40
|
-
write_txt += " check \"apps/#{worker_name}/#{path}\"\n"
|
41
|
-
end
|
42
|
-
write_txt += "end\n"
|
43
|
-
else
|
44
|
-
write_txt += line
|
45
|
-
end
|
46
|
-
end
|
47
|
-
end
|
48
|
-
File.open(file_path, "w") { |f| f.write(write_txt) }
|
49
|
-
end
|
50
|
-
|
51
30
|
def procfile(worker_name: "worker-mailer", port: 123)
|
52
31
|
file_path = "apps/#{worker_name}/Procfile.dev"
|
53
32
|
File.open(file_path, "w") do |f|
|
@@ -235,47 +214,6 @@ end
|
|
235
214
|
end
|
236
215
|
end
|
237
216
|
|
238
|
-
def souls_helper_rbs(worker_name: "worker-mailer")
|
239
|
-
file_dir = "./sig/#{worker_name}/app/utils"
|
240
|
-
FileUtils.mkdir_p(file_dir) unless Dir.exist?(file_dir)
|
241
|
-
file_path = "#{file_dir}/souls_helper.rbs"
|
242
|
-
File.open(file_path, "w") do |f|
|
243
|
-
f.write(<<~TEXT)
|
244
|
-
module SOULsHelper
|
245
|
-
def self.export_csv: (untyped model_name) -> (String? | StandardError )
|
246
|
-
def self.export_model_to_csv: (untyped model_name) -> (untyped | StandardError )
|
247
|
-
def self.upload_to_gcs: (String file_path, String upload_path) -> untyped
|
248
|
-
def self.get_selenium_driver: (?:chrome mode) -> untyped
|
249
|
-
end
|
250
|
-
module CSV
|
251
|
-
def self.open: (*untyped){(untyped) -> nil} -> untyped
|
252
|
-
end
|
253
|
-
module Selenium
|
254
|
-
module WebDriver
|
255
|
-
def self.for: (*untyped) -> untyped
|
256
|
-
module Chrome
|
257
|
-
module Options
|
258
|
-
def self.new: ()-> untyped
|
259
|
-
end
|
260
|
-
end
|
261
|
-
module Remote
|
262
|
-
module Capabilities
|
263
|
-
def self.firefox: ()-> untyped
|
264
|
-
end
|
265
|
-
end
|
266
|
-
end
|
267
|
-
end
|
268
|
-
module Google
|
269
|
-
module Cloud
|
270
|
-
module Storage
|
271
|
-
def self.new: ()-> untyped
|
272
|
-
end
|
273
|
-
end
|
274
|
-
end
|
275
|
-
TEXT
|
276
|
-
end
|
277
|
-
end
|
278
|
-
|
279
217
|
def download_worker(worker_name: "worker-mailer")
|
280
218
|
version = SOULs.get_latest_version_txt(service_name: "worker").join(".")
|
281
219
|
file_name = "worker-v#{version}.tgz"
|
@@ -6,7 +6,6 @@ module SOULs
|
|
6
6
|
singularized_class_name = class_name.underscore.singularize
|
7
7
|
SOULs::DB.new.invoke(:model, [singularized_class_name], {})
|
8
8
|
SOULs::DB.new.invoke(:rspec_model, [singularized_class_name], {})
|
9
|
-
SOULs::DB.new.invoke(:model_rbs, [singularized_class_name], {})
|
10
9
|
SOULs::Painter.create_file("")
|
11
10
|
system("rake db:create_migration NAME=create_#{pluralized_class_name}")
|
12
11
|
file_path = Dir["db/migrate/*create_#{pluralized_class_name}.rb"].first
|
data/lib/souls/cli/db/index.rb
CHANGED
@@ -1,23 +1,17 @@
|
|
1
1
|
module SOULs
|
2
2
|
class Delete < Thor
|
3
3
|
desc "scaffold [CLASS_NAME]", "Delete Scaffold"
|
4
|
-
method_option :rbs, type: :boolean, aliases: "--rbs", default: false, desc: "Deletes Only RBS Files"
|
5
4
|
def scaffold(class_name)
|
6
5
|
singularized_class_name = class_name.singularize
|
7
|
-
|
8
|
-
run_rbs_scaffold(class_name: singularized_class_name)
|
9
|
-
else
|
10
|
-
run_scaffold(class_name: singularized_class_name)
|
11
|
-
end
|
6
|
+
run_scaffold(class_name: singularized_class_name)
|
12
7
|
true
|
13
8
|
end
|
14
9
|
|
15
10
|
desc "scaffold_all", "Delete Scaffold All Tables from schema.rb"
|
16
|
-
method_option :rbs, type: :boolean, aliases: "--rbs", default: false, desc: "Deletes Only RBS Files"
|
17
11
|
def scaffold_all
|
18
12
|
puts(Paint["Delete All Scaffold Files!\n", :cyan])
|
19
13
|
SOULs.get_tables.each do |table|
|
20
|
-
SOULs::Delete.new.invoke(:scaffold, [table.singularize], {
|
14
|
+
SOULs::Delete.new.invoke(:scaffold, [table.singularize], {})
|
21
15
|
end
|
22
16
|
true
|
23
17
|
end
|
@@ -35,16 +29,6 @@ module SOULs
|
|
35
29
|
rspec_mutation(class_name)
|
36
30
|
rspec_query(class_name)
|
37
31
|
rspec_resolver(class_name)
|
38
|
-
run_rbs_scaffold(class_name:)
|
39
|
-
end
|
40
|
-
|
41
|
-
def run_rbs_scaffold(class_name: "user")
|
42
|
-
type_rbs(class_name)
|
43
|
-
query_rbs(class_name)
|
44
|
-
mutation_rbs(class_name)
|
45
|
-
edge_rbs(class_name)
|
46
|
-
connection_rbs(class_name)
|
47
|
-
resolver_rbs(class_name)
|
48
32
|
end
|
49
33
|
end
|
50
34
|
end
|
data/lib/souls/cli/delete/job.rb
CHANGED
@@ -9,7 +9,6 @@ module SOULs
|
|
9
9
|
|
10
10
|
FileUtils.rm_f(file_path)
|
11
11
|
SOULs::Painter.delete_file(file_path.to_s)
|
12
|
-
SOULs::Delete.new.invoke(:manager_rbs, [singularized_class_name], { mutation: options[:mutation] })
|
13
12
|
SOULs::Delete.new.invoke(:rspec_manager, [singularized_class_name], { mutation: options[:mutation] })
|
14
13
|
file_path
|
15
14
|
end
|
@@ -8,7 +8,6 @@ module SOULs
|
|
8
8
|
file_paths = {
|
9
9
|
model_file_path: "./apps/api/app/models/#{singularized_class_name}.rb",
|
10
10
|
rspec_file_path: "./apps/api/spec/models/#{singularized_class_name}_spec.rb",
|
11
|
-
rbs_file_path: "./sig/api/app/models/#{singularized_class_name}.rbs",
|
12
11
|
migration_file_path: Dir["db/migrate/*create_#{pluralized_class_name}.rb"].first
|
13
12
|
}
|
14
13
|
file_paths.each do |_k, v|
|
@@ -1,27 +1,17 @@
|
|
1
1
|
module SOULs
|
2
2
|
class Generate < Thor
|
3
3
|
desc "scaffold [CLASS_NAME]", "Generate Scaffold from schema.rb"
|
4
|
-
method_option :rbs, type: :boolean, aliases: "--rbs", default: false, desc: "Generates Only RBS Files"
|
5
4
|
def scaffold(class_name)
|
6
5
|
singularized_class_name = class_name.singularize
|
7
|
-
|
8
|
-
run_rbs_scaffold(singularized_class_name)
|
9
|
-
else
|
10
|
-
run_scaffold(singularized_class_name)
|
11
|
-
end
|
6
|
+
run_scaffold(singularized_class_name)
|
12
7
|
true
|
13
8
|
end
|
14
9
|
|
15
10
|
desc "scaffold_all", "Generate Scaffold All Tables from schema.rb"
|
16
|
-
method_option :rbs, type: :boolean, aliases: "--rbs", default: false, desc: "Generates Only RBS All Schema Files"
|
17
11
|
def scaffold_all
|
18
12
|
puts(Paint["Let's Go SOULs AUTO CRUD Assist!\n", :cyan])
|
19
13
|
SOULs.get_tables.each do |table|
|
20
|
-
|
21
|
-
SOULs::Generate.new.invoke(:scaffold, [table.singularize], { rbs: options[:rbs] })
|
22
|
-
else
|
23
|
-
SOULs::Generate.new.invoke(:scaffold, [table.singularize], {})
|
24
|
-
end
|
14
|
+
SOULs::Generate.new.invoke(:scaffold, [table.singularize], {})
|
25
15
|
end
|
26
16
|
true
|
27
17
|
end
|
@@ -30,31 +20,17 @@ module SOULs
|
|
30
20
|
|
31
21
|
def run_scaffold(class_name)
|
32
22
|
type(class_name)
|
33
|
-
type_rbs(class_name)
|
34
23
|
query(class_name)
|
35
|
-
query_rbs(class_name)
|
36
24
|
mutation(class_name)
|
37
|
-
mutation_rbs(class_name)
|
38
25
|
edge(class_name)
|
39
|
-
edge_rbs(class_name)
|
40
26
|
connection(class_name)
|
41
|
-
connection_rbs(class_name)
|
42
27
|
resolver(class_name)
|
43
|
-
resolver_rbs(class_name)
|
44
28
|
rspec_factory(class_name)
|
45
29
|
rspec_mutation(class_name)
|
46
30
|
rspec_query(class_name)
|
47
31
|
rspec_resolver(class_name)
|
48
32
|
end
|
49
33
|
|
50
|
-
def run_rbs_scaffold(class_name)
|
51
|
-
type_rbs(class_name)
|
52
|
-
query_rbs(class_name)
|
53
|
-
mutation_rbs(class_name)
|
54
|
-
edge_rbs(class_name)
|
55
|
-
connection_rbs(class_name)
|
56
|
-
resolver_rbs(class_name)
|
57
|
-
end
|
58
34
|
|
59
35
|
def generated_paths(class_name)
|
60
36
|
singularized_class_name = class_name.singularize.underscore
|
@@ -10,7 +10,6 @@ module SOULs
|
|
10
10
|
end
|
11
11
|
|
12
12
|
create_manager(class_name, options[:mutation])
|
13
|
-
SOULs::Generate.new.invoke(:manager_rbs, [singularized_class_name], { mutation: options[:mutation] })
|
14
13
|
SOULs::Generate.new.invoke(:rspec_manager, [singularized_class_name], { mutation: options[:mutation] })
|
15
14
|
end
|
16
15
|
|
@@ -24,7 +24,7 @@ module SOULs
|
|
24
24
|
file_dir = "./app/graphql/mutations/base/#{singularized_class_name}"
|
25
25
|
FileUtils.mkdir_p(file_dir) unless Dir.exist?(file_dir)
|
26
26
|
file_path = "#{file_dir}/create_#{singularized_class_name}.rb"
|
27
|
-
raise(Thor::Error, "Mutation
|
27
|
+
raise(Thor::Error, "Mutation already exist! #{file_path}") if File.exist?(file_path)
|
28
28
|
|
29
29
|
params = SOULs.get_relation_params(class_name: singularized_class_name, col: "mutation")
|
30
30
|
File.open(file_path, "a") do |f|
|
@@ -92,7 +92,7 @@ module SOULs
|
|
92
92
|
file_dir = "./app/graphql/mutations/base/#{singularized_class_name}"
|
93
93
|
FileUtils.mkdir_p(file_dir) unless Dir.exist?(file_dir)
|
94
94
|
file_path = "#{file_dir}/update_#{singularized_class_name}.rb"
|
95
|
-
raise(Thor::Error, "Mutation
|
95
|
+
raise(Thor::Error, "Mutation already exist! #{file_path}") if File.exist?(file_path)
|
96
96
|
|
97
97
|
params = SOULs.get_relation_params(class_name: singularized_class_name, col: "mutation")
|
98
98
|
File.open(file_path, "w") do |f|
|
data/lib/souls/cli/init/index.rb
CHANGED
@@ -25,7 +25,6 @@ module SOULs
|
|
25
25
|
initial_config_init(app_name:, service_name:)
|
26
26
|
system("cd #{app_name}/apps/api && mv .env.sample .env")
|
27
27
|
system("cd #{app_name} && git init --initial-branch=main")
|
28
|
-
system("cd #{app_name} && rbs collection init && rbs collection install")
|
29
28
|
souls_api_credit(app_name)
|
30
29
|
end
|
31
30
|
|
@@ -136,7 +135,6 @@ module SOULs
|
|
136
135
|
gem "sinatra-activerecord", "2.0.25"
|
137
136
|
gem "solargraph", "0.44.3"
|
138
137
|
#{souls_gem}
|
139
|
-
gem "steep", "0.49.0"
|
140
138
|
gem "thor", "1.2.1"
|
141
139
|
gem "tty-prompt", "0.23.1"
|
142
140
|
gem "whirly", "0.3.0"
|
@@ -155,21 +153,15 @@ module SOULs
|
|
155
153
|
system("tar -zxvf ./#{file_name} -C #{app_name}/apps/")
|
156
154
|
FileUtils.rm(file_name)
|
157
155
|
|
158
|
-
sig_name = "sig.tgz"
|
159
|
-
url = "#{@bucket_url}/sig/#{sig_name}"
|
160
|
-
system("curl -OL #{url}")
|
161
|
-
system("tar -zxvf ./#{sig_name} -C #{app_name}")
|
162
156
|
|
163
157
|
system("cd #{app_name} && curl -OL #{@bucket_url}/rubocop.yml && mv rubocop.yml .rubocop.yml")
|
164
158
|
get_latest_gem(app_name)
|
165
159
|
system("cd #{app_name} && curl -OL #{@bucket_url}/Procfile.dev")
|
166
160
|
system("cd #{app_name} && curl -OL #{@bucket_url}/Procfile")
|
167
|
-
system("cd #{app_name} && curl -OL #{@bucket_url}/Steepfile")
|
168
161
|
system("cd #{app_name} && curl -OL #{@bucket_url}/gitignore")
|
169
162
|
system("cd #{app_name} && mv gitignore .gitignore")
|
170
163
|
system("cd #{app_name} && bundle")
|
171
164
|
system("cd #{app_name}/apps/api && bundle")
|
172
|
-
FileUtils.rm(sig_name)
|
173
165
|
end
|
174
166
|
|
175
167
|
def souls_api_credit(app_name)
|
@@ -1,8 +1,6 @@
|
|
1
1
|
require_relative "./mutation"
|
2
|
-
require_relative "./mutation_rbs"
|
3
2
|
require_relative "./resolver"
|
4
3
|
require_relative "./type"
|
5
|
-
require_relative "./type_rbs"
|
6
4
|
require_relative "./rspec_factory"
|
7
5
|
require_relative "./rspec_mutation"
|
8
6
|
require_relative "./rspec_resolver"
|
@@ -18,11 +16,6 @@ module SOULs
|
|
18
16
|
rspec_factory(class_name)
|
19
17
|
rspec_mutation(class_name)
|
20
18
|
rspec_resolver(class_name)
|
21
|
-
Dir.chdir(SOULs.get_mother_path.to_s) do
|
22
|
-
create_mutation_rbs(class_name)
|
23
|
-
update_mutation_rbs(class_name)
|
24
|
-
type_rbs(class_name)
|
25
|
-
end
|
26
19
|
end
|
27
20
|
end
|
28
21
|
end
|
data/lib/souls/cli.rb
CHANGED
@@ -50,27 +50,9 @@ module SOULs
|
|
50
50
|
end
|
51
51
|
|
52
52
|
desc "test", "Run Rspec & Rubocop"
|
53
|
-
method_option :all, type: :boolean, aliases: "--all", default: false, desc: "Run (Rspec & steep check & Rubocop)"
|
54
53
|
def test
|
55
|
-
|
56
|
-
|
57
|
-
system("steep check")
|
58
|
-
end
|
59
|
-
Dir.chdir(SOULs.get_api_path.to_s) do
|
60
|
-
system("rubocop -A")
|
61
|
-
system("bundle exec rspec")
|
62
|
-
end
|
63
|
-
else
|
64
|
-
system("rubocop -A")
|
65
|
-
system("bundle exec rspec")
|
66
|
-
end
|
67
|
-
end
|
68
|
-
|
69
|
-
desc "check", "Run steep check"
|
70
|
-
def check
|
71
|
-
Dir.chdir(SOULs.get_mother_path.to_s) do
|
72
|
-
system("steep check")
|
73
|
-
end
|
54
|
+
system("rubocop -A")
|
55
|
+
system("bundle exec rspec")
|
74
56
|
end
|
75
57
|
|
76
58
|
def self.exit_on_failure?
|
data/lib/souls/utils/index.rb
CHANGED
@@ -28,19 +28,6 @@ module SOULs
|
|
28
28
|
}[type.to_sym]
|
29
29
|
end
|
30
30
|
|
31
|
-
def rbs_type_check(type)
|
32
|
-
{
|
33
|
-
bigint: "Integer",
|
34
|
-
string: "String",
|
35
|
-
float: "Float",
|
36
|
-
text: "String",
|
37
|
-
datetime: "String",
|
38
|
-
date: "String",
|
39
|
-
boolean: "bool",
|
40
|
-
integer: "Integer"
|
41
|
-
}[type.to_sym]
|
42
|
-
end
|
43
|
-
|
44
31
|
def get_type_and_name(line)
|
45
32
|
line.split(",")[0].gsub("\"", "").scan(/((?<=t\.).+(?=\s)) (.+)/)[0]
|
46
33
|
end
|
data/lib/souls/version.rb
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
3.0.0
|
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
3.0.0
|
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:
|
4
|
+
version: 3.0.0
|
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: 2022-
|
13
|
+
date: 2022-08-25 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activesupport
|
@@ -168,7 +168,7 @@ dependencies:
|
|
168
168
|
version: 1.2.1
|
169
169
|
description: |-
|
170
170
|
Ruby Serverless Framework 'SOULs' | Ruby サーバーレスフレームワーク SOULs.
|
171
|
-
Powered by Ruby GraphQL,
|
171
|
+
Powered by Ruby GraphQL, Active Record, RSpec, RuboCop, and Google Cloud.
|
172
172
|
email:
|
173
173
|
- f.kawasaki@elsoul.nl
|
174
174
|
- s.kishi@elsoul.nl
|
@@ -214,28 +214,19 @@ files:
|
|
214
214
|
- lib/souls/cli/create/templates/functions/ruby/app.rb
|
215
215
|
- lib/souls/cli/create/templates/functions/ruby/gemfile.rb
|
216
216
|
- lib/souls/cli/db/create_migration.rb
|
217
|
-
- lib/souls/cli/db/create_migration_rbs.rb
|
218
217
|
- lib/souls/cli/db/index.rb
|
219
218
|
- lib/souls/cli/db/model.rb
|
220
|
-
- lib/souls/cli/db/model_rbs.rb
|
221
219
|
- lib/souls/cli/db/rspec_model.rb
|
222
220
|
- lib/souls/cli/delete/application.rb
|
223
221
|
- lib/souls/cli/delete/connection.rb
|
224
|
-
- lib/souls/cli/delete/connection_rbs.rb
|
225
222
|
- lib/souls/cli/delete/edge.rb
|
226
|
-
- lib/souls/cli/delete/edge_rbs.rb
|
227
223
|
- lib/souls/cli/delete/index.rb
|
228
224
|
- lib/souls/cli/delete/job.rb
|
229
|
-
- lib/souls/cli/delete/job_rbs.rb
|
230
225
|
- lib/souls/cli/delete/manager.rb
|
231
|
-
- lib/souls/cli/delete/manager_rbs.rb
|
232
226
|
- lib/souls/cli/delete/migration_file.rb
|
233
227
|
- lib/souls/cli/delete/mutation.rb
|
234
|
-
- lib/souls/cli/delete/mutation_rbs.rb
|
235
228
|
- lib/souls/cli/delete/query.rb
|
236
|
-
- lib/souls/cli/delete/query_rbs.rb
|
237
229
|
- lib/souls/cli/delete/resolver.rb
|
238
|
-
- lib/souls/cli/delete/resolver_rbs.rb
|
239
230
|
- lib/souls/cli/delete/rspec_factory.rb
|
240
231
|
- lib/souls/cli/delete/rspec_job.rb
|
241
232
|
- lib/souls/cli/delete/rspec_manager.rb
|
@@ -243,7 +234,6 @@ files:
|
|
243
234
|
- lib/souls/cli/delete/rspec_query.rb
|
244
235
|
- lib/souls/cli/delete/rspec_resolver.rb
|
245
236
|
- lib/souls/cli/delete/type.rb
|
246
|
-
- lib/souls/cli/delete/type_rbs.rb
|
247
237
|
- lib/souls/cli/docker/index.rb
|
248
238
|
- lib/souls/cli/gcloud/compute/index.rb
|
249
239
|
- lib/souls/cli/gcloud/functions/index.rb
|
@@ -257,20 +247,13 @@ files:
|
|
257
247
|
- lib/souls/cli/gcloud/sql/index.rb
|
258
248
|
- lib/souls/cli/generate/application.rb
|
259
249
|
- lib/souls/cli/generate/connection.rb
|
260
|
-
- lib/souls/cli/generate/connection_rbs.rb
|
261
250
|
- lib/souls/cli/generate/edge.rb
|
262
|
-
- lib/souls/cli/generate/edge_rbs.rb
|
263
251
|
- lib/souls/cli/generate/index.rb
|
264
252
|
- lib/souls/cli/generate/job.rb
|
265
|
-
- lib/souls/cli/generate/job_rbs.rb
|
266
253
|
- lib/souls/cli/generate/manager.rb
|
267
|
-
- lib/souls/cli/generate/manager_rbs.rb
|
268
254
|
- lib/souls/cli/generate/mutation.rb
|
269
|
-
- lib/souls/cli/generate/mutation_rbs.rb
|
270
255
|
- lib/souls/cli/generate/query.rb
|
271
|
-
- lib/souls/cli/generate/query_rbs.rb
|
272
256
|
- lib/souls/cli/generate/resolver.rb
|
273
|
-
- lib/souls/cli/generate/resolver_rbs.rb
|
274
257
|
- lib/souls/cli/generate/rspec_factory.rb
|
275
258
|
- lib/souls/cli/generate/rspec_job.rb
|
276
259
|
- lib/souls/cli/generate/rspec_manager.rb
|
@@ -278,7 +261,6 @@ files:
|
|
278
261
|
- lib/souls/cli/generate/rspec_query.rb
|
279
262
|
- lib/souls/cli/generate/rspec_resolver.rb
|
280
263
|
- lib/souls/cli/generate/type.rb
|
281
|
-
- lib/souls/cli/generate/type_rbs.rb
|
282
264
|
- lib/souls/cli/github/index.rb
|
283
265
|
- lib/souls/cli/index.rb
|
284
266
|
- lib/souls/cli/init/index.rb
|
@@ -291,17 +273,14 @@ files:
|
|
291
273
|
- lib/souls/cli/sync/pubsub.rb
|
292
274
|
- lib/souls/cli/update/index.rb
|
293
275
|
- lib/souls/cli/update/mutation.rb
|
294
|
-
- lib/souls/cli/update/mutation_rbs.rb
|
295
276
|
- lib/souls/cli/update/resolver.rb
|
296
277
|
- lib/souls/cli/update/rspec_factory.rb
|
297
278
|
- lib/souls/cli/update/rspec_mutation.rb
|
298
279
|
- lib/souls/cli/update/rspec_resolver.rb
|
299
280
|
- lib/souls/cli/update/type.rb
|
300
|
-
- lib/souls/cli/update/type_rbs.rb
|
301
281
|
- lib/souls/cli/upgrade/config.rb
|
302
282
|
- lib/souls/cli/upgrade/gemfile.rb
|
303
283
|
- lib/souls/cli/upgrade/index.rb
|
304
|
-
- lib/souls/cli/upgrade/submodule.rb
|
305
284
|
- lib/souls/index.rb
|
306
285
|
- lib/souls/souls_path.rb
|
307
286
|
- lib/souls/utils/index.rb
|
@@ -332,5 +311,5 @@ rubygems_version: 3.3.3
|
|
332
311
|
signing_key:
|
333
312
|
specification_version: 4
|
334
313
|
summary: Ruby Serverless Framework 'SOULs' | Ruby サーバーレスフレームワーク SOULs. Powered by
|
335
|
-
Ruby GraphQL,
|
314
|
+
Ruby GraphQL, Active Record, RSpec, RuboCop, and Google Cloud.
|
336
315
|
test_files: []
|
@@ -1,25 +0,0 @@
|
|
1
|
-
module SOULs
|
2
|
-
class DB < Thor
|
3
|
-
desc "create_migration_rbs [CLASS_NAME]", "Generate ActiveRecord Migration's RBS Template"
|
4
|
-
def create_migration_rbs(class_name)
|
5
|
-
file_path = ""
|
6
|
-
Dir.chdir(SOULs.get_mother_path.to_s) do
|
7
|
-
file_dir = "./sig/api/db/migrate"
|
8
|
-
FileUtils.mkdir_p(file_dir) unless Dir.exist?(file_dir)
|
9
|
-
pluralized_class_name = class_name.underscore.pluralize
|
10
|
-
file_path = "#{file_dir}/create_#{pluralized_class_name}.rbs"
|
11
|
-
File.open(file_path, "w") do |f|
|
12
|
-
f.write(<<~TEXT)
|
13
|
-
class Create#{pluralized_class_name.camelize}
|
14
|
-
def change: () -> untyped
|
15
|
-
def create_table: (:#{pluralized_class_name}) { (untyped) -> untyped } -> untyped
|
16
|
-
def add_index: (:#{pluralized_class_name}, *untyped) -> untyped
|
17
|
-
end
|
18
|
-
TEXT
|
19
|
-
end
|
20
|
-
SOULs::Painter.create_file(file_path.to_s)
|
21
|
-
end
|
22
|
-
file_path
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
@@ -1,22 +0,0 @@
|
|
1
|
-
module SOULs
|
2
|
-
class DB < Thor
|
3
|
-
desc "model_rbs [CLASS_NAME]", "Generate GraphQL Model RBS from schema.rb"
|
4
|
-
def model_rbs(class_name)
|
5
|
-
file_path = ""
|
6
|
-
Dir.chdir(SOULs.get_mother_path.to_s) do
|
7
|
-
file_dir = "./sig/api/app/models/"
|
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}.rbs"
|
11
|
-
File.open(file_path, "w") do |f|
|
12
|
-
f.write(<<~TEXT)
|
13
|
-
class #{singularized_class_name.camelize} < ActiveRecord::Base
|
14
|
-
end
|
15
|
-
TEXT
|
16
|
-
end
|
17
|
-
SOULs::Painter.create_file(file_path.to_s)
|
18
|
-
end
|
19
|
-
file_path
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
@@ -1,16 +0,0 @@
|
|
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
|
-
singularized_class_name = class_name.underscore.singularize
|
8
|
-
file_dir = "./sig/api/app/graphql/types/connections/"
|
9
|
-
file_path = "#{file_dir}#{singularized_class_name}_connection.rbs"
|
10
|
-
FileUtils.rm_f(file_path)
|
11
|
-
SOULs::Painter.delete_file(file_path.to_s)
|
12
|
-
end
|
13
|
-
file_path
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
@@ -1,15 +0,0 @@
|
|
1
|
-
module SOULs
|
2
|
-
class Delete < Thor
|
3
|
-
desc "edge_rbs [CLASS_NAME]", "Delete GraphQL Edge RBS"
|
4
|
-
def edge_rbs(class_name)
|
5
|
-
Dir.chdir(SOULs.get_mother_path.to_s) do
|
6
|
-
file_dir = "./sig/api/app/graphql/types/edges/"
|
7
|
-
singularized_class_name = class_name.underscore.singularize
|
8
|
-
file_path = "#{file_dir}#{singularized_class_name}_edge.rbs"
|
9
|
-
FileUtils.rm_f(file_path)
|
10
|
-
SOULs::Painter.delete_file(file_path)
|
11
|
-
file_path
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|