Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 62 lines (51 sloc) 1.616 kB
9ee4989 @tarcieri Switch from Jeweler to Bundler and modernize
authored
1 require 'bundler/gem_tasks'
3f5a4fe Initial commit of codebase to trunk
tarcieri authored
2 require 'rake/clean'
3
2a80d0e Jewelerize
Tony Arcieri authored
4 require 'rspec/core/rake_task'
9ee4989 @tarcieri Switch from Jeweler to Bundler and modernize
authored
5 RSpec::Core::RakeTask.new
5ec5f25 Shift away from rakehelp
tarcieri authored
6
9ee4989 @tarcieri Switch from Jeweler to Bundler and modernize
authored
7 RSpec::Core::RakeTask.new(:rcov) do |task|
8 task.rcov = true
deed722 Modified HTTP/1.1 parser to accept a single character of whitespace b…
tarcieri authored
9 end
10
2a80d0e Jewelerize
Tony Arcieri authored
11 task :default => %w(compile spec)
12
a8734e6 @tarcieri RDoc fixups
authored
13 require 'rdoc/task'
2a80d0e Jewelerize
Tony Arcieri authored
14 Rake::RDocTask.new do |rdoc|
15 version = File.exist?('VERSION') ? File.read('VERSION') : ""
16
17 rdoc.rdoc_dir = 'rdoc'
18 rdoc.title = "cool.io #{version}"
19 rdoc.rdoc_files.include('README*')
20 rdoc.rdoc_files.include('lib/**/*.rb')
5ec5f25 Shift away from rakehelp
tarcieri authored
21 end
22
1b38f95 @luislavena Leverage on rake-compiler for extension compilation
luislavena authored
23 require 'rake/extensiontask'
24 Rake::ExtensionTask.new('http11_client') do |ext|
5ec5f25 Shift away from rakehelp
tarcieri authored
25 end
26
1b38f95 @luislavena Leverage on rake-compiler for extension compilation
luislavena authored
27 Rake::ExtensionTask.new('cool.io_ext') do |ext|
28 ext.ext_dir = 'ext/cool.io'
5ec5f25 Shift away from rakehelp
tarcieri authored
29 end
30
3c3a760 Readd Rake task for rebuilding the http11 client parser with Ragel
Tony Arcieri authored
31 # Rebuild parser Ragel
32 task :http11_parser do
33 Dir.chdir "ext/http11_client" do
34 target = "http11_parser.c"
35 File.unlink target if File.exist? target
36 sh "ragel http11_parser.rl | rlgen-cd -G2 -o #{target}"
37 raise "Failed to build C source" unless File.exist? target
38 end
39 end
3623244 @rares Adding valgrind task
rares authored
40
04110f9 @rares citing rake task influence
rares authored
41 # adapted from http://flavoriffic.blogspot.com/2009/06/easily-valgrind-gdb-your-ruby-c.html
42 def specs_command
43 require "find"
3623244 @rares Adding valgrind task
rares authored
44 files = []
04110f9 @rares citing rake task influence
rares authored
45 Find.find("spec") do |f|
3623244 @rares Adding valgrind task
rares authored
46 files << f if File.basename(f) =~ /.*spec.*\.rb$/
47 end
e7d2c55 @rares update valgrind config and fix stat watcher unit test to not fail spo…
rares authored
48 cmdline = "#{RUBY} -I.:lib:ext:spec \
04110f9 @rares citing rake task influence
rares authored
49 -e '%w[#{files.join(' ')}].each { |f| require f }'"
3623244 @rares Adding valgrind task
rares authored
50 end
51
9ee4989 @tarcieri Switch from Jeweler to Bundler and modernize
authored
52 namespace :spec do
e7d2c55 @rares update valgrind config and fix stat watcher unit test to not fail spo…
rares authored
53 desc "run specs with valgrind"
3623244 @rares Adding valgrind task
rares authored
54 task :valgrind => :compile do
e7d2c55 @rares update valgrind config and fix stat watcher unit test to not fail spo…
rares authored
55 system "valgrind --num-callers=15 \
56 --partial-loads-ok=yes --undef-value-errors=no \
57 --tool=memcheck --leak-check=yes --track-fds=yes \
58 --show-reachable=yes #{specs_command}"
3623244 @rares Adding valgrind task
rares authored
59 end
959ed49 @tarcieri Fix clean task
authored
60 end
61
62 CLEAN.include "**/*.rbc", "**/*.o", "**/*.so", "**/*.bundle"
Something went wrong with that request. Please try again.