/
Rakefile
170 lines (141 loc) · 4.31 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
#!/usr/bin/env rake
# -*- Ruby -*-
require 'rubygems'
require 'rake/gempackagetask'
require 'rake/rdoctask'
require 'rake/testtask'
rake_dir = File.dirname(__FILE__)
require 'rbconfig'
RUBY_PATH = File.join(RbConfig::CONFIG['bindir'],
RbConfig::CONFIG['RUBY_INSTALL_NAME'])
def run_standalone_ruby_file(directory)
puts ('*' * 10) + ' ' + directory + ' ' + ('*' * 10)
Dir.chdir(directory) do
Dir.glob('*.rb').each do |ruby_file|
puts ('-' * 20) + ' ' + ruby_file + ' ' + ('-' * 20)
system(RUBY_PATH, ruby_file)
end
end
end
desc 'Create a GNU-style ChangeLog via git2cl'
task :ChangeLog do
system('git log --pretty --numstat --summary | git2cl > ChangeLog')
end
desc 'Test units - the smaller tests'
task :'test:unit' do |t|
Rake::TestTask.new(:'test:unit') do |t|
t.test_files = FileList['test/unit/**/test-*.rb']
# t.pattern = 'test/**/*test-*.rb' # instead of above
t.verbose = true
end
end
desc 'Test functional - the medium-sized tests'
task :'test:functional' do |t|
Rake::TestTask.new(:'test:functional') do |t|
t.test_files = FileList['test/functional/**/test-*.rb']
t.verbose = true
end
end
desc 'Test integration - end-to-end blackbox tests'
task :'test:integration' do |t|
Rake::TestTask.new(:'test:integration') do |t|
t.test_files = FileList['test/integration/**/test-*.rb']
t.verbose = true
end
end
desc 'Test everything - unit tests for now.'
task :test do
exceptions = %w(test:unit test:functional test:integration).collect do |task|
begin
Rake::Task[task].invoke
nil
rescue => e
e
end
end.compact
exceptions.each {|e| puts e;puts e.backtrace }
raise "Test failures" unless exceptions.empty?
end
desc "Run each library Ruby file in standalone mode."
task :'check:app' do
run_standalone_ruby_file(File.join(%W(#{rake_dir} app)))
end
desc "Run each command in standalone mode."
task :'check:commands' do
run_standalone_ruby_file(File.join(%W(#{rake_dir} processor command)))
end
desc "Run each processor Ruby file in standalone mode."
task :'check:processor' do
run_standalone_ruby_file(File.join(%W(#{rake_dir} processor)))
end
desc "Run each processor Ruby file in standalone mode."
task :'check:unit' do
run_standalone_ruby_file(File.join(%W(#{rake_dir} test unit)))
end
task :'check:functional' do
run_standalone_ruby_file(File.join(%W(#{rake_dir} test functional)))
end
task :'check:integration' do
run_standalone_ruby_file(File.join(%W(#{rake_dir} test integration)))
end
task :check => %w(check:lib check:processor check:commands).map{|c| c.to_sym}
desc "Test everything - same as test."
task :default => :test
FILES = FileList[
'README.textile',
'LICENSE',
'NEWS',
'ChangeLog',
'Rakefile',
'app/*',
'bin/*',
'data/*',
'interface/*',
'io/*',
'lib/*',
'processor/**/*.rb',
'test/**/*.rb',
]
spec = Gem::Specification.new do |spec|
spec.name = 'rbdbgr'
spec.homepage = 'http://wiki.github.com/rocky/rbdbgr'
spec.summary = 'Modular Ruby 1.9.2 Debugger'
spec.description = "A modular, testable, Ruby debugger using some of the best ideas from ruby-debug, other debuggers, and Ruby Rails.
Some of the core debugger concepts have been rethought. As a result, some of this may be experimental.
This version works only with a patched version of Ruby 1.9.2 and rb-threadframe.
"
spec.version = '0.0.1'
spec.author = "R. Bernstein"
spec.email = "rockyb@rubyforge.org"
spec.platform = Gem::Platform::RUBY
spec.bindir = "bin"
spec.executables = ["rbdbgr"]
spec.files = FILES.to_a
spec.date = Time.now
spec.add_dependency('rb-threadframe', '>= 0.32')
spec.add_dependency('rb-trace', '>= 0.2')
spec.add_dependency('linecache-tf')
spec.add_dependency('columnize')
spec.has_rdoc = true
spec.extra_rdoc_files = ['README.textile']
end
# Rake task to build the default package
Rake::GemPackageTask.new(spec) do |pkg|
pkg.need_tar = true
end
def install(spec, *opts)
args = ['gem', 'install', "pkg/#{spec.name}-#{spec.version}.gem"] + opts
system(*args)
end
desc 'Install locally'
task :install => :package do
Dir.chdir(File::dirname(__FILE__)) do
# ri and rdoc take lots of time
install(spec, '--no-ri', '--no-rdoc')
end
end
task :install_full => :package do
Dir.chdir(File::dirname(__FILE__)) do
install(spec)
end
end