Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 119 lines (93 sloc) 2.555 kB
8d085de @zenspider Updated History for 3.0 release.
zenspider authored
1 # -*- ruby -*-
2
86a854f @drbrain Rakefile for ZenTest.
drbrain authored
3 require 'rake'
4 require 'rake/testtask'
5 require 'rake/rdoctask'
6 require 'rake/gempackagetask'
8d085de @zenspider Updated History for 3.0 release.
zenspider authored
7 require 'rbconfig'
86a854f @drbrain Rakefile for ZenTest.
drbrain authored
8
9168ae5 @zenspider Final sweep for 3.1.0 release.
zenspider authored
9 require './lib/zentest.rb'
86a854f @drbrain Rakefile for ZenTest.
drbrain authored
10
11 $VERBOSE = nil
12
13 spec = Gem::Specification.new do |s|
14 s.name = 'ZenTest'
15 s.version = ZenTest::VERSION
16 s.authors = ['Ryan Davis', 'Eric Hodel']
17 s.email = 'ryand-ruby@zenspider.com'
18
be6df18 @zenspider Removed redundancies in rakefile. Using gem spec for most stuff now.
zenspider authored
19 s.files = IO.readlines("Manifest.txt").map {|f| f.chomp }
86a854f @drbrain Rakefile for ZenTest.
drbrain authored
20 s.require_path = 'lib'
be6df18 @zenspider Removed redundancies in rakefile. Using gem spec for most stuff now.
zenspider authored
21
22 s.executables = s.files.grep(/^bin\//).map { |f| File.basename f }
cd13375 @zenspider Fixed gem to do summary and description, filelist, homepage, and RF.
zenspider authored
23
24 paragraphs = File.read("README.txt").split(/\n\n+/)
0b215df @zenspider Minor doco change.
zenspider authored
25 s.instance_variable_set "@description", paragraphs[3..10].join("\n\n")
26 s.instance_variable_set "@summary", paragraphs[12]
cd13375 @zenspider Fixed gem to do summary and description, filelist, homepage, and RF.
zenspider authored
27
894b26d @zenspider Argh. Cleaned up annoying rakefile output. sorry. will merge to 3.0.0.
zenspider authored
28 if $DEBUG then
29 puts "ZenTest #{s.version}"
30 puts
be6df18 @zenspider Removed redundancies in rakefile. Using gem spec for most stuff now.
zenspider authored
31 puts s.executables.sort.inspect
32 puts
0b215df @zenspider Minor doco change.
zenspider authored
33 puts "** summary:"
894b26d @zenspider Argh. Cleaned up annoying rakefile output. sorry. will merge to 3.0.0.
zenspider authored
34 puts s.summary
35 puts
0b215df @zenspider Minor doco change.
zenspider authored
36 puts "** description:"
894b26d @zenspider Argh. Cleaned up annoying rakefile output. sorry. will merge to 3.0.0.
zenspider authored
37 puts s.description
38 end
cd13375 @zenspider Fixed gem to do summary and description, filelist, homepage, and RF.
zenspider authored
39
40 s.homepage = "http://www.zenspider.com/ZSS/Products/ZenTest/"
41 s.rubyforge_project = "zentest"
f2ab3e6 @drbrain We've got RDoc, yes we do!
drbrain authored
42 s.has_rdoc = true
86a854f @drbrain Rakefile for ZenTest.
drbrain authored
43 end
44
be6df18 @zenspider Removed redundancies in rakefile. Using gem spec for most stuff now.
zenspider authored
45 desc 'Build Gem'
46 Rake::GemPackageTask.new spec do |pkg|
47 pkg.need_tar = true
48 end
49
86a854f @drbrain Rakefile for ZenTest.
drbrain authored
50 desc 'Run tests'
51 task :default => :test
52
53 desc 'Run tests'
0cd84d7 @drbrain Rearrange to make ZenTest rubygems-packagable.
drbrain authored
54 Rake::TestTask.new :test do |t|
86a854f @drbrain Rakefile for ZenTest.
drbrain authored
55 t.libs << 'test'
56 t.verbose = true
57 end
58
59 desc 'Update Manifest.txt'
8d085de @zenspider Updated History for 3.0 release.
zenspider authored
60 task :update_manifest => :clean do
61 sh "p4 open Manifest.txt; find . -type f | sed -e 's%./%%' | sort > Manifest.txt"
86a854f @drbrain Rakefile for ZenTest.
drbrain authored
62 end
63
64 desc 'Generate RDoc'
65 Rake::RDocTask.new :rdoc do |rd|
66 rd.rdoc_dir = 'doc'
9168ae5 @zenspider Final sweep for 3.1.0 release.
zenspider authored
67 rd.rdoc_files.add 'lib', 'README.txt', 'History.txt', 'LinuxJournalArticle.txt'
86a854f @drbrain Rakefile for ZenTest.
drbrain authored
68 rd.main = 'README.txt'
ec1f3fc @drbrain RDoc title.
drbrain authored
69 rd.options << '-d' if `which dot` =~ /\/dot/ unless RUBY_PLATFORM =~ /win32/
ee144f4 @drbrain Lots of documentation, but still needs polish.
drbrain authored
70 rd.options << '-t ZenTest RDoc'
86a854f @drbrain Rakefile for ZenTest.
drbrain authored
71 end
72
8d085de @zenspider Updated History for 3.0 release.
zenspider authored
73 $prefix = ENV['PREFIX'] || Config::CONFIG['prefix']
74 $bin = File.join($prefix, 'bin')
75 $lib = Config::CONFIG['sitelibdir']
be6df18 @zenspider Removed redundancies in rakefile. Using gem spec for most stuff now.
zenspider authored
76 $bins = spec.executables
77 $libs = spec.files.grep(/^lib\//).map { |f| f.sub(/^lib\//, '') }.sort
78
79 task :blah do
80 p $bins
81 p $libs
82 end
8d085de @zenspider Updated History for 3.0 release.
zenspider authored
83
84 task :install do
85 $bins.each do |f|
86 install File.join("bin", f), $bin, :mode => 0555
87 end
88
89 $libs.each do |f|
be6df18 @zenspider Removed redundancies in rakefile. Using gem spec for most stuff now.
zenspider authored
90 dir = File.join($lib, File.dirname(f))
91 mkdir_p dir unless test ?d, dir
92 install File.join("lib", f), dir, :mode => 0444
8d085de @zenspider Updated History for 3.0 release.
zenspider authored
93 end
94 end
86a854f @drbrain Rakefile for ZenTest.
drbrain authored
95
8d085de @zenspider Updated History for 3.0 release.
zenspider authored
96 task :uninstall do
9168ae5 @zenspider Final sweep for 3.1.0 release.
zenspider authored
97 # add old versions
98 $bins << "ZenTest"
99 $libs << "ZenTest.rb"
100
8d085de @zenspider Updated History for 3.0 release.
zenspider authored
101 $bins.each do |f|
102 rm_f File.join($bin, f)
103 end
104
105 $libs.each do |f|
106 rm_f File.join($lib, f)
107 end
be6df18 @zenspider Removed redundancies in rakefile. Using gem spec for most stuff now.
zenspider authored
108
109 rm_rf File.join($lib, "test")
8d085de @zenspider Updated History for 3.0 release.
zenspider authored
110 end
111
112 desc 'Clean up'
113 task :clean => [ :clobber_rdoc, :clobber_package ] do
3282f77 @zenspider Fixed clean rule in rakefile.
zenspider authored
114 rm_f Dir["**/*~"]
8d085de @zenspider Updated History for 3.0 release.
zenspider authored
115 end
53d26bc @drbrain Import Test::Rails.
drbrain authored
116
117 # vim:syntax=ruby
118
Something went wrong with that request. Please try again.