ry / ebb fork watch download tarball
public
Description: web server
Homepage: http://ebb.rubyforge.org
Clone URL: git://github.com/ry/ebb.git
Search Repo:
Ryan Dahl (author)
Thu Feb 28 03:31:42 -0800 2008
commit  92fb937e38b63010f15a7d237f99bb6c5b53519c
tree    07ac5abb838cf51b46b8e0dca1c9a645d4278da4
parent  75f68f9db72c1181a59f43a5dd9a04388918d068
ebb / Rakefile
100644 87 lines (70 sloc) 2.322 kb
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
require 'rake'
require 'rake/gempackagetask'
require 'rake/clean'
 
def dir(path)
  File.expand_path File.join(File.dirname(__FILE__), path)
end
 
task(:default => :compile)
 
task(:package => 'src/parser.c')
 
task(:compile => 'src/parser.c') do
  sh "cd #{dir('src')} && ruby extconf.rb && make"
end
 
file('src/parser.c' => 'src/parser.rl') do
  sh "ragel src/parser.rl | rlgen-cd -G2 -o src/parser.c"
end
 
task(:wc) { sh "wc -l ruby_lib/*.rb src/ebb*.{c,h}" }
 
task(:test => :compile) do
  sh "ruby #{dir("benchmark/test.rb")}"
end
 
 
task(:site_upload => :site) do
  sh 'scp -r site/* rydahl@rubyforge.org:/var/www/gforge-projects/ebb/'
end
task(:site => 'site/index.html')
file('site/index.html' => %w{README site/style.css}) do
  require 'BlueCloth'
  
  doc = BlueCloth.new(File.read(dir('README')))
  template = <<-HEREDOC
<html>
<head>
<title>Ebb</title>
<link rel="alternate" href="http://max.kanat.us/tag-syndicate/?user=four&tag=ebb" title="RSS Feed" type="application/rss+xml" />
<link type="text/css" rel="stylesheet" href="style.css" media="screen"/>
</head>
<body>
<div id="content">CONTENT</div>
</body>
</html>
HEREDOC
  
  File.open(dir('site/index.html'), "w+") do |f|
    f.write template.sub('CONTENT', doc.to_html)
  end
end
 
spec = Gem::Specification.new do |s|
  s.platform = Gem::Platform::RUBY
  s.summary = "A Web Server"
  s.description = ''
  s.name = 'ebb'
  s.author = 'ry dahl'
  s.email = 'ry@tinyclouds.org'
  s.homepage = 'http://repo.or.cz/w/ebb.git'
  s.version = File.read(dir("VERSION")).gsub(/\s/,'')
  s.requirements << 'none'
  s.rubyforge_project = 'ebb'
  
  s.require_path = 'ruby_lib'
  s.extensions = 'src/extconf.rb'
  s.bindir = 'bin'
  s.executables = %w(ebb_rails)
  
  s.files = FileList.new('src/*.{c,h}',
                         'src/extconf.rb',
                         'libev/*',
                         'ruby_lib/**/*',
                         'benchmark/*.rb',
                         'bin/ebb_rails',
                         'VERSION',
                         'README')
end
 
Rake::GemPackageTask.new(spec) do |pkg|
  pkg.need_zip = true
end
 
CLEAN.add ["**/*.{o,bundle,so,obj,pdb,lib,def,exp}", "benchmark/*.dump", 'site/index.html']
CLOBBER.add ['src/Makefile', 'src/parser.c', 'src/mkmf.log','doc', 'coverage']