Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100755 78 lines (62 sloc) 1.666 kB
2f3049e @raggi Initial - limited specs, but working as a stab case. See manual_testi…
authored
1 #!/usr/bin/env rake
22d3621 @raggi Added some support for rdocs, might help a few folks
authored
2 require 'rake'
3 require 'rake/clean'
4 require 'rake/rdoctask'
2f3049e @raggi Initial - limited specs, but working as a stab case. See manual_testi…
authored
5
6 task :default => :build
7 task :default => :spec
8
d475804 @raggi Added some more helpers to the rakefile
authored
9 task :release => [:'git:push', :'git:merge:stable']
10
2f3049e @raggi Initial - limited specs, but working as a stab case. See manual_testi…
authored
11 task :build => :'gen:install'
12
b972466 @raggi some more goodies, and ideas en route
authored
13 task :install => :build do
14 sh 'sudo ruby install.rb'
15 end
16
2f3049e @raggi Initial - limited specs, but working as a stab case. See manual_testi…
authored
17 namespace :gen do
18
d475804 @raggi Added some more helpers to the rakefile
authored
19 # TODO use git ls-tree or whatever to do this using repo knowledge.
20 self_installer_mtime = File.stat('lib/source_ports/self_installer.rb').mtime
21 install_rb_mtime = File.stat('install.rb').mtime
22 if self_installer_mtime > install_rb_mtime
23 warn "Looks like it's time to rebuild install.rb `rake gen:install`"
24 end
25
b972466 @raggi some more goodies, and ideas en route
authored
26 desc 'regenerate install.rb from self_installer.rb'
2f3049e @raggi Initial - limited specs, but working as a stab case. See manual_testi…
authored
27 task :install do
28 installer = File.read('lib/source_ports/self_installer.rb')
29 open('install.rb', 'r+') do |file|
30 line = file.readline until line =~ /# __MARK__/ rescue nil
31 file << installer
03bf850 @raggi Fix installer generation, forgot to truncate
authored
32 file.truncate(file.pos)
2f3049e @raggi Initial - limited specs, but working as a stab case. See manual_testi…
authored
33 end
34 end
35
36 end
37
38 task :spec do
39 sh 'spec/runner' # XXX win32
40 end
41
42 namespace :spec do
43
d475804 @raggi Added some more helpers to the rakefile
authored
44 end
45
46 namespace :git do
47 task :pull do
48 sh 'git pull'
49 end
50
51 task :push do
52 sh 'git push'
53 end
54
55 namespace :merge do
56 task :stable do
57 sh 'git push origin HEAD:refs/heads/stable'
58 end
59 end
22d3621 @raggi Added some support for rdocs, might help a few folks
authored
60 end
61
62 Rake::RDocTask.new do |rd|
63 rd.title = 'source_ports'
64 rd.rdoc_dir = 'rdoc'
65 rd.main = "README.rdoc"
66 rd.rdoc_files.include(rd.main, "lib/**/*.rb", 'install.rb')
67 end
68 task :clobber => :clobber_rdoc
69
70 desc 'Generate and open documentation'
71 task :docs => :rdoc do
72 case RUBY_PLATFORM
73 when /darwin/ ; sh 'open rdoc/index.html'
74 when /mswin|mingw/ ; sh 'start rdoc\index.html'
75 else
76 sh 'firefox rdoc/index.html'
77 end
2f3049e @raggi Initial - limited specs, but working as a stab case. See manual_testi…
authored
78 end
Something went wrong with that request. Please try again.