Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 100 lines (86 sloc) 2.79 kb
baeb175 @lsegal Add YardocTask Rake task
authored
1 require File.dirname(__FILE__) + '/lib/yard'
f4075ea @lsegal Add support for RubyGems 1.7.x
authored
2 require File.dirname(__FILE__) + '/lib/yard/rubygems/specification'
acfba72 @lsegal Better rake support for windows
authored
3 require 'rbconfig'
96f0302 Added gemspec
loren authored
4
f27213b @lsegal Add YARD_VERSION env to Rakefile. Allows installing as arbitrary gem …
authored
5 YARD::VERSION.replace(ENV['YARD_VERSION']) if ENV['YARD_VERSION']
636b6ef @lsegal Remove depcrecated Config in favour of RbConfig
authored
6 WINDOWS = (RbConfig::CONFIG['host_os'] =~ /mingw|win32|cygwin/ ? true : false) rescue false
bb7abaa @lsegal Add yard.gemspec and move Gem specific stuff out of Rakefile
authored
7 SUDO = WINDOWS ? '' : 'sudo'
8
1e4d5e9 @lsegal Change default rake task to run specs
authored
9 task :default => :specs
96f0302 Added gemspec
loren authored
10
0f77917 @lsegal Remove gem package Rake tasks and use simplified gem build functionality
authored
11 desc "Builds the gem"
12 task :gem do
7e550af @lsegal gemspec date can be set with Ruby!
authored
13 Gem::Builder.new(eval(File.read('yard.gemspec'))).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
08977a2 @lsegal Add 'rake suite' task to run specs across all(?) supported ruby versi…
authored
21 desc 'Run spec suite'
22 task :suite do
ba3f615 @lsegal Add ruby193 to suite
authored
23 ['ruby186', 'ruby18', 'ruby19', 'ruby192', 'ruby193', 'jruby'].each do |ruby|
08977a2 @lsegal Add 'rake suite' task to run specs across all(?) supported ruby versi…
authored
24 2.times do |legacy|
7796941 @lsegal Run ruby18 through test suite with ripper
authored
25 next if legacy == 1 && ruby =~ /^jruby|186/
08977a2 @lsegal Add 'rake suite' task to run specs across all(?) supported ruby versi…
authored
26 puts "Running specs with #{ruby}#{legacy == 1 ? ' (in legacy mode)' : ''}"
27 cmd = "#{ruby} -S rake specs SUITE=1 #{legacy == 1 ? 'LEGACY=1' : ''}"
28 puts cmd
29 system(cmd)
30 end
31 end
32 end
33
046d47b @lsegal Add support for travis-ci.org
authored
34 task :travis_ci do
afd1179 @lsegal Fix travis_ci task status exiting and legacy mode
authored
35 status = 0
046d47b @lsegal Add support for travis-ci.org
authored
36 ENV['SUITE'] = '1'
37 ENV['CI'] = '1'
38 system "bundle exec rake specs"
afd1179 @lsegal Fix travis_ci task status exiting and legacy mode
authored
39 status = 1 if $?.to_i != 0
40 if RUBY_VERSION >= '1.9' && RUBY_PLATFORM != 'java'
046d47b @lsegal Add support for travis-ci.org
authored
41 puts ""
42 puts "Running specs with in legacy mode"
43 system "bundle exec rake specs LEGACY=1"
afd1179 @lsegal Fix travis_ci task status exiting and legacy mode
authored
44 status = 1 if $?.to_i != 0
046d47b @lsegal Add support for travis-ci.org
authored
45 end
afd1179 @lsegal Fix travis_ci task status exiting and legacy mode
authored
46 exit(status)
046d47b @lsegal Add support for travis-ci.org
authored
47 end
48
1c189a0 @lsegal Allow rake to function without RSpec
authored
49 begin
3cafb47 @lsegal Make rakefile backwards compatible for rspec 1.x users
authored
50 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
51 if YARD::Parser::SourceParser.parser_type == :ruby
52 hide += ',legacy\/.+_handler'
1ee355e @lsegal Backport new-style parser to 1.8 compatible syntax (and semantics) fo…
authored
53 else
bdd8a8f @lsegal Update specs to allow toggling on and off of LEGACY environment varia…
authored
54 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
55 end
3cafb47 @lsegal Make rakefile backwards compatible for rspec 1.x users
authored
56
b2ee971 @gioele Minimal update to RSpec 2
gioele authored
57 require 'rspec'
58 require 'rspec/core/rake_task'
1c189a0 @lsegal Allow rake to function without RSpec
authored
59
60 desc "Run all specs"
b2ee971 @gioele Minimal update to RSpec 2
gioele authored
61 RSpec::Core::RakeTask.new("specs") do |t|
1c189a0 @lsegal Allow rake to function without RSpec
authored
62 $DEBUG = true if ENV['DEBUG']
6fdb8fc @lsegal Use default progress output for rspec results instead of specdoc
authored
63 t.rspec_opts = ENV['SUITE'] ? [] : ['-c']
b2ee971 @gioele Minimal update to RSpec 2
gioele authored
64 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
65 t.rspec_opts += ['-I', YARD::ROOT]
b2ee971 @gioele Minimal update to RSpec 2
gioele authored
66 t.pattern = "spec/**/*_spec.rb"
08977a2 @lsegal Add 'rake suite' task to run specs across all(?) supported ruby versi…
authored
67 t.verbose = $DEBUG ? true : false
0d541b7 @lsegal Ignore files from RCov stats
authored
68
1c189a0 @lsegal Allow rake to function without RSpec
authored
69 if ENV['RCOV']
70 t.rcov = true
71 t.rcov_opts = ['-x', hide]
72 end
0d541b7 @lsegal Ignore files from RCov stats
authored
73 end
1c189a0 @lsegal Allow rake to function without RSpec
authored
74 task :spec => :specs
75 rescue LoadError
3cafb47 @lsegal Make rakefile backwards compatible for rspec 1.x users
authored
76 begin # Try for rspec 1.x
77 require 'spec'
78 require 'spec/rake/spectask'
79
80 Spec::Rake::SpecTask.new("specs") do |t|
81 $DEBUG = true if ENV['DEBUG']
82 t.spec_opts = ["--format", "specdoc", "--colour"]
83 t.spec_opts += ["--require", File.join(File.dirname(__FILE__), 'spec', 'spec_helper')]
84 t.pattern = "spec/**/*_spec.rb"
85
86 if ENV['RCOV']
87 t.rcov = true
88 t.rcov_opts = ['-x', hide]
89 end
90 end
91 task :spec => :specs
92 rescue LoadError
93 warn "warn: RSpec tests not available. `gem install rspec` to enable them."
94 end
baeb175 @lsegal Add YardocTask Rake task
authored
95 end
96
c351a2c @lsegal Add support for --files switch to specify extra static files to inclu…
authored
97 YARD::Rake::YardocTask.new do |t|
0e14ccb @lsegal Move some options to yardopts
authored
98 t.options += ['--title', "YARD #{YARD::VERSION} Documentation"]
5b8d227 @nex3 Add spec as an alias for the specs Rake task.
nex3 authored
99 end
Something went wrong with that request. Please try again.