Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixes #8 stop Rake clashing with models named Task.

Stopped Rake being required by Seedbank.
Renamed Seedbank::Task to Seedbank::RenameTask.
Only add Seedbank::RenameTask and Seedbank::TaskManager when DSL included.

Signed-off-by: James McCarthy <james2mccarthy@gmail.com>
  • Loading branch information...
commit d757987f91996dc692912956ecd9f08798289c94 1 parent 9d81155
James McCarthy authored
4 lib/seedbank.rb
View
@@ -1,10 +1,8 @@
require 'seedbank/dsl'
-require 'seedbank/task'
+require 'seedbank/rename_task'
require 'seedbank/task_manager'
require 'seedbank/runner'
-require 'rake' unless defined?(Rake)
-
module Seedbank
class << self
5 lib/seedbank/dsl.rb
View
@@ -1,6 +1,11 @@
module Seedbank
module DSL
+ def self.included(base)
+ Rake::Task.extend(Seedbank::RenameTask)
+ Rake::Application.send(:include, Seedbank::TaskManager)
+ end
+
def override_task(*args, &block)
name, params, deps = Rake.application.resolve_args(args.dup)
fq_name = Rake.application.instance_variable_get(:@scope).dup.push(name).join(':')
2  lib/seedbank/task.rb → lib/seedbank/rename_task.rb
View
@@ -1,5 +1,5 @@
module Seedbank
- module Task
+ module RenameTask
def rename_task(fq_name, new_name)
Rake.application.rename_task(fq_name, new_name)
2  lib/tasks/seed.rake
View
@@ -1,7 +1,5 @@
namespace :db do
- Rake::Task.extend(Seedbank::Task)
- Rake::Application.send(:include, Seedbank::TaskManager)
include Seedbank::DSL
base_dependencies = ['db:seed:original']

1 comment on commit d757987

Dom

Nice work! And thanks for sorting this out... I think seedbank is invaluable and kudos to you for sharing it.

Please sign in to comment.
Something went wrong with that request. Please try again.