public
Description: Railslove Ubiquity Commands
Homepage: http://railslove.com/ubiquity
Clone URL: git://github.com/bumi/ubiquity-commands.git
ubiquity-commands / Rakefile
100644 19 lines (17 sloc) 0.603 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# inspired by and borrowed from the awesome newgem http://newgem.rubyforge.org/ Gem Generator by Dr Nic http://www.drnicwilliams.com/
require "erb"
desc 'Generate website files'
task :website do
  targets = []
  Dir['**/readme.textile'].each do |txt|
    puts txt
    path = txt.gsub(/readme\.textile$/,'index.html')
    name = File.dirname(txt)
    targets << {:path => path, :name => name}
 
    sh %{ ruby script/txt2html #{txt} > #{path} }
    template = ERB.new(File.open("index.html.erb").read)
    File.open("index.html","w") do |index|
      index.puts template.result(binding)
    end
  end
end