2 require 'rake/gempackagetask'
6 File.expand_path File.join(File.dirname(__FILE__), path)
9 task(:default => :compile)
11 task(:package => 'src/parser.c')
13 task(:compile => 'src/parser.c') do
14 sh "cd #{dir('src')} && ruby extconf.rb && make"
17 file('src/parser.c' => 'src/parser.rl') do
18 sh "ragel src/parser.rl | rlgen-cd -G2 -o src/parser.c"
21 task(:wc) { sh "wc -l ruby_lib/*.rb src/ebb*.{c,h}" }
23 task(:test => :compile) do
24 sh "ruby #{dir("benchmark/test.rb")}"
28 task(:site_upload => :site) do
29 sh 'scp -r site/* rydahl@rubyforge.org:/var/www/gforge-projects/ebb/'
31 task(:site => 'site/index.html')
32 file('site/index.html' => %w{README site/style.css}) do
35 doc = BlueCloth.new(File.read(dir('README')))
39 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
41 <link rel="alternate" href="http://max.kanat.us/tag-syndicate/?user=four&tag=ebb" title="RSS Feed" type="application/rss+xml" />
42 <link type="text/css" rel="stylesheet" href="style.css" media="screen"/>
45 <div id="content">CONTENT</div>
50 File.open(dir('site/index.html'), "w+") do |f|
51 f.write template.sub('CONTENT', doc.to_html)
55 spec = Gem::Specification.new do |s|
56 s.platform = Gem::Platform::RUBY
57 s.summary = "A Web Server"
61 s.email = 'ry@tinyclouds.org'
62 s.homepage = 'http://repo.or.cz/w/ebb.git'
63 s.version = File.read(dir("VERSION")).gsub(/\s/,'')
64 s.requirements << 'none'
65 s.rubyforge_project = 'ebb'
67 s.require_path = 'ruby_lib'
68 s.extensions = 'src/extconf.rb'
70 s.executables = %w(ebb_rails)
72 s.files = FileList.new('src/*.{rl,c,h}',
82 Rake::GemPackageTask.new(spec) do |pkg|
86 CLEAN.add ["**/*.{o,bundle,so,obj,pdb,lib,def,exp}", "benchmark/*.dump", 'site/index.html']
87 CLOBBER.add ['src/Makefile', 'src/parser.c', 'src/mkmf.log','doc', 'coverage']