souls 0.48.1 → 0.48.2

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: fa05b4d9e6f1e1dcfa5dc51d60048bf7724cf9bec95febac0426b3a6ea362b9f
4
- data.tar.gz: edcac235aa2f1f760df232a4a2e77805428f1380a26dbafc52257ffa2f7d3c81
3
+ metadata.gz: 58f55a316abed31c0fe01f91343cb1922319cf65d6840f32bbb630a87fe002c2
4
+ data.tar.gz: 0b0fe15d1c23524def03a6457ab63b1dc78675f596fc015b3f8b35b674d215a3
5
5
  SHA512:
6
- metadata.gz: 302038e0b74ebe5552a08708c1f0d483ce0709ec75fee545bed16d056497fcd452d35d3d9f7b7b34b1cc43962fd5117cebe5b95f74f55139ab52e63ec74eafb3
7
- data.tar.gz: 6ee9dc50622a972abc5a2d68b6c006babc4f50c3eb12267697a02e2ebd381e8f0ff635da1e4dadb5b003369f8c7c18dd752b9c9304f7a866b88f25dc3a668176
6
+ metadata.gz: 45a71d9f2e3fc0d1efe7737df6ff09c55600363643a5d8163e4818e159e0bf7fb7e7679bfb76e1405e034cc105efb4b80efe2ec59945f21e5382446910f048f4
7
+ data.tar.gz: 200dfcc6a26f1c94503ebbc8afae3c7db8f1d2740e90bfe594c67a0e4c628d7e3d7b10a760c5c3616d3d9900859c1b16147a5bbe945c308f24824a8aeb810089
data/exe/souls CHANGED
@@ -10,37 +10,39 @@ begin
10
10
  case souls_command
11
11
  when "api"
12
12
  api_command = ARGV[1]
13
- case api_command
14
- when "generate", "g"
15
- method_name = ARGV[2]
16
- class_name = ARGV[3]
17
- args = { class_name: class_name }
18
- args[:mutation] = ARGV[4] if ARGV.size > 4
19
- status = Paint["Running SOULs Generate Commands...", :yellow]
20
- Whirly.start(spinner: "clock", interval: 420, stop: "🎉") do
21
- Whirly.status = status
22
- Souls::Api::Generate.public_send(method_name, **args)
23
- Whirly.status = "Done!"
24
- end
25
- when "update"
26
- class_name = ARGV[2]
27
- status = Paint["Running SOULs Update Commands...", :yellow]
28
- Whirly.start(spinner: "clock", interval: 420, stop: "🎉") do
29
- Whirly.status = status
30
- Souls::Api::Update.create_mutation(class_name: class_name)
31
- Souls::Api::Update.update_mutation(class_name: class_name)
32
- Souls::Api::Update.resolver(class_name: class_name)
33
- Souls::Api::Update.type(class_name: class_name)
34
- Souls::Api::Update.rspec_factory(class_name: class_name)
35
- Souls::Api::Update.rspec_mutation(class_name: class_name)
36
- Souls::Api::Update.rspec_resolver(class_name: class_name)
37
- Whirly.status = "Done!"
13
+ Dir.chdir(Souls.get_api_path.to_s) do
14
+ case api_command
15
+ when "generate", "g"
16
+ method_name = ARGV[2]
17
+ class_name = ARGV[3]
18
+ args = { class_name: class_name }
19
+ args[:mutation] = ARGV[4] if ARGV.size > 4
20
+ status = Paint["Running SOULs Generate Commands...", :yellow]
21
+ Whirly.start(spinner: "clock", interval: 420, stop: "🎉") do
22
+ Whirly.status = status
23
+ Souls::Api::Generate.public_send(method_name, **args)
24
+ Whirly.status = "Done!"
25
+ end
26
+ when "update"
27
+ class_name = ARGV[2]
28
+ status = Paint["Running SOULs Update Commands...", :yellow]
29
+ Whirly.start(spinner: "clock", interval: 420, stop: "🎉") do
30
+ Whirly.status = status
31
+ Souls::Api::Update.create_mutation(class_name: class_name)
32
+ Souls::Api::Update.update_mutation(class_name: class_name)
33
+ Souls::Api::Update.resolver(class_name: class_name)
34
+ Souls::Api::Update.type(class_name: class_name)
35
+ Souls::Api::Update.rspec_factory(class_name: class_name)
36
+ Souls::Api::Update.rspec_mutation(class_name: class_name)
37
+ Souls::Api::Update.rspec_resolver(class_name: class_name)
38
+ Whirly.status = "Done!"
39
+ end
40
+ when "d", "delete"
41
+ class_name = ARGV[2]
42
+ Souls::Api::Generate.delete_all(class_name: class_name)
43
+ else
44
+ puts(Paint["Comannd doesn't exist.Check you command again!...", :red])
38
45
  end
39
- when "d", "delete"
40
- class_name = ARGV[2]
41
- Souls::Api::Generate.delete_all(class_name: class_name)
42
- else
43
- puts(Paint["Comannd doesn't exist.Check you command again!...", :red])
44
46
  end
45
47
  when "worker"
46
48
  api_command = ARGV[1]
@@ -204,20 +204,12 @@ end
204
204
  end
205
205
 
206
206
  def download_worker(worker_name: "mailer")
207
- raise(StandardError, "Can't use `worker` for worker. Change Name.") if worker_name == "worker"
208
-
209
- current_dir_name = FileUtils.pwd.to_s.match(%r{/([^/]+)/?$})[1]
210
- wrong_dir = %w[apps api worker]
211
- if wrong_dir.include?(current_dir_name)
212
- raise(StandardError, "You are at wrong directory!Go to Mother Directory!")
213
- end
214
-
215
207
  version = Souls.get_latest_version_txt(service_name: "worker").join(".")
216
208
  file_name = "worker-v#{version}.tgz"
217
209
  url = "https://storage.googleapis.com/souls-bucket/boilerplates/workers/#{file_name}"
218
210
  system("curl -OL #{url}")
219
- system("tar -zxvf ./#{file_name} -C ./apps/")
220
- system("mv apps/worker apps/#{worker_name}")
211
+ system("tar -zxvf ./#{file_name}")
212
+ system("mv ./worker apps/#{worker_name}")
221
213
  system("cp ./apps/api/config/database.yml ./apps/#{worker_name}/config/")
222
214
  FileUtils.rm(file_name)
223
215
  end
@@ -24,16 +24,26 @@ module Souls
24
24
  next unless worker_switch
25
25
 
26
26
  new_line.write(" config.workers = [\n")
27
- workers.each do |worker|
27
+ workers.each_with_index do |worker, i|
28
28
  base_url = Souls::Gcloud::Run.get_endpoint(worker_name: worker[:name])
29
29
  endpoint = Souls.configuration.endpoint
30
- new_line.write(<<-TEXT)
31
- {
32
- name: "#{worker[:name]}",
33
- endpoint: "#{base_url.strip}#{endpoint}",
34
- port: #{worker[:port]}
35
- },
36
- TEXT
30
+ if (i + 1) == workers.size
31
+ new_line.write(<<-TEXT)
32
+ {
33
+ name: "#{worker[:name]}",
34
+ endpoint: "#{base_url.strip}#{endpoint}",
35
+ port: #{worker[:port]}
36
+ }
37
+ TEXT
38
+ else
39
+ new_line.write(<<-TEXT)
40
+ {
41
+ name: "#{worker[:name]}",
42
+ endpoint: "#{base_url.strip}#{endpoint}",
43
+ port: #{worker[:port]}
44
+ },
45
+ TEXT
46
+ end
37
47
  end
38
48
  break
39
49
  end
data/lib/souls/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module Souls
2
- VERSION = "0.48.1".freeze
2
+ VERSION = "0.48.2".freeze
3
3
  public_constant :VERSION
4
4
  end
@@ -1 +1 @@
1
- 0.27.1
1
+ 0.27.2
@@ -1 +1 @@
1
- 0.27.1
1
+ 0.27.2
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.48.1
4
+ version: 0.48.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - POPPIN-FUMI