Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 89 lines (72 sloc) 2.383 kb
2a80d0e Jewelerize
Tony Arcieri authored
1 require 'rubygems'
3f5a4fe Initial commit of codebase to trunk
tarcieri authored
2 require 'rake'
3 require 'rake/clean'
4
2a80d0e Jewelerize
Tony Arcieri authored
5 begin
6 require 'jeweler'
7 Jeweler::Tasks.new do |gem|
8 gem.name = "cool.io"
9 gem.summary = "The cool event framework for Ruby"
10 gem.description = "A Ruby wrapper around the libev high performance event library"
11 gem.email = "tony@medioh.com"
12 gem.homepage = "http://github.com/tarcieri/cool.io"
13 gem.authors = ["Tony Arcieri"]
14 gem.add_dependency "iobuffer", ">= 0.1.3"
15 gem.add_development_dependency "rspec", "~> 2.0.0"
16 gem.extensions = FileList["ext/**/extconf.rb"].to_a
17
18 # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
19 end
20 Jeweler::GemcutterTasks.new
21 rescue LoadError
22 puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
23 end
3f5a4fe Initial commit of codebase to trunk
tarcieri authored
24
2a80d0e Jewelerize
Tony Arcieri authored
25 require 'rspec/core/rake_task'
26 RSpec::Core::RakeTask.new(:spec) do |spec|
27 spec.pattern = 'spec/**/*_spec.rb'
28 spec.rspec_opts = %w[-fs -c -b]
5ec5f25 Shift away from rakehelp
tarcieri authored
29 end
30
2a80d0e Jewelerize
Tony Arcieri authored
31 RSpec::Core::RakeTask.new(:rcov) do |spec|
32 spec.pattern = 'spec/**/*_spec.rb'
33 spec.rcov = true
34 spec.rspec_opts = %w[-fs -c -b]
deed722 Modified HTTP/1.1 parser to accept a single character of whitespace b…
tarcieri authored
35 end
36
2a80d0e Jewelerize
Tony Arcieri authored
37 task :default => %w(compile spec)
38 task :spec => :check_dependencies
39
40 require 'rake/rdoctask'
41 Rake::RDocTask.new do |rdoc|
42 version = File.exist?('VERSION') ? File.read('VERSION') : ""
43
44 rdoc.rdoc_dir = 'rdoc'
45 rdoc.title = "cool.io #{version}"
46 rdoc.rdoc_files.include('README*')
47 rdoc.rdoc_files.include('lib/**/*.rb')
5ec5f25 Shift away from rakehelp
tarcieri authored
48 end
49
50 def make(makedir)
51 Dir.chdir(makedir) { sh 'make' }
52 end
53
54 def extconf(dir)
55 Dir.chdir(dir) { ruby "extconf.rb" }
56 end
57
58 def setup_extension(dir, extension)
59 ext = "ext/#{dir}"
60 ext_so = "#{ext}/#{extension}.#{Config::CONFIG['DLEXT']}"
61 ext_files = FileList[
62 "#{ext}/*.c",
63 "#{ext}/*.h",
64 "#{ext}/extconf.rb",
65 "#{ext}/Makefile",
66 ]
67
68 desc "Builds just the #{extension} extension"
69 task extension.to_sym => ["#{ext}/Makefile", ext_so ]
70
71 file "#{ext}/Makefile" => ["#{ext}/extconf.rb"] do
72 extconf "#{ext}"
73 end
74
75 file ext_so => ext_files do
76 make "#{ext}"
77 cp ext_so, "lib"
78 end
79 end
3f5a4fe Initial commit of codebase to trunk
tarcieri authored
80
81 setup_extension("rev", "rev_ext")
ec655b5 Restore http11_client extension
tarcieri authored
82 setup_extension("http11_client", "http11_client")
3f5a4fe Initial commit of codebase to trunk
tarcieri authored
83
5ec5f25 Shift away from rakehelp
tarcieri authored
84 task :compile => [:rev_ext, :http11_client]
85
d15a2fc Update clean tasks in Rakefile
Tony Arcieri authored
86 CLEAN.include ["build/*", "**/*.o", "**/*.so", "**/*.a", "**/*.log", "pkg"]
2a80d0e Jewelerize
Tony Arcieri authored
87 CLEAN.include ["ext/**/Makefile", "lib/rev_ext.*", "lib/http11_client.*"]
88 CLEAN.include ["ext/**/*.#{Config::CONFIG["DLEXT"]}"]
Something went wrong with that request. Please try again.