From 9ad83268ee44a2c43f7511ae388c3ade5adfddf2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Re=CC=81mi=20Pre=CC=81vost?= Date: Mon, 5 Mar 2012 16:05:21 -0500 Subject: [PATCH] Use yard/rspec Rake tasks --- .yardopts | 13 ------------- Gemfile.lock | 4 ++-- Rakefile | 29 +++++++++++++++++++++++------ 3 files changed, 25 insertions(+), 21 deletions(-) delete mode 100644 .yardopts diff --git a/.yardopts b/.yardopts deleted file mode 100644 index 90c201a..0000000 --- a/.yardopts +++ /dev/null @@ -1,13 +0,0 @@ ---title "Teamocil" - ---no-cache ---protected ---no-private - ---markup "markdown" ---markup-provider "maruku" - ---format html - -"README.mkd" -"lib/**/*.rb" diff --git a/Gemfile.lock b/Gemfile.lock index cb08293..3deb3c7 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - teamocil (0.3.1) + teamocil (0.3.2) GEM remote: http://rubygems.org/ @@ -19,7 +19,7 @@ GEM diff-lcs (~> 1.1.2) rspec-mocks (2.6.0) syntax (1.0.0) - yard (0.7.2) + yard (0.7.5) PLATFORMS ruby diff --git a/Rakefile b/Rakefile index 1e9bbb2..d817f5f 100644 --- a/Rakefile +++ b/Rakefile @@ -1,11 +1,28 @@ +require "bundler" +Bundler.require(:development) + require "bundler/gem_tasks" +require "rspec/core/rake_task" -desc "Run specs" -task :spec do # {{{ - sh "bundle exec rspec --color --format=nested #{Dir.glob(File.join(File.dirname(__FILE__), "spec/**/*_spec.rb")).join(" ")}" +task :default => :spec + +desc "Run all specs" +RSpec::Core::RakeTask.new(:spec) do |task| # {{{ + task.pattern = "spec/**/*_spec.rb" + task.rspec_opts = "--colour --format=documentation" end # }}} -desc "Generate documentation" -task :doc do # {{{ - sh "bundle exec yard doc" +desc "Generate YARD Documentation" +YARD::Rake::YardocTask.new do |task| # {{{ + task.options = [ + "-o", File.expand_path("../doc", __FILE__), + "--readme=README.md", + "--markup=markdown", + "--markup-provider=maruku", + "--no-private", + "--no-cache", + "--protected", + "--title=Teamocil", + ] + task.files = ["lib/**/*.rb"] end # }}}