Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

No need to install doc-related gems when running tests.

This should speed up the build time.
  • Loading branch information...
commit 7784760c314ce955c253cf277696368ef60d6805 1 parent 5b9c961
@floehopper floehopper authored
Showing with 31 additions and 21 deletions.
  1. +18 −15 Rakefile
  2. +1 −0  build-matrix.rb
  3. +12 −6 mocha.gemspec
View
33 Rakefile
@@ -2,7 +2,6 @@ require "bundler"
Bundler::GemHelper.install_tasks
require "bundler/setup"
-require 'yard'
require 'rake/testtask'
desc "Run all tests"
@@ -106,23 +105,27 @@ def benchmark_test_case(klass, iterations)
end
end
-desc 'Remove generated documentation'
-task 'clobber_yardoc' do
- `rm -rf ./doc`
-end
+unless ENV["MOCHA_NO_DOCS"]
+ require 'yard'
-desc 'Generate documentation'
-YARD::Rake::YardocTask.new('yardoc') do |task|
- task.options = ["--title", "Mocha #{Mocha::VERSION}"]
-end
+ desc 'Remove generated documentation'
+ task 'clobber_yardoc' do
+ `rm -rf ./doc`
+ end
-desc "Generate documentation"
-task 'generate_docs' => ['clobber_yardoc', 'yardoc']
+ desc 'Generate documentation'
+ YARD::Rake::YardocTask.new('yardoc') do |task|
+ task.options = ["--title", "Mocha #{Mocha::VERSION}"]
+ end
+
+ desc "Generate documentation"
+ task 'generate_docs' => ['clobber_yardoc', 'yardoc']
-desc "Publish docs to gofreerange.com/docs/mocha"
-task 'publish_docs' => 'generate_docs' do
- path = "/home/freerange/docs/mocha"
- system %{ssh gofreerange.com "sudo rm -fr #{path} && mkdir -p #{path}" && scp -r doc/* gofreerange.com:#{path}}
+ desc "Publish docs to gofreerange.com/docs/mocha"
+ task 'publish_docs' => 'generate_docs' do
+ path = "/home/freerange/docs/mocha"
+ system %{ssh gofreerange.com "sudo rm -fr #{path} && mkdir -p #{path}" && scp -r doc/* gofreerange.com:#{path}}
+ end
end
task 'release' => 'default' do
View
1  build-matrix.rb
@@ -30,6 +30,7 @@ def with_rbenv(command)
def run(gemfile, task = "test")
ENV["BUNDLE_GEMFILE"] = gemfile
ENV["MOCHA_OPTIONS"] = "debug"
+ ENV["MOCHA_NO_DOCS"] = "true"
reset_bundle
execute(
with_rbenv("bundle install --gemfile=#{gemfile}"),
View
18 mocha.gemspec
@@ -30,18 +30,24 @@ Gem::Specification.new do |s|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
s.add_development_dependency("rake", ">= 0")
s.add_development_dependency("introspection", "~> 0.0.1")
- s.add_development_dependency("yard")
- s.add_development_dependency("redcarpet", "~> 1")
+ unless ENV["MOCHA_NO_DOCS"]
+ s.add_development_dependency("yard")
+ s.add_development_dependency("redcarpet", "~> 1")
+ end
else
s.add_dependency("rake", ">= 0")
s.add_dependency("introspection", "~> 0.0.1")
- s.add_dependency("yard")
- s.add_dependency("redcarpet", "~> 1")
+ unless ENV["MOCHA_NO_DOCS"]
+ s.add_dependency("yard")
+ s.add_dependency("redcarpet", "~> 1")
+ end
end
else
s.add_dependency("rake", ">= 0")
s.add_dependency("introspection", "~> 0.0.1")
- s.add_dependency("yard")
- s.add_dependency("redcarpet", "~> 1")
+ unless ENV["MOCHA_NO_DOCS"]
+ s.add_dependency("yard")
+ s.add_dependency("redcarpet", "~> 1")
+ end
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.