-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRakefile
52 lines (40 loc) · 1.35 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
# -*- mode:ruby; -*-
require 'fileutils'
require 'rake'
require 'socket'
require 'rspec/core/rake_task'
require 'socket'
HOME = File.expand_path(File.dirname(__FILE__))
LIBDIR = File.join(HOME, 'lib')
DOCDIR = File.join(HOME, 'docs')
FILES = FileList["#{LIBDIR}/**/*.rb"] # for yard, but where to put them?
def dev_host
case Socket.gethostname
when /romeo-foxtrot/i ; true
else ; false
end
end
RSpec::Core::RakeTask.new do |task|
task.rspec_opts = [ '--color', '--format', 'documentation' ]
## task.rcov = true if Socket.gethostname =~ /romeo-foxtrot/ # do coverage tests on my devlopment box
end
desc "Generate documentation from libraries with yard."
task :docs do
command = "yardoc --quiet --private --protected --title 'datyl: daitss utilities' --output-dir #{DOCDIR} #{FILES}"
yardoc = `which yardoc 2> /dev/null`
if yardoc.empty?
puts "yard not found, skipping the 'docs' task."
else
FileUtils.rm_rf FileList["#{DOCDIR}/**/*"]
puts "Creating docs with '#{command}'."
`#{command}`
end
end
desc "Make emacs tags files"
task :etags do
files = (FileList['lib/**/*', "tools/**/*", 'views/**/*', 'spec/**/*', 'bin/**/*']).exclude('spec/files', 'spec/reports') # run yard/hanna/rdoc on these and..
sh "xctags -e #{files}"
end
defaults = [:spec]
defaults.push :etags if dev_host
task :default => defaults