Skip to content
Newer
Older
100644 110 lines (88 sloc) 2.86 KB
b61903f File structure reorganization.
Ryan Dahl authored
1 require 'rake'
ea11c7c Small parser changes
Ryan Dahl authored
2 require 'rake/testtask'
b61903f File structure reorganization.
Ryan Dahl authored
3 require 'rake/gempackagetask'
95ddafd File reorganization
Ryan Dahl authored
4 require 'rake/clean'
5
00b3ac3 Pave the way for python binding.
Ryan Dahl authored
6 COMMON_DISTFILES = FileList.new('src/ebb.{c,h}', 'src/parser.{c,h}',
26e7c92 Use rb_thread_select instead of rb_thread_schedule
Ryan Dahl authored
7 'libev/*', 'README')
00b3ac3 Pave the way for python binding.
Ryan Dahl authored
8
9 RUBY_DISTFILES = COMMON_DISTFILES + FileList.new('src/ebb_ruby.c',
10 'src/extconf.rb', 'ruby_lib/**/*', 'benchmark/*.rb', 'bin/ebb_rails',
213605b better rake compile task
Ryan Dahl authored
11 'test/*.rb')
00b3ac3 Pave the way for python binding.
Ryan Dahl authored
12
13 PYTHON_DISTFILES = COMMON_DISTFILES + FileList.new('setup.py',
14 'src/ebb_python.c')
15
16 CLEAN.add ["**/*.{o,bundle,so,obj,pdb,lib,def,exp}", "benchmark/*.dump",
17 'site/index.html', 'MANIFEST']
18
19 CLOBBER.add ['src/Makefile', 'src/parser.c', 'src/mkmf.log', 'build']
20
26e7c92 Use rb_thread_select instead of rb_thread_schedule
Ryan Dahl authored
21 Rake::TestTask.new do |t|
22 t.test_files = FileList.new("test/*.rb")
23 t.verbose = true
24 end
00b3ac3 Pave the way for python binding.
Ryan Dahl authored
25
02b6f66 POST requests handled in Ruby
Ryan Dahl authored
26 def dir(path)
27 File.expand_path File.join(File.dirname(__FILE__), path)
28 end
29
213605b better rake compile task
Ryan Dahl authored
30 task(:default => [:compile, :test])
02b6f66 POST requests handled in Ruby
Ryan Dahl authored
31
d478f91 Add ACCEPT header, slight parser cleanup
Ryan Dahl authored
32 task(:compile => ['src/Makefile', 'src/ebb.c', 'src/ebb.h', 'src/ebb_ruby.c', 'src/parser.c', 'src/parser.h']) do
213605b better rake compile task
Ryan Dahl authored
33 sh "cd #{dir('src')} && make"
34 end
35
36 file('src/Makefile' => 'src/extconf.rb') do
37 sh "cd #{dir('src')} && ruby extconf.rb"
38 end
02b6f66 POST requests handled in Ruby
Ryan Dahl authored
39
213605b better rake compile task
Ryan Dahl authored
40 task(:package => 'src/parser.c')
41 file('src/parser.c' => 'src/parser.rl') do
42 sh 'ragel -s -G2 src/parser.rl'
02b6f66 POST requests handled in Ruby
Ryan Dahl authored
43 end
44
00b3ac3 Pave the way for python binding.
Ryan Dahl authored
45 file('MANIFEST') do
46 File.open(dir('MANIFEST'), "w+") do |manifest|
47 PYTHON_DISTFILES.each { |file| manifest.puts(file) }
48 end
49 end
50
95ddafd File reorganization
Ryan Dahl authored
51 task(:wc) { sh "wc -l ruby_lib/*.rb src/ebb*.{c,h}" }
b61903f File structure reorganization.
Ryan Dahl authored
52
26e7c92 Use rb_thread_select instead of rb_thread_schedule
Ryan Dahl authored
53 task(:test => RUBY_DISTFILES)
ea11c7c Small parser changes
Ryan Dahl authored
54 Rake::TestTask.new do |t|
eb823db add header writing to ebb-core
Ryan Dahl authored
55 t.test_files = 'test/basic_test.rb'
ea11c7c Small parser changes
Ryan Dahl authored
56 t.verbose = true
7897e7c clean up benchmark scripts
Ryan Dahl authored
57 end
58
62b496c more site changes
Ryan Dahl authored
59 task(:site_upload => :site) do
60 sh 'scp -r site/* rydahl@rubyforge.org:/var/www/gforge-projects/ebb/'
61 end
62 task(:site => 'site/index.html')
0e2dc88 web site and benchmark fixes
Ryan Dahl authored
63 file('site/index.html' => %w{README site/style.css}) do
64 require 'BlueCloth'
65 doc = BlueCloth.new(File.read(dir('README')))
66 template = <<-HEREDOC
8cd0140 small changes, and adding parser.c
Ryan Dahl authored
67 <html>
68 <head>
69 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
70 <title>Ebb</title>
71 <link rel="alternate" href="http://max.kanat.us/tag-syndicate/?user=four&tag=ebb" title="RSS Feed" type="application/rss+xml" />
72 <link type="text/css" rel="stylesheet" href="style.css" media="screen"/>
73 </head>
74 <body>
75 <div id="content">CONTENT</div>
76 </body>
77 </html>
0e2dc88 web site and benchmark fixes
Ryan Dahl authored
78 HEREDOC
79
80 File.open(dir('site/index.html'), "w+") do |f|
81 f.write template.sub('CONTENT', doc.to_html)
82 end
83 end
84
b61903f File structure reorganization.
Ryan Dahl authored
85 spec = Gem::Specification.new do |s|
86 s.platform = Gem::Platform::RUBY
95ddafd File reorganization
Ryan Dahl authored
87 s.summary = "A Web Server"
88 s.description = ''
b61903f File structure reorganization.
Ryan Dahl authored
89 s.name = 'ebb'
d601635 More random fixes and cleaning up. Nothing major.
Ryan Dahl authored
90 s.author = 'ry dahl'
38aebaa Version bump and continued work on Python binding
Ryan Dahl authored
91 s.email = 'ry at tiny clouds dot org'
92 s.homepage = 'http://ebb.rubyforge.org'
0b99f32 Move version into ebb.h and other misc cleanups
Ryan Dahl authored
93 s.version = `grep EBB_VERSION #{dir('src/ebb.h')}`.match(/\d.\d.\d/)[0]
e371bda more small changes - ebb_rails working
Ryan Dahl authored
94 s.rubyforge_project = 'ebb'
b61903f File structure reorganization.
Ryan Dahl authored
95
7d7ff9e documentation edit and a fix to run on older rubies
Ryan Dahl authored
96 s.add_dependency('rack')
97 s.required_ruby_version = '>= 1.8.4'
98
95ddafd File reorganization
Ryan Dahl authored
99 s.require_path = 'ruby_lib'
100 s.extensions = 'src/extconf.rb'
101 s.bindir = 'bin'
ce6701a Added ebb_rails executable.
Ryan Dahl authored
102 s.executables = %w(ebb_rails)
b61903f File structure reorganization.
Ryan Dahl authored
103
00b3ac3 Pave the way for python binding.
Ryan Dahl authored
104 s.files = RUBY_DISTFILES
b61903f File structure reorganization.
Ryan Dahl authored
105 end
106
107 Rake::GemPackageTask.new(spec) do |pkg|
108 pkg.need_zip = true
6b67ca6 Tests parser errors
Ryan Dahl authored
109 end
Something went wrong with that request. Please try again.