summaryrefslogtreecommitdiffstats
path: root/Rakefile
blob: 03a1a18d1c8207499f7ca55f7ee12aa31229bff2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
require 'rubygems/tasks'
Gem::Tasks.new

require 'fileutils'
task :clean do
  FileUtils.rm_rf %w[ pkg coverage doc man/hcl.1 ]
end

require 'rake/testtask'
Rake::TestTask.new do |t|
  t.libs << 'test'
  t.test_files = FileList['test/*_test.rb']
end
task :default => :test

# process the README into a manual page using ronn
require 'ronn'
task :man do
  print "Writing manual page..."
  head, content = File.read('README.markdown').split("## SYNOPSIS\n")
  content.prepend <<-END
hcl(1) -- Track time with Harvest time sheets
=============================================

## SYNOPSIS
  END
  FileUtils.mkdir_p('man')
  File.write('man/hcl.1.ronn', content)
  File.open('man/hcl.1','w').tap do |man|
    man.write Ronn::Document.new('man/hcl.1.ronn').to_roff
  end
  puts "done."
end
task "pkg/hcl-#{HCl::VERSION}.gem" => :man

require 'yard'
YARD::Rake::YardocTask.new
task :doc => [:yard, :man]