Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBob Van Landuyt <bob@vanlanduyt.co>2017-08-03 13:16:45 +0300
committerBob Van Landuyt <bob@vanlanduyt.co>2017-08-04 16:38:49 +0300
commit3899d07f9eb5ffa2369195c800be18e297f67613 (patch)
tree5a8e252d127878f4057ec884f3407874b86645d4 /lib/gitlab/environment.rb
parent0fa94a0dddfc38635abf49a38dbadc9b9ead4d7a (diff)
Move hostname to Gitlab::Environment
Diffstat (limited to 'lib/gitlab/environment.rb')
-rw-r--r--lib/gitlab/environment.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/gitlab/environment.rb b/lib/gitlab/environment.rb
new file mode 100644
index 00000000000..5e0dd6e7859
--- /dev/null
+++ b/lib/gitlab/environment.rb
@@ -0,0 +1,7 @@
+module Gitlab
+ module Environment
+ def self.hostname
+ @hostname ||= ENV['HOSTNAME'] || Socket.gethostname
+ end
+ end
+end