summaryrefslogtreecommitdiffstats
path: root/Rakefile
blob: 2ce9fa37b7da0094d6ac21a3caf723278d87e556 (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
40
41
42
43
44
45
46
require 'rubygems/tasks'
Gem::Tasks.new

# I am dumb and keep forgetting to update the bundle before releasing
task :update_bundle do
  system("bundle")
  system("git ci -am 'update gemfile.lock'")
end
task :release => [:update_bundle]

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/hcl.1' 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') do |man|
    man.write Ronn::Document.new('man/hcl.1.ronn').to_roff
  end
  puts "done."
end
task :build => 'man/hcl.1'

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