Skip to content
Newer
Older
100644 71 lines (59 sloc) 1.93 KB
baeb175 @lsegal Add YardocTask Rake task
authored May 30, 2008
1 require File.dirname(__FILE__) + '/lib/yard'
acfba72 @lsegal Better rake support for windows
authored May 26, 2010
2 require 'rbconfig'
96f0302 Added gemspec
loren authored Mar 2, 2007
3
f27213b @lsegal Add YARD_VERSION env to Rakefile. Allows installing as arbitrary gem …
authored Jul 5, 2010
4 YARD::VERSION.replace(ENV['YARD_VERSION']) if ENV['YARD_VERSION']
acfba72 @lsegal Better rake support for windows
authored May 27, 2010
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 May 26, 2008
6 SUDO = WINDOWS ? '' : 'sudo'
7
1e4d5e9 @lsegal Change default rake task to run specs
authored May 26, 2008
8 task :default => :specs
96f0302 Added gemspec
loren authored Mar 2, 2007
9
0f77917 @lsegal Remove gem package Rake tasks and use simplified gem build functionality
authored Jan 7, 2010
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 Feb 25, 2011
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 Jul 5, 2010
13 load 'yard.gemspec'
14 Gem::Builder.new(SPEC).build
22cdc42 Add better exception handling, add 'rake install' task
loren authored Feb 21, 2008
15 end
16
0f77917 @lsegal Remove gem package Rake tasks and use simplified gem build functionality
authored Jan 7, 2010
17 desc "Installs the gem"
5824a94 @lsegal Only build .gem for install
authored Nov 13, 2009
18 task :install => :gem do
0f77917 @lsegal Remove gem package Rake tasks and use simplified gem build functionality
authored Jan 7, 2010
19 sh "#{SUDO} gem install yard-#{YARD::VERSION}.gem --no-rdoc --no-ri"
e54b06f @lsegal Consolidate gemspec into Rakefile and add specs task
authored Mar 1, 2008
20 end
21
1c189a0 @lsegal Allow rake to function without RSpec
authored Nov 13, 2009
22 begin
3cafb47 @lsegal Make rakefile backwards compatible for rspec 1.x users
authored Dec 17, 2010
23 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 Feb 26, 2011
24 if YARD::Parser::SourceParser.parser_type == :ruby
25 hide += ',legacy\/.+_handler'
1ee355e @lsegal Backport new-style parser to 1.8 compatible syntax (and semantics) fo…
authored Jan 11, 2011
26 else
bdd8a8f @lsegal Update specs to allow toggling on and off of LEGACY environment varia…
authored Feb 26, 2011
27 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 Jan 12, 2011
28 end
3cafb47 @lsegal Make rakefile backwards compatible for rspec 1.x users
authored Dec 17, 2010
29
b2ee971 @gioele Minimal update to RSpec 2
gioele authored Dec 12, 2010
30 require 'rspec'
31 require 'rspec/core/rake_task'
1c189a0 @lsegal Allow rake to function without RSpec
authored Nov 13, 2009
32
33 desc "Run all specs"
b2ee971 @gioele Minimal update to RSpec 2
gioele authored Dec 12, 2010
34 RSpec::Core::RakeTask.new("specs") do |t|
1c189a0 @lsegal Allow rake to function without RSpec
authored Nov 13, 2009
35 $DEBUG = true if ENV['DEBUG']
3cafb47 @lsegal Make rakefile backwards compatible for rspec 1.x users
authored Dec 17, 2010
36 t.rspec_opts = ["--colour", "--format", "documentation"]
b2ee971 @gioele Minimal update to RSpec 2
gioele authored Dec 12, 2010
37 t.rspec_opts += ["--require", File.join(File.dirname(__FILE__), 'spec', 'spec_helper')]
38 t.pattern = "spec/**/*_spec.rb"
0d541b7 @lsegal Ignore files from RCov stats
authored Oct 16, 2009
39
1c189a0 @lsegal Allow rake to function without RSpec
authored Nov 13, 2009
40 if ENV['RCOV']
41 t.rcov = true
42 t.rcov_opts = ['-x', hide]
43 end
0d541b7 @lsegal Ignore files from RCov stats
authored Oct 16, 2009
44 end
1c189a0 @lsegal Allow rake to function without RSpec
authored Nov 13, 2009
45 task :spec => :specs
46 rescue LoadError
3cafb47 @lsegal Make rakefile backwards compatible for rspec 1.x users
authored Dec 17, 2010
47 begin # Try for rspec 1.x
48 require 'spec'
49 require 'spec/rake/spectask'
50
51 Spec::Rake::SpecTask.new("specs") do |t|
52 $DEBUG = true if ENV['DEBUG']
53 t.spec_opts = ["--format", "specdoc", "--colour"]
54 t.spec_opts += ["--require", File.join(File.dirname(__FILE__), 'spec', 'spec_helper')]
55 t.pattern = "spec/**/*_spec.rb"
56
57 if ENV['RCOV']
58 t.rcov = true
59 t.rcov_opts = ['-x', hide]
60 end
61 end
62 task :spec => :specs
63 rescue LoadError
64 warn "warn: RSpec tests not available. `gem install rspec` to enable them."
65 end
baeb175 @lsegal Add YardocTask Rake task
authored May 30, 2008
66 end
67
c351a2c @lsegal Add support for --files switch to specify extra static files to inclu…
authored May 3, 2009
68 YARD::Rake::YardocTask.new do |t|
0e14ccb @lsegal Move some options to yardopts
authored Nov 1, 2009
69 t.options += ['--title', "YARD #{YARD::VERSION} Documentation"]
5b8d227 @nex3 Add spec as an alias for the specs Rake task.
nex3 authored Jun 7, 2009
70 end
Something went wrong with that request. Please try again.