Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 86 lines (73 sloc) 2.487 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
14caea5 @lsegal Fix loading of YARD rubygems plugin in new location, and load gem plu…
authored
12 Gem.load_plugins # load plugins because they are not autoloaded anymore
f27213b @lsegal Add YARD_VERSION env to Rakefile. Allows installing as arbitrary gem …
authored
13 load 'yard.gemspec'
14 Gem::Builder.new(SPEC).build
22cdc42 Add better exception handling, add 'rake install' task
loren authored
15 end
16
0f77917 @lsegal Remove gem package Rake tasks and use simplified gem build functionality
authored
17 desc "Installs the gem"
5824a94 @lsegal Only build .gem for install
authored
18 task :install => :gem do
0f77917 @lsegal Remove gem package Rake tasks and use simplified gem build functionality
authored
19 sh "#{SUDO} gem install yard-#{YARD::VERSION}.gem --no-rdoc --no-ri"
e54b06f @lsegal Consolidate gemspec into Rakefile and add specs task
authored
20 end
21
08977a2 @lsegal Add 'rake suite' task to run specs across all(?) supported ruby versi…
authored
22 desc 'Run spec suite'
23 task :suite do
24 ['ruby186', 'ruby18', 'ruby19', 'ruby192', 'jruby'].each do |ruby|
25 2.times do |legacy|
26 next if legacy == 1 && ruby =~ /^jruby|18/
27 puts "Running specs with #{ruby}#{legacy == 1 ? ' (in legacy mode)' : ''}"
28 cmd = "#{ruby} -S rake specs SUITE=1 #{legacy == 1 ? 'LEGACY=1' : ''}"
29 puts cmd
30 system(cmd)
31 end
32 end
33 end
34
1c189a0 @lsegal Allow rake to function without RSpec
authored
35 begin
3cafb47 @lsegal Make rakefile backwards compatible for rspec 1.x users
authored
36 hide = '_spec\.rb$,spec_helper\.rb$,ruby_lex\.rb$,autoload\.rb$'
bdd8a8f @lsegal Update specs to allow toggling on and off of LEGACY environment varia…
authored
37 if YARD::Parser::SourceParser.parser_type == :ruby
38 hide += ',legacy\/.+_handler'
1ee355e @lsegal Backport new-style parser to 1.8 compatible syntax (and semantics) fo…
authored
39 else
bdd8a8f @lsegal Update specs to allow toggling on and off of LEGACY environment varia…
authored
40 hide += ',ruby_parser\.rb$,ast_node\.rb$,handlers\/ruby\/[^\/]+\.rb$'
1ee355e @lsegal Backport new-style parser to 1.8 compatible syntax (and semantics) fo…
authored
41 end
3cafb47 @lsegal Make rakefile backwards compatible for rspec 1.x users
authored
42
b2ee971 @gioele Minimal update to RSpec 2
gioele authored
43 require 'rspec'
44 require 'rspec/core/rake_task'
1c189a0 @lsegal Allow rake to function without RSpec
authored
45
46 desc "Run all specs"
b2ee971 @gioele Minimal update to RSpec 2
gioele authored
47 RSpec::Core::RakeTask.new("specs") do |t|
1c189a0 @lsegal Allow rake to function without RSpec
authored
48 $DEBUG = true if ENV['DEBUG']
08977a2 @lsegal Add 'rake suite' task to run specs across all(?) supported ruby versi…
authored
49 t.rspec_opts = ENV['SUITE'] ? ['--format', 'progress'] : ["--colour", "--format", "documentation"]
b2ee971 @gioele Minimal update to RSpec 2
gioele authored
50 t.rspec_opts += ["--require", File.join(File.dirname(__FILE__), 'spec', 'spec_helper')]
08977a2 @lsegal Add 'rake suite' task to run specs across all(?) supported ruby versi…
authored
51 t.rspec_opts += ['-I', YARD::ROOT]
b2ee971 @gioele Minimal update to RSpec 2
gioele authored
52 t.pattern = "spec/**/*_spec.rb"
08977a2 @lsegal Add 'rake suite' task to run specs across all(?) supported ruby versi…
authored
53 t.verbose = $DEBUG ? true : false
0d541b7 @lsegal Ignore files from RCov stats
authored
54
1c189a0 @lsegal Allow rake to function without RSpec
authored
55 if ENV['RCOV']
56 t.rcov = true
57 t.rcov_opts = ['-x', hide]
58 end
0d541b7 @lsegal Ignore files from RCov stats
authored
59 end
1c189a0 @lsegal Allow rake to function without RSpec
authored
60 task :spec => :specs
61 rescue LoadError
3cafb47 @lsegal Make rakefile backwards compatible for rspec 1.x users
authored
62 begin # Try for rspec 1.x
63 require 'spec'
64 require 'spec/rake/spectask'
65
66 Spec::Rake::SpecTask.new("specs") do |t|
67 $DEBUG = true if ENV['DEBUG']
68 t.spec_opts = ["--format", "specdoc", "--colour"]
69 t.spec_opts += ["--require", File.join(File.dirname(__FILE__), 'spec', 'spec_helper')]
70 t.pattern = "spec/**/*_spec.rb"
71
72 if ENV['RCOV']
73 t.rcov = true
74 t.rcov_opts = ['-x', hide]
75 end
76 end
77 task :spec => :specs
78 rescue LoadError
79 warn "warn: RSpec tests not available. `gem install rspec` to enable them."
80 end
baeb175 @lsegal Add YardocTask Rake task
authored
81 end
82
c351a2c @lsegal Add support for --files switch to specify extra static files to inclu…
authored
83 YARD::Rake::YardocTask.new do |t|
0e14ccb @lsegal Move some options to yardopts
authored
84 t.options += ['--title', "YARD #{YARD::VERSION} Documentation"]
5b8d227 @nex3 Add spec as an alias for the specs Rake task.
nex3 authored
85 end
Something went wrong with that request. Please try again.