Created
April 26, 2010 19:03
-
-
Save Phrogz/379744 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
# mkdir vendor; cd vendor; mkdir gems; cd gems | |
# gem unpack rack | |
# gem unpack sinatra | |
# gem unpack haml | |
# gem unpack sequel | |
# gem unpack ruby-net-ldap | |
GEMS = { | |
'rack' => 'rack-1.1.0', | |
'sinatra' => 'sinatra-1.0', | |
'haml' => 'haml-2.2.23', | |
'net/ldap' => 'ruby-net-ldap-0.0.4', | |
'sequel' => 'sequel-3.10.0' | |
} | |
# You can't just chdir to each, because one gem might require another (e.g. sinatra requires rack). | |
$:.unshift( *GEMS.values.map{ |path| File.expand_path( File.join('vendor','gems',path,'lib') ) } ) | |
GEMS.each{ |gem,path| require gem } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Simpler, if less precise:
$:.unshift( Dir['vendor/gems//lib'] )