Sha256: 78e59308e0d8e3e0bb22f42c395b649d6d4a600eb58329f35ce16941f3f3eb60

Contents?: true

Size: 1.34 KB

Versions: 15

Compression:

Stored size: 1.34 KB

Contents

namespace :cache do
  
  namespace :structure do
    
    desc 'create the directory structure for the cache indexes'
    task :create => :application do
      Indexes.create_directory_structure
      puts "Directory structure generated."
    end
    
  end
  
  desc "Generates the index cache files."
  task :generate => :application do
    Indexes.generate_caches
    puts "Caches generated."
  end

  desc "Generates a specific index cache file like field=books:title. Note: Index tables need to be there. Will generate just the cache."
  task :only => :application do
    type_and_field = ENV['FIELD'] || ENV['field']
    type, field = type_and_field.split ':'
    Indexes.generate_cache_only type.to_sym, field.to_sym
  end
  
  
  desc 'Checks the index cache files'
  task :check => :application do
    Indexes.check_caches
    puts "All caches look ok."
  end
  
  
  desc "Removes the index cache files."
  task :clear => :application do
    Indexes.clear_caches
    puts "All index cache files removed."
  end
  
  
  desc 'Backup the index cache files'
  task :backup => :application do
    Indexes.backup_caches
    puts "Index cache files moved to the backup directory"
  end
  
  desc 'Restore the index cache files'
  task :restore => :application do
    Indexes.restore_caches
    puts "Index cache files restored from the backup directory"
  end
  
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
picky-0.3.0 lib/tasks/cache.rake
picky-0.2.4 lib/tasks/cache.rake
picky-0.2.3 lib/tasks/cache.rake
picky-0.2.2 lib/tasks/cache.rake
picky-0.2.1 lib/tasks/cache.rake
picky-0.2.0 lib/tasks/cache.rake
picky-0.1.0 lib/tasks/cache.rake
picky-0.0.9 lib/tasks/cache.rake
picky-0.0.8 lib/tasks/cache.rake
picky-0.0.7 lib/tasks/cache.rake
picky-0.0.6 lib/tasks/cache.rake
picky-0.0.5 lib/tasks/cache.rake
picky-0.0.4 lib/tasks/cache.rake
picky-0.0.3 lib/tasks/cache.rake
picky-0.0.2 lib/tasks/cache.rake