souls 0.40.3 → 0.41.3

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: 51159a85b2486d7b97dec78e107c883a00675a62dad2f0c38ecef3a0bcea3769
4
- data.tar.gz: 325e1edba536b1f0891e10ce4f03d1301da032aaf06ca45d15a2596f147fb329
3
+ metadata.gz: ef9f372f2dba8df38bef5a84fc22fa4067ba65462012e7ca4b4e4ede7c20285d
4
+ data.tar.gz: a907baf558de2b4194770cb0767dbc33f4cc9f3335a84096ade0d0904204e93d
5
5
  SHA512:
6
- metadata.gz: 1d18344b1a54e6e555f1103d1409c80b1abb9a883d61856b30ebc91d39f8535b238275b1875ff04f0096902856e8ffae0b16aa5f83aa4cff7003f623cca3540e
7
- data.tar.gz: 0320ec98a816d0ca260067e93049347fe05953cdd1a994e81c58d17bb0557a324b6c3eb36055b9b3e91a6b550cca7404e5c8ffb32e7d0678a95884830a95babd
6
+ metadata.gz: ad4dda7083db8c61b767567407af20701d4f9e8e0a6b3f75d16bd39fe59be56819c3fa9918edcf73693ead3d27226b80e9e745e731319abb0f92103af2a089a7
7
+ data.tar.gz: ee9b5c0ea15eb5484a78ec9237c7c557809fff6813805d2b9cbf65e246be7b21b073b557acd2612efea0672c18edfcdc47ff20f517ffb2835caf2a5ef4ab5e59
data/exe/souls CHANGED
@@ -135,24 +135,12 @@ begin
135
135
  when "release"
136
136
  Souls::Release.gem_release
137
137
  when "sync"
138
- target = ARGV[1]
139
- case target
140
- when "model", "m"
141
- status = Paint["Syncing Models...", :yellow]
142
- Whirly.start(spinner: "clock", interval: 420, stop: "🎉") do
143
- Whirly.status = status
144
- Souls::Sync.model
145
- Whirly.status = Paint["API and Workers Models Synced!", :green]
146
- end
147
- when "pubsub"
148
- status = Paint["Syncing PubSub...", :yellow]
149
- Whirly.start(spinner: "clock", interval: 420, stop: "🎉") do
150
- Whirly.status = status
151
- Souls::Sync.pubsub
152
- Whirly.status = Paint["Workers and Google Cloud PubSub Synced!", :green]
153
- end
154
- else
155
- puts(Paint["Comannd doesn't exist.Check you command again!...", :red])
138
+ method_name = ARGV[1]
139
+ status = Paint["Syncing Files...", :yellow]
140
+ Whirly.start(spinner: "clock", interval: 420, stop: "🎉") do
141
+ Whirly.status = status
142
+ Souls::Sync.public_send(method_name)
143
+ Whirly.status = Paint["Synced!", :green]
156
144
  end
157
145
  when "create"
158
146
  service_name = ARGV[1]
@@ -2,7 +2,7 @@ module Souls
2
2
  module Gcloud
3
3
  module Run
4
4
  class << self
5
- def awake(app_name: "souls-app", url: "")
5
+ def awake(app_name: "", url: "")
6
6
  app_name = Souls.configuration.app if app_name.blank?
7
7
  system(
8
8
  "gcloud scheduler jobs create http #{app_name}-awake
@@ -0,0 +1,46 @@
1
+ module Souls
2
+ module Sync
3
+ class << self
4
+ def conf
5
+ update_conf
6
+ update_conf(strain: "api")
7
+ end
8
+
9
+ def update_conf(strain: "mother")
10
+ workers = Souls.configuration.workers
11
+ file_path = strain == "mother" ? "config/souls.rb" : "apps/api/config/souls.rb"
12
+ new_file_path = "souls.rb"
13
+ worker_switch = false
14
+ File.open(new_file_path, "w") do |new_line|
15
+ File.open(file_path, "r") do |f|
16
+ f.each_line do |line|
17
+ worker_switch = true if line.include?("config.workers")
18
+ next if line.strip == "end"
19
+
20
+ new_line.write(line) unless worker_switch
21
+
22
+ next unless worker_switch
23
+
24
+ new_line.write(" config.workers = [\n")
25
+ workers.each do |worker|
26
+ endpoint = Souls::Gcloud::Run.get_endpoint(worker_name: worker[:name])
27
+ new_line.write(<<-TEXT)
28
+ {
29
+ name: "#{worker[:name]}",
30
+ endpoint: "#{endpoint}/endpoint",
31
+ port: #{worker[:port]}
32
+ },
33
+ TEXT
34
+ end
35
+ break
36
+ end
37
+ end
38
+ new_line.write(<<-TEXT)
39
+ ]
40
+ end
41
+ TEXT
42
+ end
43
+ end
44
+ end
45
+ end
46
+ end
@@ -1,3 +1,4 @@
1
1
  require "google/cloud/pubsub"
2
2
  require_relative "./model"
3
3
  require_relative "./pubsub"
4
+ require_relative "./conf"
@@ -24,10 +24,10 @@ module Souls
24
24
 
25
25
  workers.each do |key, value|
26
26
  if value == 1
27
- create_topic(topic_id: key)
28
- create_push_subscription(topic_id: key)
27
+ create_topic(topic_id: key.to_s)
28
+ create_push_subscription(topic_id: key.to_s)
29
29
  end
30
- delete_topic(topic_id: key) if value == -1
30
+ delete_topic(topic_id: key.to_s) if value == -1
31
31
  end
32
32
  workers
33
33
  end
@@ -49,7 +49,7 @@ module Souls
49
49
  require("#{Souls.get_mother_path}/config/souls")
50
50
  worker_name = topic_id.split("_")[0]
51
51
 
52
- subscription_id = "#{topic_id}-sub"
52
+ subscription_id = "#{topic_id}_sub"
53
53
  endpoint = ""
54
54
  worker_paths = Souls.configuration.workers
55
55
  worker_paths.each do |worker|
data/lib/souls/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module Souls
2
- VERSION = "0.40.3".freeze
2
+ VERSION = "0.41.3".freeze
3
3
  public_constant :VERSION
4
4
  end
@@ -1 +1 @@
1
- 0.19.3
1
+ 0.20.3
@@ -1 +1 @@
1
- 0.19.3
1
+ 0.20.3
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.40.3
4
+ version: 0.41.3
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-04 00:00:00.000000000 Z
13
+ date: 2021-09-06 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activesupport
@@ -152,6 +152,7 @@ files:
152
152
  - lib/souls/cli/index.rb
153
153
  - lib/souls/cli/release/index.rb
154
154
  - lib/souls/cli/release/release.rb
155
+ - lib/souls/cli/sync/conf.rb
155
156
  - lib/souls/cli/sync/index.rb
156
157
  - lib/souls/cli/sync/model.rb
157
158
  - lib/souls/cli/sync/pubsub.rb
@@ -174,7 +175,7 @@ metadata:
174
175
  homepage_uri: https://souls.elsoul.nl
175
176
  source_code_uri: https://github.com/elsoul/souls
176
177
  changelog_uri: https://github.com/elsoul/souls
177
- post_install_message:
178
+ post_install_message:
178
179
  rdoc_options: []
179
180
  require_paths:
180
181
  - lib
@@ -190,7 +191,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
190
191
  version: '0'
191
192
  requirements: []
192
193
  rubygems_version: 3.2.22
193
- signing_key:
194
+ signing_key:
194
195
  specification_version: 4
195
196
  summary: SOULs はサーバーレスフルスタックフレームワークです。柔軟な Ruby GraphQL API と Worker はルーティングの必要がありません。
196
197
  クラウド環境への自動デプロイ、CI/CD ワークフローを標準装備。開発者がビジネスロジックに集中し、楽しくコードが書けるような環境を目指しています。