souls 0.40.3 → 0.41.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 51159a85b2486d7b97dec78e107c883a00675a62dad2f0c38ecef3a0bcea3769
4
- data.tar.gz: 325e1edba536b1f0891e10ce4f03d1301da032aaf06ca45d15a2596f147fb329
3
+ metadata.gz: df2f39add13ab11ad55c08ea91fb0c36bb310360c78ec6afd39456cdb6055f0d
4
+ data.tar.gz: 5feca9108b6cdaa7fdc84064f58aba6213c42ea803333180f49dbfceca33055a
5
5
  SHA512:
6
- metadata.gz: 1d18344b1a54e6e555f1103d1409c80b1abb9a883d61856b30ebc91d39f8535b238275b1875ff04f0096902856e8ffae0b16aa5f83aa4cff7003f623cca3540e
7
- data.tar.gz: 0320ec98a816d0ca260067e93049347fe05953cdd1a994e81c58d17bb0557a324b6c3eb36055b9b3e91a6b550cca7404e5c8ffb32e7d0678a95884830a95babd
6
+ metadata.gz: 2206bc5906aaa1530d7ec2207f53cf9ddb4ad4930e527609cac18fd591de0c08d4773fc6cf53289928daf897b424f334539a48d9b8a53aeea45a8c843c85a721
7
+ data.tar.gz: 0fbc64fbedb1bcedb240b042310c6e3ae72b89b03f83909b2ef3e90c386f02e9e9f5dcb032abe140dc2762ca1eaa4fa808cbd2c9aa85fa8e1fb30961c7c808a9
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"
data/lib/souls/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module Souls
2
- VERSION = "0.40.3".freeze
2
+ VERSION = "0.41.0".freeze
3
3
  public_constant :VERSION
4
4
  end
@@ -1 +1 @@
1
- 0.19.3
1
+ 0.20.0
@@ -1 +1 @@
1
- 0.19.3
1
+ 0.20.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: 0.40.3
4
+ version: 0.41.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - POPPIN-FUMI
@@ -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