rf_footer 1.1.0 → 1.2.0

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
  SHA1:
3
- metadata.gz: 480efe2e8ac744e9aacd393f0429554e66c0cd84
4
- data.tar.gz: 97845059417ab2014e7158eb02d284efd20c7797
3
+ metadata.gz: 32c69af8ae4a13a59d37d737d92e5c6f80e692bb
4
+ data.tar.gz: b17d95fe506861fcd0488cc67dbefd0dd6947ba1
5
5
  SHA512:
6
- metadata.gz: 2c866908a9d574d9fc97904a15172592a9c8fff4f54717247d7ce3adb60a0e07abf75d199b8af1fa7bb4527631bf0e986a54d066ff86ba40abb4f44614607a83
7
- data.tar.gz: 7df7add4b1d3ddf48204ac317ceddf2a02cd2aaa674ce7abd70b6770e6e4c44156377523f6b5684f057d1543fb116554aeb6598d534ff297fb31e0a9951c2eb2
6
+ metadata.gz: a54884d1128e91b57cc092141413533232ae856b45e2288bee4f71903e60c74e1230212d94e1ad02d140ce92bb6ca87ccef8955cf48387591203d09dcfb07f27
7
+ data.tar.gz: 9e14b0229098907fbbd363714982e85d9930fdf335bb30c07a0c0725d44a0f1744f7d8c97a829d5c6fc503c6626b218e438324bf40e9b42cd3c6dd457b8e620f
@@ -2,13 +2,14 @@ module RfFooter
2
2
  class DeploymentInfo
3
3
  class << self
4
4
  include Git
5
+ include Environment
5
6
 
6
7
  def revision
7
- sha || "unknown SHA"
8
+ sha || "unknown revision"
8
9
  end
9
10
 
10
11
  def environment
11
- ENV["RF_ENV"] || ENV["RORY_ENV"] || ENV["RAILS_ENV"] || "undefined environment"
12
+ stage || "undefined environment"
12
13
  end
13
14
  end
14
15
  end
@@ -0,0 +1,25 @@
1
+ module RfFooter
2
+ module Environment
3
+ def stage
4
+ return development_stage if stage_via_env == "development"
5
+
6
+ stage_via_env
7
+ end
8
+
9
+ private
10
+
11
+ def development_stage
12
+ return "development" if user_via_bash.empty?
13
+
14
+ "development - #{user_via_bash}"
15
+ end
16
+
17
+ def user_via_bash
18
+ @user_via_bash ||= `whoami`
19
+ end
20
+
21
+ def stage_via_env
22
+ @stage_via_env ||= ENV["RF_ENV"] || ENV["RORY_ENV"] || ENV["RAILS_ENV"] || ENV["RACK_ENV"]
23
+ end
24
+ end
25
+ end
data/lib/rf_footer/git.rb CHANGED
@@ -27,7 +27,7 @@ module RfFooter
27
27
  end
28
28
 
29
29
  def root
30
- if ENV["RAILS_ENV"]
30
+ @root ||= if ENV["RAILS_ENV"]
31
31
  Rails.root
32
32
  elsif ENV["RORY_ENV"]
33
33
  Rory.root
@@ -1,3 +1,3 @@
1
1
  module RfFooter
2
- VERSION = "1.1.0"
2
+ VERSION = "1.2.0"
3
3
  end
data/lib/rf_footer.rb CHANGED
@@ -1,5 +1,6 @@
1
1
  require "rf_footer/version"
2
2
  require "rf_footer/git"
3
+ require "rf_footer/environment"
3
4
  require "rf_footer/deployment_info"
4
5
  require "rf_footer/notes"
5
6
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rf_footer
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - jozw
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-08-03 00:00:00.000000000 Z
11
+ date: 2016-08-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -84,11 +84,10 @@ files:
84
84
  - bin/setup
85
85
  - lib/rf_footer.rb
86
86
  - lib/rf_footer/deployment_info.rb
87
+ - lib/rf_footer/environment.rb
87
88
  - lib/rf_footer/git.rb
88
89
  - lib/rf_footer/notes.rb
89
90
  - lib/rf_footer/version.rb
90
- - rf_footer-0.1.0.gem
91
- - rf_footer-1.0.0.gem
92
91
  - rf_footer.gemspec
93
92
  homepage: https://github.com/projectdx/rf_footer
94
93
  licenses: []
@@ -110,7 +109,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
110
109
  version: '0'
111
110
  requirements: []
112
111
  rubyforge_project:
113
- rubygems_version: 2.2.5
112
+ rubygems_version: 2.6.6
114
113
  signing_key:
115
114
  specification_version: 4
116
115
  summary: RfFooter displays deployment information at the footer of your RF application's
data/rf_footer-0.1.0.gem DELETED
Binary file
data/rf_footer-1.0.0.gem DELETED
Binary file