-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathRakefile
44 lines (37 loc) · 1.44 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
#!/usr/bin/env ruby
lib = File.expand_path("../lib", __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require "oddb2xml/version"
require "bundler/gem_tasks"
require "standard/rake"
require "rspec/core/rake_task"
RSpec::Core::RakeTask.new(:spec)
# dependencies are now declared in oddb2xml.gemspec
desc "Offer a gem task like hoe"
task gem: :build do
Rake::Task[:build].invoke
end
task spec: :clean
desc "Run oddb2xml with all commonly used combinations"
task test: [:clean, :spec, :gem] do
log_file = "test_options.log"
puts "Running test_options.rb with Output redirected to #{log_file}. This will take some time (e.g. 20 minutes)"
# must use bash -o pipefail to catch error in test_options.rb and not tee
# see http://stackoverflow.com/questions/985876/tee-and-exit-status
res = system("bash -c 'set -o pipefail && ./test_options.rb 2>&1 | tee #{log_file}'")
puts "Running test_options.rb returned #{res.inspect}. Output was redirected to #{log_file}"
exit 1 unless res
end
require "rake/clean"
CLEAN.include FileList["pkg/*.gem"]
CLEAN.include FileList["*.zip*"]
CLEAN.include FileList["*.xls*"]
CLEAN.include FileList["*.xml*"]
CLEAN.include FileList["*.dat*"]
CLEAN.include FileList["*.tar.gz"]
CLEAN.include FileList["*.txt.*"]
CLEAN.include FileList["*.csv.*"]
CLEAN.include FileList["*.zip.*"]
CLEAN.include FileList["ruby*.tmp"]
CLEAN.include FileList["data/download"]
CLEAN.include FileList["duplicate_ean13_from_zur_rose.txt"]