souls 4.0.0 → 4.0.1

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: 45f0c640f8db0b677a7836a20cb4f0a2f4afbd7c154ff1ee7a2ad51e3ca4afdd
4
- data.tar.gz: 9ed914c80f91894dd80c86a221161d99288976c12fef515e1d525a35c2147067
3
+ metadata.gz: 2f7e78a0d34d033b5195daf0a5ed7aecad41eadead327bbcfcbafbd1db678c44
4
+ data.tar.gz: 9400d82655bb2960b8ad6b3638a9bfcddc87cff88657bd0dbedb76df7e74f327
5
5
  SHA512:
6
- metadata.gz: bfa290d33d6d56610dcb5cff34537f9e2655a0e13bc907792ca2e1b8073f8db867d7b5c2a7f96f1612fef7f08a9427ab8abeba7c7489032f0c203b9ddc7bc82d
7
- data.tar.gz: dfd65269355ca5ea00a69f6df5c6aa58ffffc6ab06b5144ca7ff30d01126184b1138100bdcac3f33fed9fc952ef0c186c0447802d08c4072fd8d27f96e748626
6
+ metadata.gz: 457b3830e6dff28fcaae7db2e7d7cfe45ab9baa5b540307197549902fc3c33045bf8de89fa576a30669aa45a89724a595496c883a8de4ba34ada6754e6cea569
7
+ data.tar.gz: b9fc560fd7c268925921c42a84ae344e1e5ecbd921ef42a4076fc22d1d41c2a406afbf288b41396429f281bea40f4ba53d824b36d8987e70084940c204f6272a
data/lib/souls/cli.rb CHANGED
@@ -55,6 +55,11 @@ module SOULs
55
55
  system("bundle exec rspec")
56
56
  end
57
57
 
58
+ desc "secret", "Generate Secure Random String"
59
+ def secret
60
+ puts(SecureRandom.alphanumeric(85))
61
+ end
62
+
58
63
  desc "build", "Run Docker Build"
59
64
  def build
60
65
  app = SOULs.configuration.app
@@ -65,8 +70,7 @@ module SOULs
65
70
  def tag
66
71
  souls_config = SOULs.configuration
67
72
  app = souls_config.app
68
- region = souls_config.region
69
- gcr = region_to_container_url(region:)
73
+ gcr = souls_config.gcr_region
70
74
  project_id = souls_config.project_id
71
75
  system("docker tag #{app}:latest #{gcr}/#{project_id}/#{app}:latest")
72
76
  end
@@ -75,8 +79,7 @@ module SOULs
75
79
  def push
76
80
  souls_config = SOULs.configuration
77
81
  app = souls_config.app
78
- region = souls_config.region
79
- gcr = region_to_container_url(region:)
82
+ gcr = souls_config.gcr_region
80
83
  project_id = souls_config.project_id
81
84
  system("docker push #{gcr}/#{project_id}/#{app}:latest")
82
85
  end
data/lib/souls/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module SOULs
2
- VERSION = "4.0.0".freeze
2
+ VERSION = "4.0.1".freeze
3
3
  public_constant :VERSION
4
4
  end
@@ -1 +1 @@
1
- 4.0.0
1
+ 4.0.1
@@ -1 +1 @@
1
- 4.0.0
1
+ 4.0.1
data/lib/souls.rb CHANGED
@@ -40,5 +40,19 @@ module SOULs
40
40
  def instance_name
41
41
  "souls-#{@app}-db"
42
42
  end
43
+
44
+ def gcr_region
45
+ if @region.include?("asia")
46
+ "asia.gcr.io"
47
+ elsif @region.include?("eu")
48
+ "eu.gcr.io"
49
+ else
50
+ "gcr.io"
51
+ end
52
+ end
53
+
54
+ def gcp_db_host
55
+ "/cloudsql/#{@project_id}:#{@region}:#{instance_name}"
56
+ end
43
57
  end
44
58
  end
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: 4.0.0
4
+ version: 4.0.1
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-09-12 00:00:00.000000000 Z
13
+ date: 2022-09-14 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activesupport