heroku-stage 0.3.0 → 0.4.0
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 +5 -5
- data/README.md +9 -0
- data/lib/heroku/stage.rb +6 -0
- data/lib/heroku/stage/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: f2f7bd67413f3c11bfd4203e0291c05e8a44c510846e5f8f91e05b0b7b9124f4
|
4
|
+
data.tar.gz: fe423e33a5e0747e0fc90aee834addf4b1582cd611598989d737d340fc558c57
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2c8031836f932cb65172c9a0c1abe18620d9e26dc21b6ab9edaf4574d04e1fee5a0f567d13f09f69fbeb4bba3c7252e07af446c1908fc946749fb914846ad91d
|
7
|
+
data.tar.gz: f4153e2ea36f530a87b8bda4aaabfec3083931067fd68bc1ed16d0259e851100242d0e4b286bee9bc1fba6c9dab06dba1b5ba49a14fabfacdeef834458cb2e78
|
data/README.md
CHANGED
@@ -87,6 +87,15 @@ Rails.env.development? # true
|
|
87
87
|
Heroku.stage # => ''
|
88
88
|
```
|
89
89
|
|
90
|
+
### In review apps
|
91
|
+
|
92
|
+
When in a review app you can get the current pull-request
|
93
|
+
|
94
|
+
```ruby
|
95
|
+
Heroku.review_app? # true
|
96
|
+
Heroku.stage # => pr-43
|
97
|
+
```
|
98
|
+
|
90
99
|
## Testing
|
91
100
|
|
92
101
|
To run the specs you need to execute, **in the root path of the gem**, the following command:
|
data/lib/heroku/stage.rb
CHANGED
@@ -13,9 +13,15 @@ module Heroku
|
|
13
13
|
@_stage ||= ActiveSupport::StringInquirer.new(heroku_pipeline_stage)
|
14
14
|
end
|
15
15
|
|
16
|
+
def review_app?
|
17
|
+
!ENV['HEROKU_PARENT_APP_NAME'].nil?
|
18
|
+
end
|
19
|
+
|
16
20
|
private
|
17
21
|
|
18
22
|
def heroku_pipeline_stage
|
23
|
+
return ENV.fetch('HEROKU_APP_NAME')[/pr-(\d*)/] if review_app?
|
24
|
+
|
19
25
|
dev_or_test = Rails.env.development? || Rails.env.test?
|
20
26
|
dev_or_test ? '' : ENV.fetch('HEROKU_APP_NAME')[/staging|production/]
|
21
27
|
rescue KeyError
|
data/lib/heroku/stage/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: heroku-stage
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Platanus
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2018-04-19 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -138,7 +138,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
138
138
|
version: '0'
|
139
139
|
requirements: []
|
140
140
|
rubyforge_project:
|
141
|
-
rubygems_version: 2.
|
141
|
+
rubygems_version: 2.7.6
|
142
142
|
signing_key:
|
143
143
|
specification_version: 4
|
144
144
|
summary: Read stage name from heroku pipelines
|