redo refactor

This commit is contained in:
Tom Preston-Werner 2008-12-06 15:25:34 -08:00
parent 702e538e96
commit 07a8203e50
1 changed files with 14 additions and 11 deletions

View File

@ -15,32 +15,35 @@ end
opts.parse! opts.parse!
def process_local_to_local def clean(dest)
dest = File.join('.', '_site')
FileUtils.rm_rf(dest) FileUtils.rm_rf(dest)
FileUtils.mkdir_p(dest) FileUtils.mkdir_p(dest)
Jekyll.process('.', dest)
end end
def process_local_to_path def globs
Jekyll.process('.', ARGV[0])
end end
def process_path_to_path source = nil
Jekyll.process(ARGV[0], ARGV[1]) destination = nil
end
case ARGV.size case ARGV.size
when 0 when 0
process_local_to_local source = '.'
destination = File.join('.', '_site')
when 1 when 1
process_local_to_path source = '.'
destination = ARGV[0]
when 2 when 2
process_path_to_path source = ARGV[0]
destination = ARGV[1]
else else
puts "Invalid options. Run `jekyll --help` for assistance." puts "Invalid options. Run `jekyll --help` for assistance."
exit(1)
end end
Jekyll.process(source, destination)
__END__ __END__
Jekyll is a blog-aware, static site generator. Jekyll is a blog-aware, static site generator.