-
-
Notifications
You must be signed in to change notification settings - Fork 73
/
Rakefile
54 lines (41 loc) · 1.14 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
# -*- ruby -*-
$LOAD_PATH << 'lib'
require 'rubygems'
require 'hoe'
Hoe.add_include_dirs("../../minitest/dev/lib")
Hoe.plugin :seattlerb
Hoe.spec "ZenTest" do
developer 'Ryan Davis', '[email protected]'
developer 'Eric Hodel', '[email protected]'
license "MIT"
end
desc "run autotest on itself"
task :autotest do
ruby "-Ilib -w ./bin/autotest"
end
desc "update example_dot_autotest.rb with all possible constants"
task :update do
system "p4 edit example_dot_autotest.rb"
File.open "example_dot_autotest.rb", "w" do |f|
f.puts "# -*- ruby -*-"
f.puts
Dir.chdir "lib" do
Dir["autotest/*.rb"].sort.each do |s|
next if s =~ /rails|discover/
f.puts "# require '#{s[0..-4]}'"
end
end
f.puts
Dir["lib/autotest/*.rb"].sort.each do |file|
file = File.read(file)
m = file[/module.*/].split(/ /).last rescue nil
next unless m
file.grep(/def[^(]+=/).each do |setter|
setter = setter.sub(/^ *def self\./, '').sub(/\s*=\s*/, ' = ')
f.puts "# #{m}.#{setter}"
end
end
end
system "p4 diff -du example_dot_autotest.rb"
end
# vim:syntax=ruby