Browse files

Don't require yard and git libraries to use the Rakefile

This makes it possible to use the Rakefile without those libraries
installed.  If I just want to fix a bug or add a feature to the
library, I shouldn't have to install unnecessary libraries to do

This also has the advantage of speeding up the Rakefile, in most
cases, since it won't load the git library for most tasks.
  • Loading branch information...
1 parent 34f1893 commit bb8be3c191405fd702f278589f99523e638445de @jeremyevans jeremyevans committed Apr 5, 2012
Showing with 12 additions and 5 deletions.
  1. +12 −5 Rakefile
17 Rakefile
@@ -1,17 +1,22 @@
require 'rubygems'
require 'rake'
require 'rspec/core/rake_task'
-require 'yard'
-require 'git'
$:.push File.expand_path("../lib", __FILE__)
require "orm_adapter/version"
task :default => :spec do |t|
- t.files = ['lib/**/*.rb', 'README.rdoc']
+ require 'yard'
+ do |t|
+ t.files = ['lib/**/*.rb', 'README.rdoc']
+ end
+rescue LoadError
+ task :doc do
+ puts "install yard to generate the docs"
+ end
task :build do
@@ -24,6 +29,7 @@ namespace :release do
task :github => :pre do
+ require 'git'
tag = "v#{OrmAdapter::VERSION}"
git ='.')
@@ -36,6 +42,7 @@ namespace :release do
task :pre => [:spec, :build] do
+ require 'git'
git ='.')
if File.exists?("Gemfile.lock") &&"Gemfile.lock") !="Gemfile.lock.development")
@@ -53,4 +60,4 @@ namespace :release do
task :all => ['release:github', 'release:rubygems']

0 comments on commit bb8be3c

Please sign in to comment.