forked from lsegal/yard
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
61 lines (53 loc) · 1.45 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
require File.dirname(__FILE__) + '/lib/yard'
require File.dirname(__FILE__) + '/lib/yard/rubygems/specification'
require 'rbconfig'
YARD::VERSION.replace(ENV['YARD_VERSION']) if ENV['YARD_VERSION']
task :default => :specs
desc "Builds the gem"
task :gem do
sh "gem build yard.gemspec"
end
desc "Installs the gem"
task :install => :gem do
sh "gem install yard-#{YARD::VERSION}.gem --no-rdoc --no-ri"
end
begin
require 'rvm-tester'
RVM::Tester::TesterTask.new do |t|
t.rubies = %w(1.8.6 ree jruby 1.8.7 1.9.2 1.9.3)
t.bundle_install = false # don't need to do this all the time
t.verbose = true
end
rescue LoadError
end
task :travis_ci do
ENV['SUITE'] = '1'
ENV['CI'] = '1'
ENV['LEGACY'] = nil
Rake::Task['specs'].execute
if RUBY_VERSION >= '1.9' && RUBY_PLATFORM != 'java'
puts ""
puts "Running specs with in legacy mode"
ENV['LEGACY'] = '1'
Rake::Task['specs'].execute
end
end
desc "Run all specs"
task :specs do
opts = ['rspec', '-c']
opts += ["--require", File.join(File.dirname(__FILE__), 'spec', 'spec_helper')]
opts += ['-I', YARD::ROOT]
if ENV['DEBUG']
$DEBUG = true
opts += ['-d']
end
opts += FileList["spec/**/*_spec.rb"].sort
cmd = opts.join(' ')
puts cmd if Rake.application.options.trace
system(cmd)
raise "Command failed with status (#{$?.to_i}): #{cmd}" if $?.to_i != 0
end
task :spec => :specs
YARD::Rake::YardocTask.new do |t|
t.options += ['--title', "YARD #{YARD::VERSION} Documentation"]
end