-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRakefile
More file actions
60 lines (50 loc) · 1.51 KB
/
Rakefile
File metadata and controls
60 lines (50 loc) · 1.51 KB
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
# (C) Copyright Greg Whiteley 2009-2012
#
# This is free software: you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as
# published by the Free Software Foundation, either version 3 of
# the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this program. If not, see <http://www.gnu.org/licenses/>.
require 'rubygems'
require 'bundler/gem_tasks'
require 'rspec/core/rake_task'
require 'rake/testtask'
require 'pp'
HAVE_OCRA = begin
gem 'ocra'
true
rescue Gem::LoadError
false
end
task :default => [:test]
if HAVE_OCRA
desc "Build vstool.exe with ocra"
task :ocra => 'vstool.exe'
file "vstool.exe" do |t|
ruby_lib_orig = ruby_lib = ENV['RUBYLIB']
if ruby_lib
ruby_lib = 'lib;#{ruby_lib}'
else
ruby_lib = 'lib'
end
ENV['RUBYLIB']=ruby_lib
sh 'ocra', 'bin/vstool'
ENV['RUBYLIB']=ruby_lib_orig
end
end
Rake::TestTask.new do |t|
t.test_files = FileList['test/tc_*rb']
#pp t.methods
end
RSpec::Core::RakeTask.new do |t|
t.pattern = 'spec/*_spec.rb'
t.ruby_opts = ['-w']
# t.rspec_opts = ['-r', 'offline_only']
end