rf_footer 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rf_footer/deployment_info.rb +4 -2
- data/lib/rf_footer/git.rb +36 -2
- data/lib/rf_footer/version.rb +1 -1
- data/rf_footer-1.0.0.gem +0 -0
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 480efe2e8ac744e9aacd393f0429554e66c0cd84
|
4
|
+
data.tar.gz: 97845059417ab2014e7158eb02d284efd20c7797
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2c866908a9d574d9fc97904a15172592a9c8fff4f54717247d7ce3adb60a0e07abf75d199b8af1fa7bb4527631bf0e986a54d066ff86ba40abb4f44614607a83
|
7
|
+
data.tar.gz: 7df7add4b1d3ddf48204ac317ceddf2a02cd2aaa674ce7abd70b6770e6e4c44156377523f6b5684f057d1543fb116554aeb6598d534ff297fb31e0a9951c2eb2
|
@@ -1,12 +1,14 @@
|
|
1
1
|
module RfFooter
|
2
2
|
class DeploymentInfo
|
3
3
|
class << self
|
4
|
+
include Git
|
5
|
+
|
4
6
|
def revision
|
5
|
-
|
7
|
+
sha || "unknown SHA"
|
6
8
|
end
|
7
9
|
|
8
10
|
def environment
|
9
|
-
ENV
|
11
|
+
ENV["RF_ENV"] || ENV["RORY_ENV"] || ENV["RAILS_ENV"] || "undefined environment"
|
10
12
|
end
|
11
13
|
end
|
12
14
|
end
|
data/lib/rf_footer/git.rb
CHANGED
@@ -1,3 +1,37 @@
|
|
1
|
-
module
|
2
|
-
|
1
|
+
module RfFooter
|
2
|
+
module Git
|
3
|
+
def sha
|
4
|
+
sha_via_cap_vic || sha_via_git_repo
|
5
|
+
end
|
6
|
+
|
7
|
+
private
|
8
|
+
|
9
|
+
def sha_via_cap_vic
|
10
|
+
return unless root
|
11
|
+
|
12
|
+
File.read(path) if File.exists?(path)
|
13
|
+
end
|
14
|
+
|
15
|
+
def sha_via_git_repo
|
16
|
+
return if bash_response.empty?
|
17
|
+
|
18
|
+
bash_response
|
19
|
+
end
|
20
|
+
|
21
|
+
def path
|
22
|
+
@path ||= root.join("REVISION")
|
23
|
+
end
|
24
|
+
|
25
|
+
def bash_response
|
26
|
+
@bash_response ||= `git log --pretty=format:'%h' -n 1`
|
27
|
+
end
|
28
|
+
|
29
|
+
def root
|
30
|
+
if ENV["RAILS_ENV"]
|
31
|
+
Rails.root
|
32
|
+
elsif ENV["RORY_ENV"]
|
33
|
+
Rory.root
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
3
37
|
end
|
data/lib/rf_footer/version.rb
CHANGED
data/rf_footer-1.0.0.gem
ADDED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rf_footer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- jozw
|
@@ -88,6 +88,7 @@ files:
|
|
88
88
|
- lib/rf_footer/notes.rb
|
89
89
|
- lib/rf_footer/version.rb
|
90
90
|
- rf_footer-0.1.0.gem
|
91
|
+
- rf_footer-1.0.0.gem
|
91
92
|
- rf_footer.gemspec
|
92
93
|
homepage: https://github.com/projectdx/rf_footer
|
93
94
|
licenses: []
|