diff options
author | elijah <elijah@riseup.net> | 2012-11-04 01:19:49 -0800 |
---|---|---|
committer | elijah <elijah@riseup.net> | 2012-11-04 01:19:49 -0800 |
commit | 38151e6b250e0455a02d9601fadbf6206df34430 (patch) | |
tree | aeafa723bdc38b3a9409f6c2b19dc6b8f6daf33c /bin | |
parent | eab3a872de04dfaa197cbe71ab34472dcb4fd7e5 (diff) |
better path management
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/leap | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -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 |