4 require 'util/fixed_hoe'
5 require 'bloggit/tasks/specs'
6 require 'bloggit/tasks/scm'
8 FixedHoe.new('bloggit', Bloggit::VERSION) do |p|
9 p.rubyforge_name = 'bloggit'
10 p.author = "M@ McCray"
11 p.email = 'darthapo@gmail.com'
12 p.summary = 'A static site generator for a blog with static pages'
13 p.description = p.paragraphs_of('ReadMe', 2..5).join("\n\n")
14 p.url = p.paragraphs_of('ReadMe', 0).first.split(/\n/)[2..-1].to_s.strip
15 p.changes = p.paragraphs_of('History', 0..1).join("\n\n")
16 p.rdoc_pattern = /^(lib|bin)(.*)\.rb$/
18 p.extra_deps = [['activesupport'], ['RedCloth'], ['cmdparse'], ['BlueCloth'], ['builder'], ['markaby']]
21 Behaviors::ReportTask.new :specs do |t|
22 t.pattern = 'test/**/*_test.rb'
24 t.src_dir = 'docs/src'
29 Rake::TestTask.new do |t|
31 t.test_files = FileList['test/*/*test.rb']
36 task :install=>[:gem] do
37 sh "sudo gem install pkg/bloggit-#{Bloggit::VERSION}.gem"
41 desc "Generates the documentation"
42 task :doc=>[:specs_src] do
45 require 'active_support'
46 #RedCloth::DEFAULT_RULES.replace [:markdown, :textile]
48 src_files = FileList['docs/src/*.markdown']
49 src_filenames = src_files.map {|sf| File.basename sf, '.markdown' }
50 src_titles = src_filenames.map {|sfn| sfn.gsub('_', ' ').titleize }
51 layout_tmpl = ERB.new(File.readlines('docs/src/_layout.rhtml', 'r').join(''))
53 puts "#{src_files.length} docs found.\n"
55 src_files.each do |src|
56 filename = File.basename src, '.markdown'
57 title = filename.gsub('_', ' ').titleize
58 content = BlueCloth.new(File.readlines(src, 'r').join('')).to_html
59 page_html = layout_tmpl.result(binding)
60 File.open("docs/#{filename}.html", 'w' ) do |f|