-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRakefile
81 lines (65 loc) · 1.98 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# Rakefile for rake -*- ruby -*-
# Copyright (C) 2013 by G. Allen Morris III ([email protected])
# This Rakefile is free software; G. Allen Morris III
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
require File.dirname(__FILE__) + '/lib/backerup/version.rb'
require 'rbconfig'
require 'rake/testtask'
require 'rdoc/task'
begin
require 'yard'
rescue LoadError => x
YARD = nil
end
#YARD::VERSION.replace(ENV['YARD_VERSION']) if ENV['YARD_VERSION']
#task :default => :specs
task :default => [ :check ]
desc "Builds the gem"
task :gem do
Gem::Builder.new(eval(File.read('backerup.gemspec'))).build
end
task :clean do
# nothing to clean
end
#task :doc do |t|
# `test -x $YARDOC && $YARDOC --plugin minitest-spec lib/ spec/`
#end
#task :docs => :doc
desc "Installs the gem"
task :install => :gem do
sh "gem install backerup-#{BackerUp::VERSION}.gem --no-rdoc --no-ri"
end
desc "Run all tests and specs"
Rake::TestTask.new(:check) do |t|
t.libs << "test"
t.libs << "spec"
t.test_files = FileList['test/*_test.rb', 'spec/*_spec.rb']
# t.verbose = true
end
desc "Run all tests"
Rake::TestTask.new(:test) do |t|
t.libs << "test"
t.test_files = FileList['test/*_test.rb']
# t.verbose = true
end
task :tests => :test
desc "Run all specs"
Rake::TestTask.new(:specs) do |t|
t.verbose = true
t.libs << "spec"
t.test_files = FileList[ 'spec/*_spec.rb' ]
end
task :spec => :specs
YARD::Rake::YardocTask.new do |t|
t.files = ['lib/**/*.rb', 'bin/*', 'spec/*_spec.rb' ] # optional
t.options = [ '--plugin', 'minitest-spec' ] # optional
end if YARD
Rake::RDocTask.new do |rd|
rd.main = "README.rdoc"
rd.rdoc_files.include("README.rdoc", "lib/**/*.rb")
end