Skip to content

Instantly share code, notes, and snippets.

@myronmarston
Created September 11, 2013 04:32
Show Gist options
  • Save myronmarston/6519369 to your computer and use it in GitHub Desktop.
Save myronmarston/6519369 to your computer and use it in GitHub Desktop.
Alternate code for ruby tapas #131
source_files = Rake::FileList.new("**/*.md", "**/*.markdown") do |fl|
fl.exclude("~*")
fl.exclude(/^scratch\//)
fl.exclude do |f|
`git ls-files #{f}`.empty?
end
end
task :default => :html
task :html => source_files.ext(".html")
source_for_html = ->(html_file) do
source_files.detect{|f| f.ext('') == html_file.ext('')}
end
rule ".html" => source_for_html do |t|
sh "pandoc -o #{t.name} #{t.source}"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment