summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPirate Praveen <praveen@debian.org>2015-11-10 12:51:25 -0500
committerPirate Praveen <praveen@debian.org>2015-11-10 12:51:25 -0500
commit2823f05dcfa12edc41ab0b3bcaf1959f1690f8bb (patch)
tree4723ee1209111233e623bf0057b5b8eaa3cc6e6d
parent79fdf65c71e90773fbf52d6832b74cf5a7124755 (diff)
downloadgitlab-shell-2823f05dcfa12edc41ab0b3bcaf1959f1690f8bb.tar.gz
use load path instead of require_relative
-rwxr-xr-xbin/check5
-rwxr-xr-xbin/create-hooks5
-rwxr-xr-xbin/gitlab-keys3
-rwxr-xr-xbin/gitlab-projects3
-rwxr-xr-xbin/install3
5 files changed, 12 insertions, 7 deletions
diff --git a/bin/check b/bin/check
index b90e15d..19a4bff 100755
--- a/bin/check
+++ b/bin/check
@@ -1,7 +1,8 @@
#!/usr/bin/env ruby
-require_relative '../lib/gitlab_init'
-require_relative '../lib/gitlab_net'
+$:.unshift File.expand_path('../lib', __FILE__)
+require 'gitlab_init'
+require 'gitlab_net'
#
# GitLab shell check task
diff --git a/bin/create-hooks b/bin/create-hooks
index 4efa650..b590aab 100755
--- a/bin/create-hooks
+++ b/bin/create-hooks
@@ -4,8 +4,9 @@
#
# This script is used when restoring a GitLab backup.
-require_relative '../lib/gitlab_init'
-require File.join(ROOT_PATH, 'lib', 'gitlab_projects')
+$:.unshift File.expand_path('../lib', __FILE__)
+require 'gitlab_init'
+require 'gitlab_projects'
Dir["#{GitlabConfig.new.repos_path}/*/*.git"].each do |repo|
begin
diff --git a/bin/gitlab-keys b/bin/gitlab-keys
index 9eb1950..ffe1ef0 100755
--- a/bin/gitlab-keys
+++ b/bin/gitlab-keys
@@ -1,6 +1,7 @@
#!/usr/bin/env ruby
-require_relative '../lib/gitlab_init'
+$:.unshift File.expand_path('../lib', __FILE__)
+require 'gitlab_init'
#
# GitLab Keys shell. Add/remove keys from ~/.ssh/authorized_keys
diff --git a/bin/gitlab-projects b/bin/gitlab-projects
index c354fe5..b75665a 100755
--- a/bin/gitlab-projects
+++ b/bin/gitlab-projects
@@ -1,7 +1,8 @@
#!/usr/bin/env ruby
-require_relative '../lib/gitlab_init'
+$:.unshift File.expand_path('../lib', __FILE__)
+require 'gitlab_init'
#
# GitLab Projects shell. Add/remove projects from /home/git/repositories
diff --git a/bin/install b/bin/install
index 9847ae1..1842f5b 100755
--- a/bin/install
+++ b/bin/install
@@ -1,6 +1,7 @@
#!/usr/bin/env ruby
-require_relative '../lib/gitlab_init'
+$:.unshift File.expand_path('../lib', __FILE__)
+require 'gitlab_init'
#
# GitLab shell, invoked from ~/.ssh/authorized_keys