signed mongrel gem
git-svn-id: svn+ssh://rubyforge.org/var/svn/mongrel/trunk@607 19e92222-5c0b-0410-8929-a290d50e31e9
2
CHANGELOG
Normal file
|
@ -0,0 +1,2 @@
|
|||
|
||||
v1.0.2. Signed gem; various bugfixes and patches.
|
160
Manifest
Normal file
|
@ -0,0 +1,160 @@
|
|||
tools/trickletest.rb
|
||||
test_stdout.log
|
||||
test_stderr.log
|
||||
test/testhelp.rb
|
||||
test/test_ws.rb
|
||||
test/test_uriclassifier.rb
|
||||
test/test_stats.rb
|
||||
test/test_response.rb
|
||||
test/test_request_progress.rb
|
||||
test/test_redirect_handler.rb
|
||||
test/test_http11.rb
|
||||
test/test_handlers.rb
|
||||
test/test_debug.rb
|
||||
test/test_configurator.rb
|
||||
test/test_conditional.rb
|
||||
test/test_command.rb
|
||||
test/test_cgi_wrapper.rb
|
||||
test/mongrel.conf
|
||||
test/mime.yaml
|
||||
site/src/sitemap.page
|
||||
site/src/security.page
|
||||
site/src/plugins.page
|
||||
site/src/not_mongrel.page
|
||||
site/src/news.page
|
||||
site/src/news.include
|
||||
site/src/license.page
|
||||
site/src/index.page
|
||||
site/src/images/visual_dog.jpg
|
||||
site/src/images/visual.jpg
|
||||
site/src/images/tn_bg2.gif
|
||||
site/src/images/tn_bg1.gif
|
||||
site/src/images/tl_sitemap.gif
|
||||
site/src/images/tl_sitemap-on.gif
|
||||
site/src/images/tl_sitemap-c1.gif
|
||||
site/src/images/tl_sitemap-c1-on.gif
|
||||
site/src/images/tl_home.gif
|
||||
site/src/images/tl_home-on.gif
|
||||
site/src/images/tl_home-c1.gif
|
||||
site/src/images/tl_home-c1-on.gif
|
||||
site/src/images/tl_contact.gif
|
||||
site/src/images/tl_contact-on.gif
|
||||
site/src/images/tl_contact-c1.gif
|
||||
site/src/images/tl_contact-c1-on.gif
|
||||
site/src/images/side_p3.gif
|
||||
site/src/images/side_p2.gif
|
||||
site/src/images/side_p1.gif
|
||||
site/src/images/mongrel_not_scgi.jpg
|
||||
site/src/images/li4.gif
|
||||
site/src/images/li3.gif
|
||||
site/src/images/li3-c1.gif
|
||||
site/src/images/li2.gif
|
||||
site/src/images/li2-c1.gif
|
||||
site/src/images/li1b.gif
|
||||
site/src/images/li1b-c1.gif
|
||||
site/src/images/li1a.gif
|
||||
site/src/images/li1a-c1.gif
|
||||
site/src/images/iron_mongrel.jpg
|
||||
site/src/images/index.page
|
||||
site/src/images/config_tool_snap.png
|
||||
site/src/images/bug_votes.png
|
||||
site/src/images/98452447_1be256a96c.jpg
|
||||
site/src/images/92211824_d01a4ce59c.jpg
|
||||
site/src/images/90208926_7d64788f30.jpg
|
||||
site/src/images/87022458_3981942f0c.jpg
|
||||
site/src/images/86461088_9a747a6a5e.jpg
|
||||
site/src/images/85895062_beb6249744.jpg
|
||||
site/src/images/79968762_e063fc1317.jpg
|
||||
site/src/images/63325054_12298eb2a3.jpg
|
||||
site/src/images/6267035_eeec5b0f16.jpg
|
||||
site/src/images/3colls_p3.jpg
|
||||
site/src/images/3colls_p2.jpg
|
||||
site/src/images/3colls_p1.jpg
|
||||
site/src/images/3930442_6cbcae1335.jpg
|
||||
site/src/fasq.page
|
||||
site/src/faq.page
|
||||
site/src/dogs.page
|
||||
site/src/docs/win32.page
|
||||
site/src/docs/upload_progress_rails.rb
|
||||
site/src/docs/upload_progress_javascript.js
|
||||
site/src/docs/upload_progress_form.rhtml
|
||||
site/src/docs/upload_progress.page
|
||||
site/src/docs/started.page
|
||||
site/src/docs/SimpleLighttpdMongrelSetup.jpg
|
||||
site/src/docs/security.page
|
||||
site/src/docs/pound.page
|
||||
site/src/docs/pen_balance.page
|
||||
site/src/docs/osx.page
|
||||
site/src/docs/mongrel_cluster.page
|
||||
site/src/docs/litespeed.page
|
||||
site/src/docs/lighttpd.page
|
||||
site/src/docs/index.page
|
||||
site/src/docs/howto.page
|
||||
site/src/docs/how_many_mongrels.page
|
||||
site/src/docs/gem_plugin.page
|
||||
site/src/docs/frameworks.page
|
||||
site/src/docs/distributed_worker.page
|
||||
site/src/docs/debian-sarge.page
|
||||
site/src/docs/contrib.page
|
||||
site/src/docs/choosing_deployment.page
|
||||
site/src/docs/apache.page
|
||||
site/src/default.template
|
||||
site/src/default.css
|
||||
site/src/certified.page
|
||||
site/src/books.page
|
||||
site/src/attributions.page
|
||||
site/src/adoption.page
|
||||
site/README
|
||||
site/config.yml
|
||||
site/atom.rb
|
||||
setup.rb
|
||||
README
|
||||
mongrel.gemspec
|
||||
mongrel-public_cert.pem
|
||||
Manifest
|
||||
log/mongrel_debug/objects.log
|
||||
LICENSE
|
||||
lib/mutex_fix.rb
|
||||
lib/mongrel.rb
|
||||
lib/mongrel/tcphack.rb
|
||||
lib/mongrel/stats.rb
|
||||
lib/mongrel/rails.rb
|
||||
lib/mongrel/mime_types.yml
|
||||
lib/mongrel/init.rb
|
||||
lib/mongrel/handlers.rb
|
||||
lib/mongrel/debug.rb
|
||||
lib/mongrel/configurator.rb
|
||||
lib/mongrel/command.rb
|
||||
lib/mongrel/cgi.rb
|
||||
lib/mongrel/camping.rb
|
||||
ext/http11/tst_search.c
|
||||
ext/http11/tst_insert.c
|
||||
ext/http11/tst_init.c
|
||||
ext/http11/tst_grow_node_free_list.c
|
||||
ext/http11/tst_delete.c
|
||||
ext/http11/tst_cleanup.c
|
||||
ext/http11/tst.h
|
||||
ext/http11/mkmf.log
|
||||
ext/http11/MANIFEST
|
||||
ext/http11/http11_parser.rl
|
||||
ext/http11/http11_parser.h
|
||||
ext/http11/http11_parser.c
|
||||
ext/http11/http11.c
|
||||
ext/http11/extconf.rb
|
||||
ext/http11/ext_help.h
|
||||
examples/webrick_compare.rb
|
||||
examples/simpletest.rb
|
||||
examples/random_thrash.rb
|
||||
examples/monitrc
|
||||
examples/mongrel_simple_service.rb
|
||||
examples/mongrel_simple_ctrl.rb
|
||||
examples/mongrel.conf
|
||||
examples/mime.yaml
|
||||
examples/httpd.conf
|
||||
examples/camping/tepee.rb
|
||||
examples/camping/README
|
||||
examples/camping/blog.rb
|
||||
examples/builder.rb
|
||||
COPYING
|
||||
CHANGELOG
|
||||
bin/mongrel_rails
|
133
Rakefile
|
@ -1,22 +1,35 @@
|
|||
require 'rake'
|
||||
require 'rake/testtask'
|
||||
require 'rake/clean'
|
||||
require 'rake/gempackagetask'
|
||||
require 'rake/rdoctask'
|
||||
require 'tools/rakehelp'
|
||||
require 'fileutils'
|
||||
include FileUtils
|
||||
|
||||
setup_tests
|
||||
setup_clean ["ext/http11/*.{bundle,so,obj,pdb,lib,def,exp}", "ext/http11/Makefile", "pkg", "lib/*.bundle", "*.gem", "doc/site/output", ".config"]
|
||||
require 'echoe'
|
||||
|
||||
setup_rdoc ['README', 'LICENSE', 'COPYING', 'lib/**/*.rb', 'doc/**/*.rdoc', 'ext/http11/http11.c']
|
||||
Echoe.new("mongrel") do |p|
|
||||
p.summary = "A small fast HTTP library and server that runs Rails, Camping, Nitro and Iowa apps."
|
||||
p.author ="Zed A. Shaw"
|
||||
p.clean_pattern = ["ext/http11/*.{bundle,so,o,obj,pdb,lib,def,exp}", "ext/http11/Makefile", "pkg", "lib/*.bundle", "*.gem", "doc/site/output", ".config"]
|
||||
p.rdoc_pattern = ['README', 'LICENSE', 'COPYING', 'lib/**/*.rb', 'doc/**/*.rdoc', 'ext/http11/http11.c']
|
||||
p.ignore_pattern = /^projects/
|
||||
p.ruby_version = '>= 1.8.4'
|
||||
p.dependencies = ['gem_plugin >=0.2.2', 'cgi_multipart_eof_fix >=2']
|
||||
|
||||
desc "Does a full compile, test run"
|
||||
task :default => [:compile, :test]
|
||||
p.need_tar_gz = false
|
||||
p.need_tgz = true
|
||||
p.certificate_chain = ['/Users/eweaver/p/configuration/gem_certificates/mongrel/mongrel-public_cert.pem',
|
||||
'/Users/eweaver/p/configuration/gem_certificates/evan_weaver-mongrel-public_cert.pem']
|
||||
p.require_signed = true
|
||||
|
||||
desc "Compiles all extensions"
|
||||
task :compile => [:http11] do
|
||||
p.eval = proc do
|
||||
if RUBY_PLATFORM =~ /mswin/
|
||||
files += ['lib/http11.so']
|
||||
extensions.clear
|
||||
platform = Gem::Platform::WIN32
|
||||
else
|
||||
add_dependency('daemons', '>= 1.0.3')
|
||||
add_dependency('fastthread', '>= 0.6.2')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
task :compile do
|
||||
# Append a sanity check to the compile task
|
||||
if Dir.glob(File.join("lib","http11.*")).length == 0
|
||||
STDERR.puts "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
|
||||
STDERR.puts "Gem actually failed to build. Your system is"
|
||||
|
@ -26,63 +39,25 @@ task :compile => [:http11] do
|
|||
end
|
||||
end
|
||||
|
||||
task :package => [:clean,:compile,:test,:rerdoc]
|
||||
#### Project-wide install and uninstall tasks
|
||||
|
||||
task :ragel do
|
||||
sh %{ragel ext/http11/http11_parser.rl | rlgen-cd -G2 -o ext/http11/http11_parser.c}
|
||||
end
|
||||
|
||||
task :site_webgen do
|
||||
sh %{pushd doc/site; webgen; ruby atom.rb > output/feed.atom; rsync -azv output/* rubyforge.org:/var/www/gforge-projects/mongrel/; popd }
|
||||
end
|
||||
|
||||
task :site_rdoc do
|
||||
sh %{ rsync -azv doc/rdoc/* rubyforge.org:/var/www/gforge-projects/mongrel/rdoc/ }
|
||||
end
|
||||
|
||||
task :site_coverage => [:rcov] do
|
||||
sh %{ rsync -azv test/coverage/* rubyforge.org:/var/www/gforge-projects/mongrel/coverage/ }
|
||||
end
|
||||
|
||||
task :site_projects_rdoc do
|
||||
sh %{ cd projects/gem_plugin; rake site }
|
||||
end
|
||||
|
||||
task :site => [:site_webgen, :site_rdoc, :site_coverage, :site_projects_rdoc]
|
||||
|
||||
setup_extension("http11", "http11")
|
||||
|
||||
name="mongrel"
|
||||
version="1.0.2"
|
||||
|
||||
setup_gem(name, version) do |spec|
|
||||
spec.summary = "A small fast HTTP library and server that runs Rails, Camping, Nitro and Iowa apps."
|
||||
spec.description = spec.summary
|
||||
spec.test_files = Dir.glob('test/test_*.rb')
|
||||
spec.author="Zed A. Shaw"
|
||||
spec.executables=['mongrel_rails']
|
||||
spec.files += %w(ext/http11/MANIFEST README Rakefile setup.rb lib/mongrel/mime_types.yml)
|
||||
|
||||
spec.required_ruby_version = '>= 1.8.4'
|
||||
|
||||
if RUBY_PLATFORM =~ /mswin/
|
||||
spec.files += ['lib/http11.so']
|
||||
spec.extensions.clear
|
||||
spec.platform = Gem::Platform::WIN32
|
||||
else
|
||||
spec.add_dependency('daemons', '>= 1.0.3')
|
||||
spec.add_dependency('fastthread', '>= 0.6.2')
|
||||
def sub_project(project, *targets)
|
||||
targets.each do |target|
|
||||
Dir.chdir "projects/#{project}" do
|
||||
sh %{rake --trace #{target.to_s} }
|
||||
end
|
||||
end
|
||||
|
||||
spec.add_dependency('gem_plugin', '>= 0.2.2')
|
||||
spec.add_dependency('cgi_multipart_eof_fix', '>= 2')
|
||||
end
|
||||
|
||||
task :install do
|
||||
task :install_requirements do
|
||||
# These run before Mongrel is installed
|
||||
sub_project("gem_plugin", :install)
|
||||
sub_project("cgi_multipart_eof_fix", :install)
|
||||
sub_project("fastthread", :install)
|
||||
sh %{rake package}
|
||||
sh %{gem install pkg/mongrel-#{version}}
|
||||
end
|
||||
|
||||
task :install => [:install_requirements] do
|
||||
# These run after Mongrel is installed
|
||||
sub_project("mongrel_status", :install)
|
||||
sub_project("mongrel_upload_progress", :install)
|
||||
sub_project("mongrel_console", :install)
|
||||
|
@ -94,9 +69,9 @@ end
|
|||
|
||||
task :uninstall => [:clean] do
|
||||
sub_project("mongrel_status", :uninstall)
|
||||
sub_project("cgi_multipart_eof_fix", :uninstall)
|
||||
sub_project("mongrel_upload_progress", :uninstall)
|
||||
sub_project("mongrel_console", :uninstall)
|
||||
sh %{gem uninstall mongrel}
|
||||
sub_project("gem_plugin", :uninstall)
|
||||
sub_project("fastthread", :uninstall)
|
||||
if RUBY_PLATFORM =~ /mswin/
|
||||
|
@ -104,7 +79,9 @@ task :uninstall => [:clean] do
|
|||
end
|
||||
end
|
||||
|
||||
#### Documentation upload tasks
|
||||
|
||||
# Is this still used?
|
||||
task :gem_source do
|
||||
mkdir_p "pkg/gems"
|
||||
mkdir_p "pkg/tar"
|
||||
|
@ -116,3 +93,25 @@ task :gem_source do
|
|||
sh %{ index_gem_repository.rb -d pkg }
|
||||
sh %{ scp -r ChangeLog pkg/* rubyforge.org:/var/www/gforge-projects/mongrel/releases/ }
|
||||
end
|
||||
|
||||
task :ragel do
|
||||
sh %{ragel ext/http11/http11_parser.rl | rlgen-cd -G2 -o ext/http11/http11_parser.c}
|
||||
end
|
||||
|
||||
task :site_webgen do
|
||||
sh %{pushd site; webgen; ruby atom.rb > output/feed.atom; rsync -azv output/* rubyforge.org:/var/www/gforge-projects/mongrel/; popd }
|
||||
end
|
||||
|
||||
task :site_rdoc => [:redoc] do
|
||||
sh %{ rsync -azv doc/* rubyforge.org:/var/www/gforge-projects/mongrel/rdoc/ }
|
||||
end
|
||||
|
||||
task :site_coverage => [:rcov] do
|
||||
sh %{ rsync -azv test/coverage/* rubyforge.org:/var/www/gforge-projects/mongrel/coverage/ }
|
||||
end
|
||||
|
||||
task :site_projects_rdoc do
|
||||
sh %{ cd projects/gem_plugin; rake site }
|
||||
end
|
||||
|
||||
task :site => [:site_webgen, :site_rdoc, :site_coverage, :site_projects_rdoc]
|
||||
|
|
20
mongrel-public_cert.pem
Normal file
|
@ -0,0 +1,20 @@
|
|||
-----BEGIN CERTIFICATE-----
|
||||
MIIDUDCCAjigAwIBAgIBADANBgkqhkiG9w0BAQUFADBOMRwwGgYDVQQDDBNtb25n
|
||||
cmVsLWRldmVsb3BtZW50MRkwFwYKCZImiZPyLGQBGRYJcnVieWZvcmdlMRMwEQYK
|
||||
CZImiZPyLGQBGRYDb3JnMB4XDTA3MDkxNjEwMzI0OVoXDTA4MDkxNTEwMzI0OVow
|
||||
TjEcMBoGA1UEAwwTbW9uZ3JlbC1kZXZlbG9wbWVudDEZMBcGCgmSJomT8ixkARkW
|
||||
CXJ1Ynlmb3JnZTETMBEGCgmSJomT8ixkARkWA29yZzCCASIwDQYJKoZIhvcNAQEB
|
||||
BQADggEPADCCAQoCggEBAMb9v3B01eOHk3FyypbQgKXzJplUE5P6dXoG+xpPm0Lv
|
||||
P7BQmeMncOwqQ7zXpVQU+lTpXtQFTsOE3vL7KnhQFJKGvUAkbh24VFyopu1I0yqF
|
||||
mGu4nRqNXGXVj8TvLSj4S1WpSRLAa0acLPNyKhGmoV9+crqQypSjM6XKjBeppifo
|
||||
4eBmWGjiJEYMIJBvJZPJ4rAVDDA8C6CM1m3gMBGNh8ELDhU8HI9AP3dMIkTI2Wx9
|
||||
9xkJwHdroAaS0IFFtYChrwee4FbCF1FHDgoTosMwa47DrLHg4hZ6ojaKwK5QVWEV
|
||||
XGb6ju5UqpktnSWF2W+Lvl/K0tI42OH2CAhebT1gEVUCAwEAAaM5MDcwCQYDVR0T
|
||||
BAIwADALBgNVHQ8EBAMCBLAwHQYDVR0OBBYEFGHChyMSZ16u9WOzKhgJSQ9lqDc5
|
||||
MA0GCSqGSIb3DQEBBQUAA4IBAQA/lfeN2WdB1xN+82tT7vNS4HOjRQw6MUh5yktu
|
||||
GQjaGqm0UB+aX0Z9y0B0qpfv9rj7nmIvEGiwBmDepNWYCGuW15JyqpN7QVVnG2xS
|
||||
Mrame7VqgjM7A+VGDD5In5LtWbM/CHAATvvFlQ5Ph13YE1EdnVbZ65c+KQv+5sFY
|
||||
Q+zEop74d878uaC/SAHHXS46TiXneocaLSYw1CEZs/MAIy+9c4Q5ESbGpgnfg1Ad
|
||||
6lwl7k3hsNHO/+tZzx4HJtOXDI1yAl3+q6T9J0yI3z97EinwvAKhS1eyOI2Y5eeT
|
||||
tbQaNYkU127B3l/VNpd8fQm3Jkl/PqCCmDBQjUszFrJEODug
|
||||
-----END CERTIFICATE-----
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 64 KiB After Width: | Height: | Size: 64 KiB |
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 59 KiB After Width: | Height: | Size: 59 KiB |
Before Width: | Height: | Size: 150 KiB After Width: | Height: | Size: 150 KiB |
Before Width: | Height: | Size: 205 KiB After Width: | Height: | Size: 205 KiB |
Before Width: | Height: | Size: 180 KiB After Width: | Height: | Size: 180 KiB |
Before Width: | Height: | Size: 134 KiB After Width: | Height: | Size: 134 KiB |
Before Width: | Height: | Size: 134 KiB After Width: | Height: | Size: 134 KiB |
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 156 KiB After Width: | Height: | Size: 156 KiB |
Before Width: | Height: | Size: 108 KiB After Width: | Height: | Size: 108 KiB |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 37 KiB |
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 24 KiB |
Before Width: | Height: | Size: 131 B After Width: | Height: | Size: 131 B |
Before Width: | Height: | Size: 130 B After Width: | Height: | Size: 130 B |
Before Width: | Height: | Size: 122 B After Width: | Height: | Size: 122 B |
Before Width: | Height: | Size: 122 B After Width: | Height: | Size: 122 B |
Before Width: | Height: | Size: 59 B After Width: | Height: | Size: 59 B |
Before Width: | Height: | Size: 59 B After Width: | Height: | Size: 59 B |
Before Width: | Height: | Size: 59 B After Width: | Height: | Size: 59 B |
Before Width: | Height: | Size: 59 B After Width: | Height: | Size: 59 B |
Before Width: | Height: | Size: 65 B After Width: | Height: | Size: 65 B |
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 19 KiB |
Before Width: | Height: | Size: 6.8 KiB After Width: | Height: | Size: 6.8 KiB |
Before Width: | Height: | Size: 6.9 KiB After Width: | Height: | Size: 6.9 KiB |
Before Width: | Height: | Size: 9.1 KiB After Width: | Height: | Size: 9.1 KiB |
Before Width: | Height: | Size: 79 B After Width: | Height: | Size: 79 B |
Before Width: | Height: | Size: 79 B After Width: | Height: | Size: 79 B |
Before Width: | Height: | Size: 79 B After Width: | Height: | Size: 79 B |
Before Width: | Height: | Size: 79 B After Width: | Height: | Size: 79 B |
Before Width: | Height: | Size: 77 B After Width: | Height: | Size: 77 B |
Before Width: | Height: | Size: 77 B After Width: | Height: | Size: 77 B |
Before Width: | Height: | Size: 77 B After Width: | Height: | Size: 77 B |
Before Width: | Height: | Size: 77 B After Width: | Height: | Size: 77 B |
Before Width: | Height: | Size: 79 B After Width: | Height: | Size: 79 B |
Before Width: | Height: | Size: 79 B After Width: | Height: | Size: 79 B |
Before Width: | Height: | Size: 79 B After Width: | Height: | Size: 79 B |
Before Width: | Height: | Size: 79 B After Width: | Height: | Size: 79 B |
Before Width: | Height: | Size: 56 B After Width: | Height: | Size: 56 B |
Before Width: | Height: | Size: 56 B After Width: | Height: | Size: 56 B |
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 23 KiB |
Before Width: | Height: | Size: 112 KiB After Width: | Height: | Size: 112 KiB |
|
@ -1,117 +0,0 @@
|
|||
def make(makedir)
|
||||
Dir.chdir(makedir) do
|
||||
sh(PLATFORM =~ /win32/ ? 'nmake' : 'make')
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
def extconf(dir)
|
||||
Dir.chdir(dir) do ruby "extconf.rb" end
|
||||
end
|
||||
|
||||
|
||||
def setup_tests
|
||||
Rake::TestTask.new do |t|
|
||||
t.libs << "test"
|
||||
t.test_files = FileList['test/test*.rb']
|
||||
t.verbose = true
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
def setup_clean otherfiles
|
||||
files = ['build/*', '**/*.o', '**/*.so', '**/*.a', 'lib/*-*', '**/*.log'] + otherfiles
|
||||
CLEAN.include(files)
|
||||
end
|
||||
|
||||
|
||||
def setup_rdoc files
|
||||
Rake::RDocTask.new do |rdoc|
|
||||
rdoc.rdoc_dir = 'doc/rdoc'
|
||||
rdoc.options << '--line-numbers'
|
||||
rdoc.rdoc_files.add(files)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
def setup_extension(dir, extension)
|
||||
ext = "ext/#{dir}"
|
||||
ext_so = "#{ext}/#{extension}.#{Config::CONFIG['DLEXT']}"
|
||||
ext_files = FileList[
|
||||
"#{ext}/*.c",
|
||||
"#{ext}/*.h",
|
||||
"#{ext}/extconf.rb",
|
||||
"#{ext}/Makefile",
|
||||
"lib"
|
||||
]
|
||||
|
||||
task "lib" do
|
||||
directory "lib"
|
||||
end
|
||||
|
||||
desc "Builds just the #{extension} extension"
|
||||
task extension.to_sym => ["#{ext}/Makefile", ext_so ]
|
||||
|
||||
file "#{ext}/Makefile" => ["#{ext}/extconf.rb"] do
|
||||
extconf "#{ext}"
|
||||
end
|
||||
|
||||
file ext_so => ext_files do
|
||||
make "#{ext}"
|
||||
cp ext_so, "lib"
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
def base_gem_spec(pkg_name, pkg_version)
|
||||
rm_rf "test/coverage"
|
||||
pkg_version = pkg_version
|
||||
pkg_name = pkg_name
|
||||
pkg_file_name = "#{pkg_name}-#{pkg_version}"
|
||||
Gem::Specification.new do |s|
|
||||
s.name = pkg_name
|
||||
s.version = pkg_version
|
||||
s.platform = Gem::Platform::RUBY
|
||||
s.has_rdoc = true
|
||||
s.extra_rdoc_files = [ "README" ]
|
||||
|
||||
s.files = %w(COPYING LICENSE README Rakefile) +
|
||||
Dir.glob("{bin,doc/rdoc,test}/**/*") +
|
||||
Dir.glob("ext/**/*.{h,c,rb,rl}") +
|
||||
Dir.glob("{examples,tools,lib}/**/*.rb")
|
||||
|
||||
s.require_path = "lib"
|
||||
s.extensions = FileList["ext/**/extconf.rb"].to_a
|
||||
s.bindir = "bin"
|
||||
end
|
||||
end
|
||||
|
||||
def setup_gem(pkg_name, pkg_version)
|
||||
spec = base_gem_spec(pkg_name, pkg_version)
|
||||
yield spec if block_given?
|
||||
|
||||
Rake::GemPackageTask.new(spec) do |p|
|
||||
p.gem_spec = spec
|
||||
p.need_tar = true if RUBY_PLATFORM !~ /mswin/
|
||||
end
|
||||
end
|
||||
|
||||
def sub_project(project, *targets)
|
||||
targets.each do |target|
|
||||
Dir.chdir "projects/#{project}" do
|
||||
sh %{rake --trace #{target.to_s} }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# Conditional require rcov/rcovtask if present
|
||||
begin
|
||||
require 'rcov/rcovtask'
|
||||
|
||||
Rcov::RcovTask.new do |t|
|
||||
t.test_files = FileList['test/test*.rb']
|
||||
t.rcov_opts << "-x /usr"
|
||||
t.output_dir = "test/coverage"
|
||||
end
|
||||
rescue Object
|
||||
end
|