Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 86 lines (73 sloc) 2.482 kb
baeb175 Loren Segal Add YardocTask Rake task
authored
1 require File.dirname(__FILE__) + '/lib/yard'
f4075ea Loren Segal Add support for RubyGems 1.7.x
authored
2 require File.dirname(__FILE__) + '/lib/yard/rubygems/specification'
acfba72 Loren Segal Better rake support for windows
authored
3 require 'rbconfig'
96f0302 Added gemspec
loren authored
4
f27213b Loren Segal Add YARD_VERSION env to Rakefile. Allows installing as arbitrary gem ver...
authored
5 YARD::VERSION.replace(ENV['YARD_VERSION']) if ENV['YARD_VERSION']
acfba72 Loren Segal Better rake support for windows
authored
6 WINDOWS = (Config::CONFIG['host_os'] =~ /mingw|win32|cygwin/ ? true : false) rescue false
bb7abaa Loren Segal Add yard.gemspec and move Gem specific stuff out of Rakefile
authored
7 SUDO = WINDOWS ? '' : 'sudo'
8
1e4d5e9 Loren Segal Change default rake task to run specs
authored
9 task :default => :specs
96f0302 Added gemspec
loren authored
10
0f77917 Loren Segal Remove gem package Rake tasks and use simplified gem build functionality
authored
11 desc "Builds the gem"
12 task :gem do
f27213b Loren Segal Add YARD_VERSION env to Rakefile. Allows installing as arbitrary gem ver...
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 Loren Segal Remove gem package Rake tasks and use simplified gem build functionality
authored
17 desc "Installs the gem"
5824a94 Loren Segal Only build .gem for install
authored
18 task :install => :gem do
0f77917 Loren Segal 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 Loren Segal Consolidate gemspec into Rakefile and add specs task
authored
20 end
21
08977a2 Loren Segal Add 'rake suite' task to run specs across all(?) supported ruby versions...
authored
22 desc 'Run spec suite'
23 task :suite do
24 ['ruby186', 'ruby18', 'ruby19', 'ruby192', 'jruby'].each do |ruby|
25 2.times do |legacy|
7796941 Loren Segal Run ruby18 through test suite with ripper
authored
26 next if legacy == 1 && ruby =~ /^jruby|186/
08977a2 Loren Segal Add 'rake suite' task to run specs across all(?) supported ruby versions...
authored
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 Loren Segal Allow rake to function without RSpec
authored
35 begin
3cafb47 Loren Segal Make rakefile backwards compatible for rspec 1.x users
authored
36 hide = '_spec\.rb$,spec_helper\.rb$,ruby_lex\.rb$,autoload\.rb$'
bdd8a8f Loren Segal Update specs to allow toggling on and off of LEGACY environment variable...
authored
37 if YARD::Parser::SourceParser.parser_type == :ruby
38 hide += ',legacy\/.+_handler'
1ee355e Loren Segal Backport new-style parser to 1.8 compatible syntax (and semantics) for r...
authored
39 else
bdd8a8f Loren Segal Update specs to allow toggling on and off of LEGACY environment variable...
authored
40 hide += ',ruby_parser\.rb$,ast_node\.rb$,handlers\/ruby\/[^\/]+\.rb$'
1ee355e Loren Segal Backport new-style parser to 1.8 compatible syntax (and semantics) for r...
authored
41 end
3cafb47 Loren Segal 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 Loren Segal 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 Loren Segal Allow rake to function without RSpec
authored
48 $DEBUG = true if ENV['DEBUG']
08977a2 Loren Segal Add 'rake suite' task to run specs across all(?) supported ruby versions...
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 Loren Segal Add 'rake suite' task to run specs across all(?) supported ruby versions...
authored
51 t.rspec_opts += ['-I', YARD::ROOT]
b2ee971 Gioele Minimal update to RSpec 2
gioele authored
52 t.pattern = "spec/**/*_spec.rb"
08977a2 Loren Segal Add 'rake suite' task to run specs across all(?) supported ruby versions...
authored
53 t.verbose = $DEBUG ? true : false
0d541b7 Loren Segal Ignore files from RCov stats
authored
54
1c189a0 Loren Segal Allow rake to function without RSpec
authored
55 if ENV['RCOV']
56 t.rcov = true
57 t.rcov_opts = ['-x', hide]
58 end
0d541b7 Loren Segal Ignore files from RCov stats
authored
59 end
1c189a0 Loren Segal Allow rake to function without RSpec
authored
60 task :spec => :specs
61 rescue LoadError
3cafb47 Loren Segal 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 Loren Segal Add YardocTask Rake task
authored
81 end
82
c351a2c Loren Segal Add support for --files switch to specify extra static files to include ...
authored
83 YARD::Rake::YardocTask.new do |t|
0e14ccb Loren Segal Move some options to yardopts
authored
84 t.options += ['--title', "YARD #{YARD::VERSION} Documentation"]
5b8d227 Natalie Weizenbaum Add spec as an alias for the specs Rake task.
nex3 authored
85 end
Something went wrong with that request. Please try again.