-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRakefile
More file actions
35 lines (29 loc) · 696 Bytes
/
Copy pathRakefile
File metadata and controls
35 lines (29 loc) · 696 Bytes
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
require 'bundler/gem_tasks'
namespace :log do
desc 'Truncates all *.log files in log/ to zero bytes (specify which logs with LOGS=test,development)'
task :clear do
log_files.each do |file|
clear_log_file(file)
end
end
def log_files
if ENV['LOGS']
ENV['LOGS'].split(',')
.map { |file| "log/#{file.strip}.log" }
.select { |file| File.exist?(file) }
else
FileList['log/*.log']
end
end
def clear_log_file(file)
f = File.open(file, 'w')
f.close
end
end
require 'rake/testtask'
Rake::TestTask.new(:test) do |t|
t.libs << 'lib' << 'test'
t.pattern = 'test/**/test_*.rb'
t.verbose = true
end
task default: 'test'