-
Notifications
You must be signed in to change notification settings - Fork 18
/
Rakefile
48 lines (40 loc) · 1.17 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
#!/usr/bin/env ruby
$:.unshift(File.expand_path(File.join(File.dirname(__FILE__), 'lib')))
require 'quantity'
require "rubygems"
require "bundler"
Bundler::GemHelper.install_tasks
begin
Bundler.setup(:default, :development)
rescue Bundler::BundlerError => e
$stderr.puts e.message
$stderr.puts "Run `bundle install` to install missing gems"
exit e.status_code
end
require 'spec'
require 'spec/rake/spectask'
require 'yard'
desc "Run specs"
Spec::Rake::SpecTask.new('spec') do |t|
t.spec_files = FileList['spec/quantity.spec']
t.spec_opts = ["-cfn"]
end
desc "Run unit specs"
Spec::Rake::SpecTask.new('unit') do |t|
t.spec_files = FileList['spec/dimension.spec', 'spec/unit.spec', 'spec/systems.spec']
t.spec_opts = ["-cfn"]
end
desc "specs with backtrace"
Spec::Rake::SpecTask.new('tracespec') do |t|
t.spec_files = FileList['spec/quantity.spec']
t.spec_opts = ["-bcfn"]
end
desc "unit specs with backtrace"
Spec::Rake::SpecTask.new('traceunit') do |t|
t.spec_files = FileList['spec/dimension.spec', 'spec/unit.spec', 'spec/systems.spec']
t.spec_opts = ["-bcfn"]
end
desc "package yardocs"
YARD::Rake::YardocTask.new('yard') do |t|
# see .yardopts for the action
end