Sha256: b5d108105485b777a03062bd06cae3aaa5c30b6b5f71e22af677a51195e1a6ff

Contents?: true

Size: 1.13 KB

Versions: 19

Compression:

Stored size: 1.13 KB

Contents

namespace :mebla do
  desc "Creates the indeces and indexes the data for all indexed models"
  task :index => :environment do
    setup
    @context.index_data
  end
  
  desc "Drops then creates the indeces and indexes the data for all indexed models"
  task :reindex => :environment do
    setup
    @context.reindex_data
  end
  
  desc "Creates the index without indexing the data"
  task :create_index => :environment do
    setup
    @context.create_index
  end
  
  desc "Rebuilds the index without indexing the data"
  task :rebuild_index => :environment do
    setup
    @context.rebuild_index
  end
  
  desc "Drops the index"
  task :drop_index => :environment do
    setup
    @context.drop_index
  end
  
  desc "Refreshes the index"
  task :refresh_index => :environment do
    setup
    @context.refresh_index
  end
end

# @private
# Sets up the logger and loads all the models
def setup
  Rails.application.eager_load!
  Mebla.configure do |config|
    config.logger = ActiveSupport::BufferedLogger.new(STDOUT)
    config.logger.level = ActiveSupport::BufferedLogger::Severity::UNKNOWN
    config.setup_logger
  end
  @context = Mebla.context
end

Version data entries

19 entries across 19 versions & 2 rubygems

Version Path
rmla-1.0 lib/mebla/tasks.rb
mebla-1.1.14 lib/mebla/tasks.rb
mebla-1.1.13 lib/mebla/tasks.rb
mebla-1.1.12 lib/mebla/tasks.rb
mebla-1.1.11 lib/mebla/tasks.rb
mebla-1.1.10 lib/mebla/tasks.rb
mebla-1.1.9 lib/mebla/tasks.rb
mebla-1.1.8 lib/mebla/tasks.rb
mebla-1.1.7 lib/mebla/tasks.rb
mebla-1.1.6 lib/mebla/tasks.rb
mebla-1.1.5 lib/mebla/tasks.rb
mebla-1.1.4 lib/mebla/tasks.rb
mebla-1.1.2 lib/mebla/tasks.rb
mebla-1.1.1 lib/mebla/tasks.rb
mebla-1.1.0 lib/mebla/tasks.rb
mebla-1.0.3 lib/mebla/tasks.rb
mebla-1.0.2 lib/mebla/tasks.rb
mebla-1.0.1 lib/mebla/tasks.rb
mebla-1.0.0 lib/mebla/tasks.rb