souls 1.14.1 → 1.14.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: 86e9a0ba6f61532e0ceb30f68cbf47445b84e53c034366f287cb514be8c50bcb
4
- data.tar.gz: 01a9ad3ff6c9d73633041cd4f4befc197adf1bfefb55208cfb6793a27010ef9a
3
+ metadata.gz: 8308615df78c8c6ebe073fdbab2cd67b62cd2b793eb50a34f3849d74f6c22424
4
+ data.tar.gz: 36b68ae49c525c4ad70a20ca7da086298c3563a3ef039e1cfb5749710a988146
5
5
  SHA512:
6
- metadata.gz: 5474dc7a392e012288a6db34b0f1a960a0c2452649a1b9146f8515aea9352fa4c67d30fb447fc388bbcb83260d665c2301edf23a608d214643ec970f37af5d12
7
- data.tar.gz: 49804c5f3b4b2ce9cf35290e948c8b3663c13a9f0b0b0791d5af1ae73b9966bf6d4675a015521327993bb2770acb35361b3815d74bdff929db7c9f8e20ba6cf7
6
+ metadata.gz: 2a4bdc4ab3b391b6a863a3a993301953adacdbe2fa3415b896c4b9ada0f55d12a038a27039bb2cdb928f8401e0f40667fda34c0172f4f1c727e4784100201a78
7
+ data.tar.gz: fa8dddbc20ea584a313074acf14194d0ac4628c01aaf29927def9b14a82d04aa547b9ac77190be3b8450115b6131269cf8bff43504a7c42c9ba319ce7fc2111d
@@ -1,11 +1,13 @@
1
1
  require_relative "./template/functions_app"
2
2
  require_relative "./template/functions_gemfile"
3
+ require_relative "./template/functions_env_yaml"
3
4
  module Souls
4
5
  class Create < Thor
5
6
  desc "functions", "Create SOULs functions"
6
7
  def functions
7
8
  create_app_file
8
9
  create_gemfile
10
+ create_env_yaml
9
11
  end
10
12
 
11
13
  private
@@ -31,5 +33,16 @@ module Souls
31
33
  Souls::Painter.create_file(file_path)
32
34
  file_path
33
35
  end
36
+
37
+ def create_env_yaml
38
+ file_dir = "./apps/functions"
39
+ FileUtils.mkdir_p(file_dir) unless Dir.exist?(file_dir)
40
+ file_path = "#{file_dir}/.env.yaml"
41
+ raise(StandardError, "Already Exist!") if File.exist?(file_path)
42
+
43
+ File.write(file_path, Template.functions_env_yaml)
44
+ Souls::Painter.create_file(file_path)
45
+ file_path
46
+ end
34
47
  end
35
48
  end
@@ -0,0 +1,8 @@
1
+ module Template
2
+ def self.functions_env_yaml
3
+ <<~ENV
4
+ FOO: bar
5
+ BAZ: boo
6
+ ENV
7
+ end
8
+ end
@@ -8,7 +8,7 @@ module Souls
8
8
  system(
9
9
  "
10
10
  gcloud functions deploy souls_functions --project=#{project_id} \
11
- --runtime ruby27 --trigger-http --allow-unauthenticated
11
+ --runtime ruby27 --trigger-http --allow-unauthenticated --env-vars-file .env.yaml
12
12
  "
13
13
  )
14
14
  end
@@ -1,9 +1,10 @@
1
1
  module Souls
2
2
  module Utils
3
3
  def get_mother_path
4
- file_array = Dir.pwd.split("/")
4
+ current_dir = Dir.pwd
5
+ file_array = current_dir.split("/")
5
6
  mother_dir_num = file_array.rindex("apps")
6
- mother_dir_num ? file_array.slice(mother_dir_num).join("/") : file_array.join("/")
7
+ mother_dir_num ? file_array.each_slice(mother_dir_num).to_a[0].join("/") : current_dir
7
8
  end
8
9
 
9
10
  def get_functions_path
data/lib/souls/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module Souls
2
- VERSION = "1.14.1".freeze
2
+ VERSION = "1.14.2".freeze
3
3
  public_constant :VERSION
4
4
  end
@@ -1 +1 @@
1
- 1.14.1
1
+ 1.14.2
@@ -1 +1 @@
1
- 1.14.1
1
+ 1.14.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: 1.14.1
4
+ version: 1.14.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - POPPIN-FUMI
@@ -177,6 +177,7 @@ files:
177
177
  - lib/souls/cli/create/functions.rb
178
178
  - lib/souls/cli/create/index.rb
179
179
  - lib/souls/cli/create/template/functions_app.rb
180
+ - lib/souls/cli/create/template/functions_env_yaml.rb
180
181
  - lib/souls/cli/create/template/functions_gemfile.rb
181
182
  - lib/souls/cli/db/create_migration.rb
182
183
  - lib/souls/cli/db/create_migration_rbs.rb