Skip to content

Commit

Permalink
Adds a -I option to append directories to LOAD_PATH
Browse files Browse the repository at this point in the history
  • Loading branch information
jstorimer committed Nov 2, 2011
1 parent fb9f040 commit 4cd9f8c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions bin/spin
Expand Up @@ -13,6 +13,7 @@ require 'digest/md5'
# So we can tell users how much time they're saving by preloading their
# environment.
require 'benchmark'
require 'optparse'

def usage(stream = $stderr)
stream.puts <<-USAGE
Expand Down Expand Up @@ -124,6 +125,12 @@ rescue Errno::ECONNREFUSED
abort "Connection was refused. Have you started up `spin serve` yet?"
end

OptionParser.new do |opts|
opts.on("-I", "--load-path=DIR#{File::PATH_SEPARATOR}DIR", "Appends directory to $LOAD_PATH") do |dirs|
$LOAD_PATH.concat(dirs.split(File::PATH_SEPARATOR))
end
end.parse!

subcommand = ARGV.shift
case subcommand
when 'serve' then serve
Expand Down

0 comments on commit 4cd9f8c

Please sign in to comment.