Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 48 lines (39 sloc) 1.434 kB
baeb175 @lsegal Add YardocTask Rake task
authored
1 require File.dirname(__FILE__) + '/lib/yard'
acfba72 @lsegal Better rake support for windows
authored
2 require 'rbconfig'
96f0302 Added gemspec
loren authored
3
f27213b @lsegal Add YARD_VERSION env to Rakefile. Allows installing as arbitrary gem …
authored
4 YARD::VERSION.replace(ENV['YARD_VERSION']) if ENV['YARD_VERSION']
acfba72 @lsegal Better rake support for windows
authored
5 WINDOWS = (Config::CONFIG['host_os'] =~ /mingw|win32|cygwin/ ? true : false) rescue false
bb7abaa @lsegal Add yard.gemspec and move Gem specific stuff out of Rakefile
authored
6 SUDO = WINDOWS ? '' : 'sudo'
7
1e4d5e9 @lsegal Change default rake task to run specs
authored
8 task :default => :specs
96f0302 Added gemspec
loren authored
9
0f77917 @lsegal Remove gem package Rake tasks and use simplified gem build functionality
authored
10 desc "Builds the gem"
11 task :gem do
f27213b @lsegal Add YARD_VERSION env to Rakefile. Allows installing as arbitrary gem …
authored
12 load 'yard.gemspec'
13 Gem::Builder.new(SPEC).build
22cdc42 Add better exception handling, add 'rake install' task
loren authored
14 end
15
0f77917 @lsegal Remove gem package Rake tasks and use simplified gem build functionality
authored
16 desc "Installs the gem"
5824a94 @lsegal Only build .gem for install
authored
17 task :install => :gem do
0f77917 @lsegal Remove gem package Rake tasks and use simplified gem build functionality
authored
18 sh "#{SUDO} gem install yard-#{YARD::VERSION}.gem --no-rdoc --no-ri"
e54b06f @lsegal Consolidate gemspec into Rakefile and add specs task
authored
19 end
20
1c189a0 @lsegal Allow rake to function without RSpec
authored
21 begin
22 require 'spec'
23 require 'spec/rake/spectask'
24
25 desc "Run all specs"
26 Spec::Rake::SpecTask.new("specs") do |t|
27 $DEBUG = true if ENV['DEBUG']
28 t.spec_opts = ["--format", "specdoc", "--colour"]
29 t.spec_opts += ["--require", File.join(File.dirname(__FILE__), 'spec', 'spec_helper')]
30 t.spec_files = Dir["spec/**/*_spec.rb"].sort
0d541b7 @lsegal Ignore files from RCov stats
authored
31
1c189a0 @lsegal Allow rake to function without RSpec
authored
32 if ENV['RCOV']
33 hide = '_spec\.rb$,spec_helper\.rb$,ruby_lex\.rb$,autoload\.rb$'
34 hide += ',legacy\/.+_handler,html_syntax_highlight_helper18\.rb$' if RUBY19
35 hide += ',ruby_parser\.rb$,ast_node\.rb$,handlers\/ruby\/[^\/]+\.rb$,html_syntax_highlight_helper\.rb$' if RUBY18
36 t.rcov = true
37 t.rcov_opts = ['-x', hide]
38 end
0d541b7 @lsegal Ignore files from RCov stats
authored
39 end
1c189a0 @lsegal Allow rake to function without RSpec
authored
40 task :spec => :specs
41 rescue LoadError
42 warn "warn: RSpec tests not available. `gem install rspec` to enable them."
baeb175 @lsegal Add YardocTask Rake task
authored
43 end
44
c351a2c @lsegal Add support for --files switch to specify extra static files to inclu…
authored
45 YARD::Rake::YardocTask.new do |t|
0e14ccb @lsegal Move some options to yardopts
authored
46 t.options += ['--title', "YARD #{YARD::VERSION} Documentation"]
5b8d227 @nex3 Add spec as an alias for the specs Rake task.
nex3 authored
47 end
Something went wrong with that request. Please try again.