Last active
August 29, 2015 13:56
-
-
Save padde/9074142 to your computer and use it in GitHub Desktop.
Adding lib directory to load path, even when called as a symlink
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
$THIS_FILE = File.dirname(File.symlink?(__FILE__) ? File.readlink(__FILE__) : __FILE__) | |
$LOAD_PATH.unshift File.expand_path(File.join($THIS_FILE, '..', 'lib')) | |
require 'greeter' | |
g = Greeter.new | |
g.greet |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment