souls 1.18.8 → 1.19.3

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: ccc6f38c6e16930739571b46732d9f1e27d9e0278ad4c57abd273ef79dffa19b
4
- data.tar.gz: 14d7f3df6791e8904b1130eaf6ca1d785f50e67c64e491c3627e5e310ae02e6d
3
+ metadata.gz: d4bf137864959be7746651e84876c0519fdcf40b11bb87b09ac1f52b0a5c6fa7
4
+ data.tar.gz: e0e0ad235cf3aac9fa1588b0b7c147c0a55549e9aab455c9314d25ec7bed1d57
5
5
  SHA512:
6
- metadata.gz: 50193e52293af96dcc50f844e4feb731dcd6229cc22e6a980556def87935b4b41ff217203e92cf3d18d045c46b75b5273f16d191e7f8fb2b0978e86e676ff732
7
- data.tar.gz: 883acd81ccfbd9ab737cf495d765091d7da62d5dd8052cd3d2eff970384e1c2f97cbcefbcabe9e138adb5c82fe1ab1bfa5d490ffcb8ad5875e26b613c525a777
6
+ metadata.gz: 437ac90c2f77121b62b6f50a7b88219234ac261dba30dfb99e9961bf3e402c3e71d2252489cff14058701c0850c6238e633721a9ac7686d564da658b21aafbf7
7
+ data.tar.gz: 8268a01caf6ca481bc77e0977fa52a78359f68e0b2cfaa164a6e93c9ea4c0be08e29de27a600a025c836cd4337923c3e19bbe63ae08348ea921457d571b4194b
@@ -21,7 +21,7 @@ module SOULs
21
21
  version = prompt.select("Select Version?", supported_languages[runtime.downcase.to_sym].sort.reverse)
22
22
  version_string = "#{runtime_downcased}#{version.gsub('.', '')}"
23
23
  runtime_methods = get_runtime_create_method(runtime: runtime_downcased)
24
- file_dir = "./apps/cf_#{version_string}_#{function_name}"
24
+ file_dir = "./apps/cf-#{version_string}-#{function_name}"
25
25
  FileUtils.mkdir_p(file_dir) unless Dir.exist?(file_dir)
26
26
 
27
27
  runtime_methods.each do |method|
@@ -170,12 +170,12 @@ end
170
170
  bundle exec rake db:migrate RACK_ENV=test
171
171
  bundle exec rspec
172
172
 
173
- - name: Sync Tasks
174
- run: cd apps/#{worker_name} && souls gcloud scheduler sync_schedules --timezone=${{ secrets.TZ }}
175
-
176
173
  - name: Sync PubSub
177
174
  run: cd apps/#{worker_name} && souls sync pubsub
178
175
 
176
+ - name: Sync Tasks
177
+ run: cd apps/#{worker_name} && souls gcloud scheduler sync_schedules --timezone=${{ secrets.TZ }}
178
+
179
179
  - name: Configure Docker
180
180
  run: gcloud auth configure-docker --quiet
181
181
 
@@ -1,6 +1,7 @@
1
1
  module Template
2
2
  module Go
3
3
  def self.function(file_name)
4
+ file_name.underscore.camelize
4
5
  <<~APP
5
6
  // Package p contains an HTTP Cloud Function.
6
7
  package p
@@ -1,6 +1,7 @@
1
1
  module Template
2
2
  module Nodejs
3
3
  def self.index(file_name)
4
+ file_name.underscore.camelize(:lower)
4
5
  <<~APP
5
6
  const express = require('express');
6
7
  const bodyParser = require('body-parser');
@@ -1,6 +1,7 @@
1
1
  module Template
2
2
  module Python
3
3
  def self.main(file_name)
4
+ file_name.underscore
4
5
  <<~APP
5
6
  def #{file_name}(request):
6
7
  """Responds to any HTTP request.
@@ -5,12 +5,12 @@ module SOULs
5
5
  require(SOULs.get_mother_path.to_s + "/config/souls")
6
6
  project_id = SOULs.configuration.project_id
7
7
  current_dir = FileUtils.pwd.split("/").last
8
- unless current_dir.match?(/^cf_/)
8
+ unless current_dir.match?(/^cf-/)
9
9
  SOULs::Painter.error("You are at wrong dir!\nPlease go to `apps/functions` dir!")
10
10
  return false
11
11
  end
12
12
 
13
- runtime = current_dir.match(/cf_(\D+\d+)_/)[1]
13
+ runtime = current_dir.match(/cf-(\D+\d+)-/)[1]
14
14
  system(
15
15
  "
16
16
  gcloud functions deploy #{current_dir} --project=#{project_id} \
@@ -22,11 +22,12 @@ module SOULs
22
22
  desc "describe", "Describe SOULs Functions"
23
23
  def describe
24
24
  require(SOULs.get_mother_path.to_s + "/config/souls")
25
+ current_dir = FileUtils.pwd.split("/").last
25
26
  project_id = SOULs.configuration.project_id
26
- system("gcloud functions describe souls_functions --project=#{project_id}")
27
+ system("gcloud functions describe #{current_dir} --project=#{project_id}")
27
28
  end
28
29
 
29
- desc "delete", "Delete SOULs Functions"
30
+ desc "delete [name]", "Delete SOULs Functions"
30
31
  def delete(name)
31
32
  require(SOULs.get_mother_path.to_s + "/config/souls")
32
33
  project_id = SOULs.configuration.project_id
@@ -50,7 +51,7 @@ module SOULs
50
51
  require(SOULs.get_mother_path.to_s + "/config/souls")
51
52
  project_id = SOULs.configuration.project_id
52
53
  Dir.chdir(SOULs.get_mother_path.to_s) do
53
- souls_functions = Dir["apps/cf_*"]
54
+ souls_functions = Dir["apps/cf-*"]
54
55
  cf_dir = souls_functions.map { |n| n.split("/").last }
55
56
  cf_dir.each do |dir|
56
57
  SOULs::Painter.success(`gcloud functions describe #{dir} --project=#{project_id}| grep url`)
@@ -169,7 +169,7 @@ module SOULs
169
169
  FileUtils.rm(sig_name)
170
170
  end
171
171
 
172
- def souls_api_credit(_app_name)
172
+ def souls_api_credit(app_name)
173
173
  line = Paint["====================================", :yellow]
174
174
  puts("\n")
175
175
  puts(line)
@@ -194,7 +194,7 @@ module SOULs
194
194
  puts(line)
195
195
  endroll = <<~TEXT
196
196
  Easy to Run
197
- $ cd apps/api
197
+ $ cd #{app_name}/apps/api
198
198
  $ souls s
199
199
  Go To : http://localhost:4000
200
200
 
@@ -2,6 +2,7 @@ module SOULs
2
2
  class Sync < Thor
3
3
  desc "pubsub", "Sync Worker Jobs & Google Cloud Pubsub Topics/Subscriptions"
4
4
  def pubsub
5
+ project_id = SOULs.configuration.project_id
5
6
  worker_name = FileUtils.pwd.split("/").last
6
7
 
7
8
  unless worker_name.match(/^worker-(\d|\w)+(-)*(\d|\w)+$/)
data/lib/souls/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module SOULs
2
- VERSION = "1.18.8".freeze
2
+ VERSION = "1.19.3".freeze
3
3
  public_constant :VERSION
4
4
  end
@@ -1 +1 @@
1
- 1.18.8
1
+ 1.19.3
@@ -1 +1 @@
1
- 1.18.8
1
+ 1.19.3
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: 1.18.8
4
+ version: 1.19.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - POPPIN-FUMI
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: exe
12
12
  cert_chain: []
13
- date: 2022-01-05 00:00:00.000000000 Z
13
+ date: 2022-01-06 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activesupport