souls 1.14.1 → 1.15.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -1
- data/lib/souls/cli/create/functions.rb +13 -0
- data/lib/souls/cli/create/template/functions_app.rb +0 -1
- data/lib/souls/cli/create/template/functions_env_yaml.rb +8 -0
- data/lib/souls/cli/create/template/functions_gemfile.rb +0 -1
- data/lib/souls/cli/gcloud/functions/index.rb +15 -1
- data/lib/souls/cli/generate/resolver_rbs.rb +17 -15
- data/lib/souls/cli/init/index.rb +1 -1
- data/lib/souls/utils/index.rb +3 -2
- 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 +6 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 807459b9a18818a0fb8f2db3a254ac6de39434cffe7b64b99c4518489e3f87f6
|
4
|
+
data.tar.gz: 0f14f0961aa529b3ce62d0dbbe9ab1ebc05274c4938f744f0d64339d8dc36c10
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6cb682da5011c6621d48bb3e463f0aa376fe4f96194b509b9fccc8d01ba1522749a38e3cb09fdf857f8b8c3ec3b565576ae3f575e3008c9e0fe6c5eae627fa42
|
7
|
+
data.tar.gz: 8716a72aafd55cb84feb4bf18074157cc26e3b59f2e3e8688c488259acecac1ff00b025f3c578351cf4034f99de9266b28e4400034c55c914c049e25953a1b4f
|
data/README.md
CHANGED
@@ -52,10 +52,11 @@ Powered by Ruby GraphQL, RBS/Steep, Active Record, RSpec, RuboCop, and Google Cl
|
|
52
52
|
|
53
53
|
![SOULs Architecture](https://souls.elsoul.nl/imgs/docs/SOULs-architecture.jpg)
|
54
54
|
|
55
|
-
SOULs creates
|
55
|
+
SOULs creates 3 types of App.
|
56
56
|
|
57
57
|
1. API - GraphQL (Ruby) - Simple API - Cloud Run
|
58
58
|
2. Worker - Google Pub/Sub Messaging Worker API (Ruby) - Cloud Run
|
59
|
+
3. Functions - Google Cloud Functions
|
59
60
|
|
60
61
|
## Ruby type checking
|
61
62
|
The SOULs framework uses RBS / Steep, which appeared in Ruby 3.0.
|
@@ -85,6 +86,7 @@ It is a development environment where you can immediately notice the mistakes th
|
|
85
86
|
## Cloud Infrastructure
|
86
87
|
|
87
88
|
- [Google Cloud Run](https://cloud.google.com/run)
|
89
|
+
- [Google Cloud Functions](https://cloud.google.com/functions)
|
88
90
|
- [Google Cloud SQL](https://cloud.google.com/sql)
|
89
91
|
- [Google Cloud Pub/Sub](https://cloud.google.com/pubsub)
|
90
92
|
- [Google Cloud Storage](https://cloud.google.com/run)
|
@@ -1,11 +1,13 @@
|
|
1
1
|
require_relative "./template/functions_app"
|
2
2
|
require_relative "./template/functions_gemfile"
|
3
|
+
require_relative "./template/functions_env_yaml"
|
3
4
|
module Souls
|
4
5
|
class Create < Thor
|
5
6
|
desc "functions", "Create SOULs functions"
|
6
7
|
def functions
|
7
8
|
create_app_file
|
8
9
|
create_gemfile
|
10
|
+
create_env_yaml
|
9
11
|
end
|
10
12
|
|
11
13
|
private
|
@@ -31,5 +33,16 @@ module Souls
|
|
31
33
|
Souls::Painter.create_file(file_path)
|
32
34
|
file_path
|
33
35
|
end
|
36
|
+
|
37
|
+
def create_env_yaml
|
38
|
+
file_dir = "./apps/functions"
|
39
|
+
FileUtils.mkdir_p(file_dir) unless Dir.exist?(file_dir)
|
40
|
+
file_path = "#{file_dir}/.env.yaml"
|
41
|
+
raise(StandardError, "Already Exist!") if File.exist?(file_path)
|
42
|
+
|
43
|
+
File.write(file_path, Template.functions_env_yaml)
|
44
|
+
Souls::Painter.create_file(file_path)
|
45
|
+
file_path
|
46
|
+
end
|
34
47
|
end
|
35
48
|
end
|
@@ -8,12 +8,26 @@ module Souls
|
|
8
8
|
system(
|
9
9
|
"
|
10
10
|
gcloud functions deploy souls_functions --project=#{project_id} \
|
11
|
-
--runtime ruby27 --trigger-http --allow-unauthenticated
|
11
|
+
--runtime ruby27 --trigger-http --allow-unauthenticated --env-vars-file .env.yaml
|
12
12
|
"
|
13
13
|
)
|
14
14
|
end
|
15
15
|
end
|
16
16
|
|
17
|
+
desc "describe", "Describe SOULs Functions"
|
18
|
+
def describe
|
19
|
+
require(Souls.get_mother_path.to_s + "/config/souls")
|
20
|
+
project_id = Souls.configuration.project_id
|
21
|
+
system("gcloud functions describe souls_functions --project=#{project_id}")
|
22
|
+
end
|
23
|
+
|
24
|
+
desc "url", "Get SOULs Functions URL"
|
25
|
+
def url
|
26
|
+
require(Souls.get_mother_path.to_s + "/config/souls")
|
27
|
+
project_id = Souls.configuration.project_id
|
28
|
+
system("gcloud functions describe souls_functions --project=#{project_id}| grep url")
|
29
|
+
end
|
30
|
+
|
17
31
|
desc "dev", "Check SOULs Functions dev"
|
18
32
|
def dev
|
19
33
|
Dir.chdir(Souls.get_functions_path.to_s) do
|
@@ -12,22 +12,24 @@ module Souls
|
|
12
12
|
|
13
13
|
File.open(file_path, "w") do |f|
|
14
14
|
f.write(<<~TEXT)
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
15
|
+
module Resolvers
|
16
|
+
class BaseResolver
|
17
|
+
end
|
18
|
+
class #{singularized_class_name.camelize}Search < BaseResolver
|
19
|
+
include SearchObject
|
20
|
+
def self.scope: () ?{ () -> nil } -> [Hash[Symbol, untyped]]
|
21
|
+
def self.type: (*untyped) -> String
|
22
|
+
def self.option: (:filter, type: untyped, with: :apply_filter) -> String
|
23
|
+
def self.description: (String) -> String
|
24
|
+
def self.types: (*untyped) -> String
|
25
|
+
def decode_global_key: (String value) -> Integer
|
26
|
+
def apply_filter: (untyped scope, untyped value) -> untyped
|
26
27
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
28
|
+
class #{singularized_class_name.camelize}Filter
|
29
|
+
String: String
|
30
|
+
Boolean: Boolean
|
31
|
+
Integer: Integer
|
32
|
+
end
|
31
33
|
end
|
32
34
|
end
|
33
35
|
TEXT
|
data/lib/souls/cli/init/index.rb
CHANGED
data/lib/souls/utils/index.rb
CHANGED
@@ -1,9 +1,10 @@
|
|
1
1
|
module Souls
|
2
2
|
module Utils
|
3
3
|
def get_mother_path
|
4
|
-
|
4
|
+
current_dir = Dir.pwd
|
5
|
+
file_array = current_dir.split("/")
|
5
6
|
mother_dir_num = file_array.rindex("apps")
|
6
|
-
mother_dir_num ? file_array.
|
7
|
+
mother_dir_num ? file_array.each_slice(mother_dir_num).to_a[0].join("/") : current_dir
|
7
8
|
end
|
8
9
|
|
9
10
|
def get_functions_path
|
data/lib/souls/version.rb
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.
|
1
|
+
1.15.1
|
@@ -1 +1 @@
|
|
1
|
-
1.
|
1
|
+
1.15.1
|
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: 1.
|
4
|
+
version: 1.15.1
|
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-12-
|
13
|
+
date: 2021-12-26 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activesupport
|
@@ -177,6 +177,7 @@ files:
|
|
177
177
|
- lib/souls/cli/create/functions.rb
|
178
178
|
- lib/souls/cli/create/index.rb
|
179
179
|
- lib/souls/cli/create/template/functions_app.rb
|
180
|
+
- lib/souls/cli/create/template/functions_env_yaml.rb
|
180
181
|
- lib/souls/cli/create/template/functions_gemfile.rb
|
181
182
|
- lib/souls/cli/db/create_migration.rb
|
182
183
|
- lib/souls/cli/db/create_migration_rbs.rb
|
@@ -277,7 +278,7 @@ licenses:
|
|
277
278
|
- Apache-2.0
|
278
279
|
metadata:
|
279
280
|
rubygems_mfa_required: 'true'
|
280
|
-
post_install_message:
|
281
|
+
post_install_message:
|
281
282
|
rdoc_options: []
|
282
283
|
require_paths:
|
283
284
|
- lib
|
@@ -293,7 +294,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
293
294
|
version: '0'
|
294
295
|
requirements: []
|
295
296
|
rubygems_version: 3.2.32
|
296
|
-
signing_key:
|
297
|
+
signing_key:
|
297
298
|
specification_version: 4
|
298
299
|
summary: Ruby Serverless Framework 'SOULs' | Ruby サーバーレスフレームワーク SOULs. Powered by
|
299
300
|
Ruby GraphQL, RBS/Steep, Active Record, RSpec, RuboCop, and Google Cloud.
|