souls 0.53.3 → 0.54.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: e40337225252207ee584a0792eb682563c6ff954e52f3e5da2f149556472028d
4
- data.tar.gz: 4ea2367b590925117d927bf9e0098d11d93e0ad8e407f48dad8a630628147cb9
3
+ metadata.gz: f3aff8743cd6a7080752c35676b1350aa519a18bd46643d086f16933b42eb13b
4
+ data.tar.gz: e1b9ce625e9a5b90dd9a5892d6263b5cde76b86e33d110a7205a015cf735d759
5
5
  SHA512:
6
- metadata.gz: 15c47b58b66cf2a6765baca1027580ab3850ca8687c8e443323a1d37f1026a70c148184d86eb39d550e0f053765e63c8b53b493a700d7ceea9fdad7305fdef2c
7
- data.tar.gz: cc5b188f99c0a82572c9a4f3abefd1ec743d3e973111a329b7765737967c90d8cee5f9cd58dcd4b8ff68c3f8ac771022142b97ca55584d87a1dc96579c972133
6
+ metadata.gz: ed4b2fdfcbef0f9821ae3b3747acdc9e67645b00baf4d67861f1f67ed9a7b87aa620ac4c16e631d527cb4e1624a3e7412616166b5c6a1ffe13f0bf25cf7bd36f
7
+ data.tar.gz: 75b8be0b7cbcfecb026dc500e0d0efca3f14871b99c6a2c5960566995f6153f51aabedfe4fecdbc51a2e9674c16cb4fc8d391771b2dbd1c1413d6735b3d83e86
@@ -17,6 +17,7 @@ module Souls
17
17
  mutation(singularized_class_name)
18
18
  policy(singularized_class_name)
19
19
  rspec_policy(singularized_class_name)
20
+ true
20
21
  rescue Thor::Error => e
21
22
  raise(Thor::Error, e)
22
23
  end
@@ -25,15 +26,16 @@ module Souls
25
26
  def scaffold_all
26
27
  puts(Paint["Let's Go SOULs AUTO CRUD Assist!\n", :cyan])
27
28
  Souls.get_tables.each do |table|
28
- Souls::Api::Generate.scaffold(class_name: table.singularize)
29
+ Souls::Generate.new.scaffold(table.singularize)
29
30
  puts(Paint["Generated #{table.camelize} CRUD Files\n", :yellow])
30
31
  end
32
+ true
31
33
  rescue Thor::Error => e
32
34
  raise(Thor::Error, e)
33
35
  end
34
36
 
35
37
  desc "delete_all [CLASS_NAME]", "Generate Scaffold All Tables from schema.rb"
36
- def delete_all(class_name: "user")
38
+ def delete_all(class_name)
37
39
  singularized_class_name = class_name.singularize.underscore
38
40
  pluralized_class_name = class_name.pluralize.underscore
39
41
  FileUtils.rm("./app/models/#{singularized_class_name}.rb")
@@ -8,6 +8,6 @@ module Souls
8
8
  desc "update [COMMAND]", "souls api update Commands"
9
9
  subcommand "update", Update
10
10
 
11
- map "g" => :generate
11
+ map g: :generate
12
12
  end
13
13
  end
@@ -18,6 +18,7 @@ module Souls
18
18
  mother_procfile(worker_name: options[:name])
19
19
  souls_config_init(worker_name: options[:name])
20
20
  end
21
+ true
21
22
  rescue Thor::Error => e
22
23
  raise(Thor::Error, e)
23
24
  end
@@ -10,6 +10,7 @@ module Souls
10
10
  system("rake db:migrate")
11
11
  system("rake db:migrate RACK_ENV=test")
12
12
  end
13
+ true
13
14
  rescue Thor::Error => e
14
15
  raise(Thor::Error, e)
15
16
  end
@@ -32,6 +32,12 @@ module Souls
32
32
  raise(Thor::Error, e)
33
33
  end
34
34
 
35
+ desc "config_set", "gcloud config set"
36
+ def config_set
37
+ project_id = Souls.configuration.project_id
38
+ system("gcloud config set project #{project_id}")
39
+ end
40
+
35
41
  desc "enable_permissions", "Enable Google Cloud APIs for SOULs Framework"
36
42
  def enable_permissions
37
43
  system("gcloud services enable compute.googleapis.com")
@@ -13,8 +13,8 @@ module Souls
13
13
  end
14
14
 
15
15
  desc "list", "Show Google Cloud Run List"
16
- def list(project_id: "")
17
- project_id = Souls.configuration.project_id if project_id.blank?
16
+ def list
17
+ project_id = Souls.configuration.project_id
18
18
  system("gcloud run services list --project #{project_id} --platform managed")
19
19
  rescue Thor::Error => e
20
20
  raise(Thor::Error, e)
@@ -22,8 +22,10 @@ module Souls
22
22
 
23
23
  desc "get_endpoint", "Show Worker's Endpoint"
24
24
  def get_endpoint(worker_name: "")
25
- project_id = Souls.configuration.project_id if project_id.blank?
26
- `gcloud run services list --project #{project_id} --platform managed | grep #{worker_name} | awk '{print $4}'`
25
+ app_name = Souls.configuration.app
26
+ project_id = Souls.configuration.project_id
27
+ `gcloud run services list --project #{project_id}
28
+ --platform managed | grep #{app_name}-souls-#{worker_name} | awk '{print $4}'`
27
29
  rescue Thor::Error => e
28
30
  raise(Thor::Error, e)
29
31
  end
@@ -2,6 +2,7 @@ module Souls
2
2
  class Sync < Thor
3
3
  desc "conf", "Sync config/souls.rb Endpoint with Google Cloud Run"
4
4
  def conf
5
+ Souls::Gcloud.new.config_set
5
6
  update_conf
6
7
  update_conf(strain: "api")
7
8
  puts(
@@ -2,6 +2,7 @@ module Souls
2
2
  class Sync < Thor
3
3
  desc "pubsub", "Sync Worker Jobs & Google Cloud Pubsub Subscriptions"
4
4
  def pubsub
5
+ Souls::Gcloud.new.config_set
5
6
  get_topics(workers: get_workers)
6
7
  puts(Paint["All Jobs Synced with PubSub Subscription!", :green])
7
8
  rescue Thor::Error => e
@@ -11,6 +12,7 @@ module Souls
11
12
  private
12
13
 
13
14
  def get_topics(workers: {})
15
+ app_name = Souls.configuration.app
14
16
  project_id = Souls.configuration.project_id
15
17
  pubsub = Google::Cloud::Pubsub.new
16
18
  topics = pubsub.topics
@@ -20,6 +22,8 @@ module Souls
20
22
  topic.name.gsub("projects/#{project_id}/topics/", "")
21
23
  end
22
24
 
25
+ topic_names.select { |n| n.include?("#{app_name}_souls_") }
26
+
23
27
  topic_names.each do |name|
24
28
  value = workers[name.to_sym] || 0
25
29
  workers[name.to_sym] = value - 1
@@ -36,23 +40,29 @@ module Souls
36
40
  end
37
41
 
38
42
  def create_topic(topic_id: "mailer")
43
+ app_name = Souls.configuration.app
39
44
  pubsub = Google::Cloud::Pubsub.new
40
- topic = pubsub.create_topic(topic_id)
45
+ topic_name = "#{app_name}_souls_#{topic_id}"
46
+ topic = pubsub.create_topic(topic_name.to_s)
41
47
  puts("Topic #{topic.name} created.")
42
48
  end
43
49
 
44
50
  def delete_topic(topic_id: "mailer")
51
+ app_name = Souls.configuration.app
45
52
  pubsub = Google::Cloud::Pubsub.new
46
- topic = pubsub.topic(topic_id)
53
+ topic_name = "#{app_name}_souls_#{topic_id}"
54
+ topic = pubsub.topic(topic_name.to_s)
47
55
  topic.delete
48
- puts("Topic #{topic_id} deleted.")
56
+ puts("Topic #{topic_name} deleted.")
49
57
  end
50
58
 
51
59
  def create_push_subscription(topic_id: "mailer")
52
60
  require("#{Souls.get_mother_path}/config/souls")
53
61
  worker_name = topic_id.split("_")[0]
62
+ app_name = Souls.configuration.app
63
+ topic_name = "#{app_name}_souls_#{topic_id}"
54
64
 
55
- subscription_id = "#{topic_id}_sub"
65
+ subscription_id = "#{topic_name}_sub"
56
66
  endpoint = ""
57
67
  worker_paths = Souls.configuration.workers
58
68
  worker_paths.each do |worker|
data/lib/souls/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module Souls
2
- VERSION = "0.53.3".freeze
2
+ VERSION = "0.54.1".freeze
3
3
  public_constant :VERSION
4
4
  end
@@ -1 +1 @@
1
- 0.32.3
1
+ 0.33.1
@@ -1 +1 @@
1
- 0.32.3
1
+ 0.33.1
@@ -5,6 +5,6 @@ module Souls
5
5
  desc "generate [COMMAND]", "souls worker generate Commands"
6
6
  subcommand "generate", Generate
7
7
 
8
- map "g" => :generate
8
+ map g: :generate
9
9
  end
10
10
  end
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.53.3
4
+ version: 0.54.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-09-20 00:00:00.000000000 Z
13
+ date: 2021-09-21 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activesupport
@@ -192,7 +192,7 @@ metadata:
192
192
  homepage_uri: https://souls.elsoul.nl
193
193
  source_code_uri: https://github.com/elsoul/souls
194
194
  changelog_uri: https://github.com/elsoul/souls
195
- post_install_message:
195
+ post_install_message:
196
196
  rdoc_options: []
197
197
  require_paths:
198
198
  - lib
@@ -208,7 +208,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
208
208
  version: '0'
209
209
  requirements: []
210
210
  rubygems_version: 3.2.22
211
- signing_key:
211
+ signing_key:
212
212
  specification_version: 4
213
213
  summary: SOULs はサーバーレスフルスタックフレームワークです。柔軟な Ruby GraphQL API と Worker はルーティングの必要がありません。
214
214
  クラウド環境への自動デプロイ、CI/CD ワークフローを標準装備。開発者がビジネスロジックに集中し、楽しくコードが書けるような環境を目指しています。