Skip to content

Commit

Permalink
moving rake task into xapit/rake_tasks.rb so it can be included with gem
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanb committed Jun 12, 2009
1 parent 954934f commit adebe8a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
13 changes: 13 additions & 0 deletions lib/xapit/rake_tasks.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# TODO investigate why this is needed to ensure it doesn't load twice
unless @xapit_rake_loaded
@xapit_rake_loaded = true
namespace :xapit do
desc "Index all xapit models."
task :index => :environment do
Xapit.remove_database
Xapit.index_all do |member_class|
puts "Indexing #{member_class.name}"
end
end
end
end
14 changes: 1 addition & 13 deletions tasks/xapit.rake
Original file line number Diff line number Diff line change
@@ -1,13 +1 @@
# TODO investigate why this is needed to ensure it doesn't load twice
unless @xapit_rake_loaded
@xapit_rake_loaded = true
namespace :xapit do
desc "Index all xapit models."
task :index => :environment do
Xapit.remove_database
Xapit.index_all do |member_class|
puts "Indexing #{member_class.name}"
end
end
end
end
require File.join(File.dirname(__FILE__), '/../lib/xapit/rake_tasks')

0 comments on commit adebe8a

Please sign in to comment.