souls 1.14.1 → 1.15.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 86e9a0ba6f61532e0ceb30f68cbf47445b84e53c034366f287cb514be8c50bcb
4
- data.tar.gz: 01a9ad3ff6c9d73633041cd4f4befc197adf1bfefb55208cfb6793a27010ef9a
3
+ metadata.gz: 807459b9a18818a0fb8f2db3a254ac6de39434cffe7b64b99c4518489e3f87f6
4
+ data.tar.gz: 0f14f0961aa529b3ce62d0dbbe9ab1ebc05274c4938f744f0d64339d8dc36c10
5
5
  SHA512:
6
- metadata.gz: 5474dc7a392e012288a6db34b0f1a960a0c2452649a1b9146f8515aea9352fa4c67d30fb447fc388bbcb83260d665c2301edf23a608d214643ec970f37af5d12
7
- data.tar.gz: 49804c5f3b4b2ce9cf35290e948c8b3663c13a9f0b0b0791d5af1ae73b9966bf6d4675a015521327993bb2770acb35361b3815d74bdff929db7c9f8e20ba6cf7
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 2 types of App.
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
@@ -4,7 +4,6 @@ module Template
4
4
  require "functions_framework"
5
5
  require "sinatra/base"
6
6
  require "dotenv/load"
7
- require "souls"
8
7
 
9
8
  class App < Sinatra::Base
10
9
  get "/souls-functions-get/:name" do
@@ -0,0 +1,8 @@
1
+ module Template
2
+ def self.functions_env_yaml
3
+ <<~ENV
4
+ FOO: bar
5
+ BAZ: boo
6
+ ENV
7
+ end
8
+ end
@@ -6,7 +6,6 @@ module Template
6
6
  gem "dotenv", "2.7.6"
7
7
  gem "functions_framework", "~> 0.7"
8
8
  gem "sinatra", "2.1.0"
9
- gem "souls", "#{Souls::VERSION}"
10
9
 
11
10
  GEMFILE
12
11
  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
- class BaseResolver
16
- end
17
- class #{singularized_class_name.camelize}Search < BaseResolver
18
- include SearchObject
19
- def self.scope: () ?{ () -> nil } -> [Hash[Symbol, untyped]]
20
- def self.type: (*untyped) -> String
21
- def self.option: (:filter, type: untyped, with: :apply_filter) -> String
22
- def self.description: (String) -> String
23
- def self.types: (*untyped) -> String
24
- def decode_global_key: (String value) -> Integer
25
- def apply_filter: (untyped scope, untyped value) -> untyped
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
- class #{singularized_class_name.camelize}Filter < Souls::Types::BaseInputObject
28
- String: String
29
- Boolean: Boolean
30
- Integer: Integer
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
@@ -135,7 +135,7 @@ module Souls
135
135
  gem "rake", "13.0.6"
136
136
  gem "rspec", "3.10.0"
137
137
  gem "rubocop", "1.22.3"
138
- gem "sinatra-activerecord", "2.0.23"
138
+ gem "sinatra-activerecord", "2.0.25"
139
139
  gem "solargraph", "0.44.0"
140
140
  #{souls_gem}
141
141
  gem "steep", "0.46.0"
@@ -1,9 +1,10 @@
1
1
  module Souls
2
2
  module Utils
3
3
  def get_mother_path
4
- file_array = Dir.pwd.split("/")
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.slice(mother_dir_num).join("/") : file_array.join("/")
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,4 +1,4 @@
1
1
  module Souls
2
- VERSION = "1.14.1".freeze
2
+ VERSION = "1.15.1".freeze
3
3
  public_constant :VERSION
4
4
  end
@@ -1 +1 @@
1
- 1.14.1
1
+ 1.15.1
@@ -1 +1 @@
1
- 1.14.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.14.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-24 00:00:00.000000000 Z
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.