From 58e7e4f7d8799d4dbf5bb6e2393659fe3d8a96f6 Mon Sep 17 00:00:00 2001 From: Derek Kastner Date: Tue, 24 May 2011 14:04:31 -0400 Subject: [PATCH 1/2] Support Rake 0.9 --- lib/rocco/tasks.rb | 2 ++ rocco.gemspec | 1 + 2 files changed, 3 insertions(+) diff --git a/lib/rocco/tasks.rb b/lib/rocco/tasks.rb index b6ed28d..a5b2a61 100644 --- a/lib/rocco/tasks.rb +++ b/lib/rocco/tasks.rb @@ -58,6 +58,8 @@ class Rocco # `Rocco::Task.new` takes a task name, the destination directory docs # should be built under, and a source file pattern or file list. class Task + include Rake::DSL + def initialize(task_name, dest='docs/', sources='lib/**/*.rb', options={}) @name = task_name @dest = dest[-1] == ?/ ? dest : "#{dest}/" diff --git a/rocco.gemspec b/rocco.gemspec index 168e798..1ceee7d 100644 --- a/rocco.gemspec +++ b/rocco.gemspec @@ -45,6 +45,7 @@ Gem::Specification.new do |s| s.test_files = s.files.select {|path| path =~ /^test\/.*_test.rb/} s.add_dependency 'rdiscount' s.add_dependency 'mustache' + s.add_development_dependency 'rake', '>= 0.9.0' s.has_rdoc = false s.homepage = "http://rtomayko.github.com/rocco/" From c1a50174681aedf13d83ddb1887cc703790e3eab Mon Sep 17 00:00:00 2001 From: Derek Kastner Date: Tue, 24 May 2011 15:14:29 -0400 Subject: [PATCH 2/2] Support for Rake < 0.9 --- lib/rocco/tasks.rb | 2 +- rocco.gemspec | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/rocco/tasks.rb b/lib/rocco/tasks.rb index a5b2a61..828e87a 100644 --- a/lib/rocco/tasks.rb +++ b/lib/rocco/tasks.rb @@ -58,7 +58,7 @@ class Rocco # `Rocco::Task.new` takes a task name, the destination directory docs # should be built under, and a source file pattern or file list. class Task - include Rake::DSL + include Rake::DSL if defined?(Rake::DSL) def initialize(task_name, dest='docs/', sources='lib/**/*.rb', options={}) @name = task_name diff --git a/rocco.gemspec b/rocco.gemspec index 1ceee7d..168e798 100644 --- a/rocco.gemspec +++ b/rocco.gemspec @@ -45,7 +45,6 @@ Gem::Specification.new do |s| s.test_files = s.files.select {|path| path =~ /^test\/.*_test.rb/} s.add_dependency 'rdiscount' s.add_dependency 'mustache' - s.add_development_dependency 'rake', '>= 0.9.0' s.has_rdoc = false s.homepage = "http://rtomayko.github.com/rocco/"