Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 97 lines (78 sloc) 2.392 kB
b6f5664 @auser Fixed tests
auser authored
1 require 'rake'
2 require 'rake/testtask'
3 require 'rake/rdoctask'
c729c4e Fixed problems with Ruby 1.9 and with json gem
Philip (flip) Kromer authored
4 $: << File.dirname(__FILE__)
b6f5664 @auser Fixed tests
auser authored
5 require 'config/requirements'
6
7 begin
8 require 'hanna/rdoctask'
9 rescue LoadError => e
10 require "rake/rdoctask"
11 end
12
13 require 'config/jeweler' # setup gem configuration
14
15 task :default => [:test, :cleanup_test]
16 desc "Update vendor directory and run tests"
fbf5294 @bradphelan re added grempe amazon-ec2 submodule
bradphelan authored
17
18 namespace :poolparty do
19 namespace :vendor do
20 desc "Fetch all the submodules"
21 task :submodules do
22 `git submodule update`
23 end
24 end
25 end
26
27 task :vendor => ["poolparty:vendor:submodules"]
c729c4e Fixed problems with Ruby 1.9 and with json gem
Philip (flip) Kromer authored
28
b6f5664 @auser Fixed tests
auser authored
29 task :cleanup_test do
30 ::FileUtils.rm_rf "/tmp/poolparty"
31 end
c729c4e Fixed problems with Ruby 1.9 and with json gem
Philip (flip) Kromer authored
32
b6f5664 @auser Fixed tests
auser authored
33 # task :test do
34 # sh "ruby -Ilib:test #{Dir["#{File.dirname(__FILE__)}/../test/poolparty/*/*.rb"].join(" ")}"
35 # end
c729c4e Fixed problems with Ruby 1.9 and with json gem
Philip (flip) Kromer authored
36
b6f5664 @auser Fixed tests
auser authored
37 Rake::TestTask.new(:test) do |t|
38 t.test_files = FileList['test/lib/**/*_test.rb']
39 t.warning = false
40 t.verbose = false
41 end
c729c4e Fixed problems with Ruby 1.9 and with json gem
Philip (flip) Kromer authored
42
b6f5664 @auser Fixed tests
auser authored
43 begin
44 require 'rcov/rcovtask'
c729c4e Fixed problems with Ruby 1.9 and with json gem
Philip (flip) Kromer authored
45
b6f5664 @auser Fixed tests
auser authored
46 Rcov::RcovTask.new(:rcov) do |t|
47 t.libs << FileList['lib/**/*.rb']
48 t.rcov_opts = [
49 '-xRakefile', '-xrakefile',
50 '-xlib/erlang',
51 '--text-report',
52 '--sort coverage'
53 ] + FileList['tasks/*.rake'].pathmap("-x%p")
54 t.test_files = FileList['test/lib/**/*_test.rb']
55 t.output_dir = 'coverage'
56 t.verbose = true
57 end
58 rescue LoadError
59 puts "RCov is not available"
60 end
61
62
63 desc "Clean tmp directory"
64 task :clean_tmp do |t|
c729c4e Fixed problems with Ruby 1.9 and with json gem
Philip (flip) Kromer authored
65 FileUtils.rm_rf("#{File.dirname(__FILE__)}/Manifest.txt") if ::File.exists?("#{File.dirname(__FILE__)}/Manifest.txt")
b6f5664 @auser Fixed tests
auser authored
66 FileUtils.touch("#{File.dirname(__FILE__)}/Manifest.txt")
67 %w(logs tmp).each do |dir|
68 FileUtils.rm_rf("#{File.dirname(__FILE__)}/#{dir}") if ::File.exists?("#{File.dirname(__FILE__)}/#{dir}")
69 end
70 end
71
72 desc "Remove the pkg directory"
73 task :clean_pkg do |t|
74 %w(pkg).each do |dir|
75 FileUtils.rm_rf("#{File.dirname(__FILE__)}/#{dir}") if ::File.exists?("#{File.dirname(__FILE__)}/#{dir}")
76 end
77 end
78
79
80 namespace :gem do
81 task(:build).prerequisites.unshift :gemspec # Prepend the gemspec generation
c729c4e Fixed problems with Ruby 1.9 and with json gem
Philip (flip) Kromer authored
82
b6f5664 @auser Fixed tests
auser authored
83 desc "Build the gem only if the tests pass"
84 task :test_then_build => [:test, :build]
c729c4e Fixed problems with Ruby 1.9 and with json gem
Philip (flip) Kromer authored
85
b6f5664 @auser Fixed tests
auser authored
86 desc "Build and install the gem only if the tests pass"
87 task :test_then_install => [:test, :install]
88 end
89
90 # Generate documentation
91 Rake::RDocTask.new do |rd|
92 rd.main = "README.rdoc"
93 rd.rdoc_files.include("README.rdoc", "lib/**/*.rb")
94 rd.rdoc_dir = "rdoc"
95 # rd.template = "hanaa"
fbf5294 @bradphelan re added grempe amazon-ec2 submodule
bradphelan authored
96 end
Something went wrong with that request. Please try again.