lib/tasks/index.rake in picky-3.6.16 vs lib/tasks/index.rake in picky-4.0.0pre1
- old
+ new
@@ -1,22 +1,21 @@
# Indexing tasks.
#
-desc "Generate the index (index, category optional)."
-task :index, [:index, :category] => :application do |_, options|
- index, category = options.index, options.category
+desc "Generate the index in parallel (index, category optional)."
+task :index, [:index, :category] => :'index:parallel'
- specific = Picky::Indexes
- specific = specific[index] if index
- specific = specific[category] if category
- specific.index
-end
-
namespace :index do
- task :randomly => :application do
- Picky::Indexes.index true
- end
- task :ordered => :application do
- Picky::Indexes.index false
+ [:parallel, :serial].each do |kind|
+ desc "Generate the index in #{kind} (index, category optional)."
+ task kind, [:index, :category] => :application do |_, options|
+ index, category = options.index, options.category
+
+ specific = Picky::Indexes
+ specific = specific[index] if index
+ specific = specific[category] if category
+
+ specific.index Picky::Scheduler.new(kind => true)
+ end
end
end
\ No newline at end of file