Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 94 lines (80 sloc) 2.422 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 ver...
authored
5 YARD::VERSION.replace(ENV['YARD_VERSION']) if ENV['YARD_VERSION']
bb7abaa @lsegal Add yard.gemspec and move Gem specific stuff out of Rakefile
authored
6
1e4d5e9 @lsegal Change default rake task to run specs
authored
7 task :default => :specs
96f0302 Added gemspec
loren authored
8
0f77917 @lsegal Remove gem package Rake tasks and use simplified gem build functionality
authored
9 desc "Builds the gem"
10 task :gem do
7e550af @lsegal gemspec date can be set with Ruby!
authored
11 Gem::Builder.new(eval(File.read('yard.gemspec'))).build
22cdc42 Add better exception handling, add 'rake install' task
loren authored
12 end
13
0f77917 @lsegal Remove gem package Rake tasks and use simplified gem build functionality
authored
14 desc "Installs the gem"
fa147d9 @lsegal The great whitespace fix of 2012
authored
15 task :install => :gem do
6b63789 @lsegal Remove sudo from install task
authored
16 sh "gem install yard-#{YARD::VERSION}.gem --no-rdoc --no-ri"
e54b06f @lsegal Consolidate gemspec into Rakefile and add specs task
authored
17 end
18
649b068 @lsegal Use rvm-tester for suite task
authored
19 begin
20 require 'rvm-tester'
21 RVM::Tester::TesterTask.new do |t|
59436d0 @lsegal Remove manual loading of .travis.yml in suite task, rvm-tester does this...
authored
22 t.bundle_install = false # don't need to do this all the time
649b068 @lsegal Use rvm-tester for suite task
authored
23 t.verbose = true
24 end
25 rescue LoadError
08977a2 @lsegal Add 'rake suite' task to run specs across all(?) supported ruby versions...
authored
26 end
27
046d47b @lsegal Add support for travis-ci.org
authored
28 task :travis_ci do
afd1179 @lsegal Fix travis_ci task status exiting and legacy mode
authored
29 status = 0
046d47b @lsegal Add support for travis-ci.org
authored
30 ENV['SUITE'] = '1'
31 ENV['CI'] = '1'
32 system "bundle exec rake specs"
afd1179 @lsegal Fix travis_ci task status exiting and legacy mode
authored
33 status = 1 if $?.to_i != 0
34 if RUBY_VERSION >= '1.9' && RUBY_PLATFORM != 'java'
046d47b @lsegal Add support for travis-ci.org
authored
35 puts ""
36 puts "Running specs with in legacy mode"
37 system "bundle exec rake specs LEGACY=1"
afd1179 @lsegal Fix travis_ci task status exiting and legacy mode
authored
38 status = 1 if $?.to_i != 0
046d47b @lsegal Add support for travis-ci.org
authored
39 end
afd1179 @lsegal Fix travis_ci task status exiting and legacy mode
authored
40 exit(status)
046d47b @lsegal Add support for travis-ci.org
authored
41 end
42
1c189a0 @lsegal Allow rake to function without RSpec
authored
43 begin
3cafb47 @lsegal Make rakefile backwards compatible for rspec 1.x users
authored
44 hide = '_spec\.rb$,spec_helper\.rb$,ruby_lex\.rb$,autoload\.rb$'
bdd8a8f @lsegal Update specs to allow toggling on and off of LEGACY environment variable...
authored
45 if YARD::Parser::SourceParser.parser_type == :ruby
46 hide += ',legacy\/.+_handler'
1ee355e @lsegal Backport new-style parser to 1.8 compatible syntax (and semantics) for r...
authored
47 else
bdd8a8f @lsegal Update specs to allow toggling on and off of LEGACY environment variable...
authored
48 hide += ',ruby_parser\.rb$,ast_node\.rb$,handlers\/ruby\/[^\/]+\.rb$'
1ee355e @lsegal Backport new-style parser to 1.8 compatible syntax (and semantics) for r...
authored
49 end
3cafb47 @lsegal Make rakefile backwards compatible for rspec 1.x users
authored
50
b2ee971 @gioele Minimal update to RSpec 2
gioele authored
51 require 'rspec'
52 require 'rspec/core/rake_task'
1c189a0 @lsegal Allow rake to function without RSpec
authored
53
54 desc "Run all specs"
b2ee971 @gioele Minimal update to RSpec 2
gioele authored
55 RSpec::Core::RakeTask.new("specs") do |t|
1c189a0 @lsegal Allow rake to function without RSpec
authored
56 $DEBUG = true if ENV['DEBUG']
6fdb8fc @lsegal Use default progress output for rspec results instead of specdoc
authored
57 t.rspec_opts = ENV['SUITE'] ? [] : ['-c']
b2ee971 @gioele Minimal update to RSpec 2
gioele authored
58 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 versions...
authored
59 t.rspec_opts += ['-I', YARD::ROOT]
b2ee971 @gioele Minimal update to RSpec 2
gioele authored
60 t.pattern = "spec/**/*_spec.rb"
08977a2 @lsegal Add 'rake suite' task to run specs across all(?) supported ruby versions...
authored
61 t.verbose = $DEBUG ? true : false
fa147d9 @lsegal The great whitespace fix of 2012
authored
62
1c189a0 @lsegal Allow rake to function without RSpec
authored
63 if ENV['RCOV']
fa147d9 @lsegal The great whitespace fix of 2012
authored
64 t.rcov = true
1c189a0 @lsegal Allow rake to function without RSpec
authored
65 t.rcov_opts = ['-x', hide]
66 end
0d541b7 @lsegal Ignore files from RCov stats
authored
67 end
1c189a0 @lsegal Allow rake to function without RSpec
authored
68 task :spec => :specs
69 rescue LoadError
3cafb47 @lsegal Make rakefile backwards compatible for rspec 1.x users
authored
70 begin # Try for rspec 1.x
71 require 'spec'
72 require 'spec/rake/spectask'
fa147d9 @lsegal The great whitespace fix of 2012
authored
73
3cafb47 @lsegal Make rakefile backwards compatible for rspec 1.x users
authored
74 Spec::Rake::SpecTask.new("specs") do |t|
75 $DEBUG = true if ENV['DEBUG']
76 t.spec_opts = ["--format", "specdoc", "--colour"]
77 t.spec_opts += ["--require", File.join(File.dirname(__FILE__), 'spec', 'spec_helper')]
78 t.pattern = "spec/**/*_spec.rb"
79
80 if ENV['RCOV']
fa147d9 @lsegal The great whitespace fix of 2012
authored
81 t.rcov = true
3cafb47 @lsegal Make rakefile backwards compatible for rspec 1.x users
authored
82 t.rcov_opts = ['-x', hide]
83 end
84 end
85 task :spec => :specs
86 rescue LoadError
87 warn "warn: RSpec tests not available. `gem install rspec` to enable them."
88 end
baeb175 @lsegal Add YardocTask Rake task
authored
89 end
90
c351a2c @lsegal Add support for --files switch to specify extra static files to include ...
authored
91 YARD::Rake::YardocTask.new do |t|
0e14ccb @lsegal Move some options to yardopts
authored
92 t.options += ['--title', "YARD #{YARD::VERSION} Documentation"]
5b8d227 @nex3 Add spec as an alias for the specs Rake task.
nex3 authored
93 end
Something went wrong with that request. Please try again.