summaryrefslogtreecommitdiff
path: root/bin/leap
diff options
context:
space:
mode:
authorelijah <elijah@riseup.net>2012-11-04 01:19:49 -0800
committerelijah <elijah@riseup.net>2012-11-04 01:19:49 -0800
commit38151e6b250e0455a02d9601fadbf6206df34430 (patch)
treeaeafa723bdc38b3a9409f6c2b19dc6b8f6daf33c /bin/leap
parenteab3a872de04dfaa197cbe71ab34472dcb4fd7e5 (diff)
better path management
Diffstat (limited to 'bin/leap')
-rwxr-xr-xbin/leap10
1 files changed, 6 insertions, 4 deletions
diff --git a/bin/leap b/bin/leap
index 2749fc8..9e0037a 100755
--- a/bin/leap
+++ b/bin/leap
@@ -13,11 +13,13 @@ rescue LoadError
# This allows you to run the command directly while developing the gem, and also lets you
# run from anywhere (I like to link 'bin/leap' to /usr/local/bin/leap).
#
- file = File.symlink?(__FILE__) ? File.readlink(__FILE__) : __FILE__
- lib_dir = File.expand_path(File.dirname(file) + '/../lib')
- $LOAD_PATH.unshift lib_dir unless $LOAD_PATH.include?(lib_dir)
require 'rubygems'
- require 'bundler/setup' # force evaluation of "Gemfile"
+ base_dir = File.expand_path('..', File.dirname(File.symlink?(__FILE__) ? File.readlink(__FILE__) : __FILE__))
+ require File.join([base_dir, 'lib','leap_cli','version.rb'])
+ LeapCli::REQUIRE_PATHS.each do |path|
+ path = File.expand_path(path, base_dir)
+ $LOAD_PATH.unshift path unless $LOAD_PATH.include?(path)
+ end
require 'leap_cli'
end