Sha256: e4481a635b81922d4672cd276dea791f3b9dd15dabb38b974661275f97501ce0

Contents?: true

Size: 1.01 KB

Versions: 9

Compression:

Stored size: 1.01 KB

Contents

#!/usr/bin/env ruby
require 'rubygems'
require 'main'
require 'mongo'
require File.expand_path( File.join(File.dirname(__FILE__), %w[.. lib wackamole]))

Main {  
  option('reset', 'r') {
    default     false
    description "Reset all indexes"    
  }

  option('set', 's') {
    default     false
    description "Set all indexes"    
  }

  option('clear', 'c') {
    default     false
    description "Clear all indexes"    
  }

  option( 'verbose', 'v') {
    default     false
    description "Show verbose information"    
  }
  
  environment( 'WACKAMOLE_ENV' ) {
    default 'production'
    description 'Wackamole env to choose from in landscape yml'
  }
      
  # Enter main loop  
  def run    
    config_file = File.join( ENV['HOME'], %w[.wackamole wackamole.yml] )
    Wackamole::Control.init_config( config_file, params['WACKAMOLE_ENV'].value )
    Wackamole::Control.ensure_indexes!( 
      params[:set].value, 
      params[:reset].value, 
      params[:verbose].value, 
      params[:clear].value 
    )
  end
}

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
wackamole-0.1.4 bin/setup_indexes
wackamole-0.1.3 bin/setup_indexes
wackamole-0.1.2 bin/setup_indexes
wackamole-0.0.9 bin/setup_indexes
wackamole-0.0.8 bin/setup_indexes
wackamole-0.0.7 bin/setup_indexes
wackamole-0.0.6 bin/setup_indexes
wackamole-0.0.5 bin/setup_indexes
wackamole-0.0.4 bin/setup_indexes