Pregunta

I have the following task

task :default => ['build_html']

desc 'Generar documentacion desde markdown'
task :build_html do
    SRC = FileList['*.md']

    directory 'html'

    SRC.each do |md|
        html = md.sub(/\.[^.]*$/, '.html')
        file html do
            sh "markdown #{md} > html/#{html}"
        end
    end
end

It does not work correctly, is supposed to find all files .md, for each file extract only the name, append .html and finally execute markdown file.md > html/file.html.

But it doesn't work. It doesn't even create the 'html' directory.

i have installed ruby-1.9.2 with rvm

¿Fue útil?

Solución

Finally I was tired and I resolved as follows

task :default => ['build_html']
desc 'Generar documentacion desde markdown'
task :build_html do
    SRC = FileList['*.md']
    SRC.each do |md|
        html = md.sub(/\.[^.]*$/, ".html")
        sh "markdown #{md} > html/#{html}"
    end
end
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top