forked from karmi/retire
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Rakefile
74 lines (61 loc) · 2.29 KB
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
require 'bundler'
Bundler::GemHelper.install_tasks
task :default => :test
require 'rake/testtask'
Rake::TestTask.new(:test) do |test|
test.libs << 'lib' << 'test'
test.test_files = FileList['test/unit/*_test.rb', 'test/integration/*_test.rb']
test.verbose = true
# test.warning = true
end
namespace :test do
Rake::TestTask.new(:unit) do |test|
test.libs << 'lib' << 'test'
file_strings = []
# If there is a second argument, then assume it is a test file string, otherwise run all unit tests
if ARGV.length > 1
file_strings.concat(ARGV.slice(1, ARGV.length))
else
file_strings << "test/unit/*_test.rb"
end
test.test_files = FileList.new( file_strings.join(', ') )
test.verbose = true
test.warning = false # Disable all warnings, we don't care since this library is so out of date...
end
Rake::TestTask.new(:integration) do |test|
test.libs << 'lib' << 'test'
file_strings = []
# If there is a second argument, then assume it is a test file string, otherwise run all unit tests
if ARGV.length > 1
file_strings.concat(ARGV.slice(1, ARGV.length))
else
file_strings << "test/integration/*_test.rb"
end
test.test_files = FileList.new( file_strings.join(', ') )
test.verbose = false
test.warning = false # Disable all warnings, we don't care since this library is so out of date...
end
end
namespace :web do
desc "Update the Github website"
task :update => :generate do
current_branch = `git branch --no-color`.
split("\n").
select { |line| line =~ /^\* / }.
first.to_s.
gsub(/\* (.*)/, '\1')
(puts "Unable to determine current branch"; exit(1) ) unless current_branch
system "git checkout web"
system "cp examples/tire-dsl.html index.html"
system "git add index.html && git co -m 'Updated Tire website'"
system "git push origin web:gh-pages -f"
system "git checkout #{current_branch}"
end
desc "Generate the Rocco documentation page"
task :generate do
system "rocco examples/tire-dsl.rb"
html = File.read('examples/tire-dsl.html').gsub!(/>tire\-dsl\.rb</, '>tire.rb<')
File.open('examples/tire-dsl.html', 'w') { |f| f.write html }
system "open examples/tire-dsl.html"
end
end