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.



67
68
69
70
71
# File 'lib/chef/solr/application/rebuild.rb', line 67

def initialize
  super

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

Instance Method Details

#run_applicationObject



85
86
87
88
89
# File 'lib/chef/solr/application/rebuild.rb', line 85

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

#setup_applicationObject



73
74
75
76
77
78
79
80
81
82
83
# File 'lib/chef/solr/application/rebuild.rb', line 73

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