forked from tenderlove/recma
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Rakefile
38 lines (31 loc) · 1 KB
/
Rakefile
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
require 'rubygems'
require 'hoe'
Hoe.plugin :gemspec # `gem install hoe-gemspec`
Hoe.plugin :git # `gem install hoe-git`
GENERATED_PARSER = "lib/rkelly/generated_parser.rb"
HOE = Hoe.spec('rkelly') do |p|
developer('Aaron Patterson', 'aaron.patterson@gmail.com')
self.readme_file = 'README.rdoc'
self.history_file = 'CHANGELOG.rdoc'
self.extra_rdoc_files = FileList['*.rdoc']
self.clean_globs = [GENERATED_PARSER]
end
file GENERATED_PARSER => "lib/parser.y" do |t|
if ENV['DEBUG']
sh "racc -g -v -o #{t.name} #{t.prerequisites.first}"
else
sh "racc -o #{t.name} #{t.prerequisites.first}"
end
end
task :parser => GENERATED_PARSER
# make sure the parser's up-to-date when we test
Rake::Task[:test].prerequisites << :parser
Rake::Task[:check_manifest].prerequisites << :parser
namespace :gem do
task :spec do
File.open("#{HOE.name}.gemspec", 'w') do |f|
HOE.spec.version = "#{HOE.version}.#{Time.now.strftime("%Y%m%d%H%M%S")}"
f.write(HOE.spec.to_ruby)
end
end
end