rakefile.rb无法正常工作 [英] rakefile.rb doesn't work correctly

查看:134
本文介绍了rakefile.rb无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下任务

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

它不能正常工作,应该找到所有文件.md,为每个文件仅提取名称,附加.html并最终执行markdown file.md > html/file.html.

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.

但是它不起作用.它甚至都不会创建"html"目录.

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

我已将ruby-1.9.2rvm

推荐答案

最后,我累了,并决定解决以下问题

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

这篇关于rakefile.rb无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆