rocco command tries to setup load path
This commit is contained in:
parent
1b4389ef72
commit
7b0f7d31fd
23
bin/rocco
23
bin/rocco
@ -1,5 +1,26 @@
|
||||
#!/usr/bin/env ruby
|
||||
require 'rocco'
|
||||
libdir = File.expand_path('../../lib', __FILE__).sub(/^#{Dir.pwd}\//, '')
|
||||
|
||||
begin
|
||||
require 'rdiscount'
|
||||
require 'rocco'
|
||||
rescue LoadError
|
||||
case $!.to_s
|
||||
when /rdiscount/
|
||||
if !defined?(Gem)
|
||||
warn "warn: #$!. trying again with rubygems"
|
||||
require 'rubygems'
|
||||
retry
|
||||
end
|
||||
when /rocco/
|
||||
if !$:.include?(libdir)
|
||||
warn "warn: #$!. trying again with #{libdir} on load path"
|
||||
$:.unshift(libdir)
|
||||
retry
|
||||
end
|
||||
end
|
||||
raise
|
||||
end
|
||||
|
||||
rocco =
|
||||
Rocco.new(ARGV[0]) do
|
||||
|
Loading…
Reference in New Issue
Block a user