2 require 'rake/testtask'
4 require 'doozer/version'
5 require 'doozer/tasks/fixed_hoe'
6 require 'doozer/tasks/specs'
7 require 'doozer/tasks/scm'
9 FixedHoe.new('doozer', Doozer::VERSION::STRING) do |p|
10 p.rubyforge_name = 'doozer'
11 p.author = "M@ McCray"
12 p.email = 'darthapo@gmail.com'
13 p.summary = 'A test fixture generator'
14 p.description = p.paragraphs_of('ReadMe', 1..2).join("\n\n")
15 p.url = 'http://www.mattmccray.com'
16 p.changes = p.paragraphs_of('History', 0..1).join("\n\n")
17 p.extra_deps << 'active_support'
20 desc 'Run the default tasks'
21 task :default => :test
24 require 'spec/rake/spectask'
26 desc "Run all examples"
27 Spec::Rake::SpecTask.new('spec') do |t|
28 t.spec_files = FileList['specs/**/*.rb']
31 desc "Generate specdocs for examples for inclusion in RDoc"
32 Spec::Rake::SpecTask.new('specdoc') do |t|
33 t.spec_files = FileList['specs/**/*.rb']
34 t.spec_opts = ["--format", "rdoc:EXAMPLES.rd"]
37 Rake::TestTask.new do |t|
39 t.test_files = FileList['test/*/*test.rb']
43 Behaviors::ReportTask.new :specs do |t|
44 t.pattern = 'test/**/*_test.rb'
46 t.src_dir = 'docs/src'
49 desc "Generates the documentation"
50 task :doc=>[:specs_src] do
53 require 'active_support'
54 #RedCloth::DEFAULT_RULES.replace [:markdown, :textile]
56 src_files = FileList['docs/src/*.markdown']
57 src_filenames = src_files.map {|sf| File.basename sf, '.markdown' }
58 src_titles = src_filenames.map {|sfn| sfn.gsub('_', ' ').titleize }
59 layout_tmpl = ERB.new(File.readlines('docs/src/_layout.rhtml', 'r').join(''))
61 puts "#{src_files.length} docs found.\n"
63 src_files.each do |src|
64 filename = File.basename src, '.markdown'
65 title = filename.gsub('_', ' ').titleize
66 content = BlueCloth.new(File.readlines(src, 'r').join('')).to_html
67 page_html = layout_tmpl.result(binding)
68 File.open("docs/#{filename}.html", 'w' ) do |f|