Class: Chef::Solr::Application::Rebuild

Inherits:
Application
  • Object
show all
Defined in:
lib/chef/solr/application/rebuild.rb

Instance Method Summary collapse

Constructor Details

#initializeRebuild

Returns a new instance of Rebuild.



75
76
77
78
79
# File 'lib/chef/solr/application/rebuild.rb', line 75

def initialize
  super

  @index = Chef::Solr::Index.new
end

Instance Method Details

#run_applicationObject



93
94
95
96
97
# File 'lib/chef/solr/application/rebuild.rb', line 93

def run_application
  s = Chef::Solr.new(Chef::Config[:solr_url])
  Chef::Log.info("Destroying the index")
  s.rebuild_index
end

#setup_applicationObject



81
82
83
84
85
86
87
88
89
90
91
# File 'lib/chef/solr/application/rebuild.rb', line 81

def setup_application
  Chef::Log.level = Chef::Config[:log_level]
  Chef::Log.warn("This operation is destructive!")
  Chef::Log.warn("I'm going to count to 10, and then delete your Solr index and rebuild it.")
  Chef::Log.warn("CTRL-C will, of course, stop this disaster.")
  0.upto(10) do |num|
    Chef::Log.warn("... #{num}")
    sleep 1
  end
  Chef::Log.warn("... Bombs away!")
end