Class: Guard::Sunspot
Instance Method Summary collapse
-
#initialize(watchers = [], options = {}) ⇒ Sunspot
constructor
A new instance of Sunspot.
- #reload ⇒ Object
- #run_on_changes(path) ⇒ Object
- #start ⇒ Object
- #stop ⇒ Object
Constructor Details
#initialize(watchers = [], options = {}) ⇒ Sunspot
Returns a new instance of Sunspot.
7 8 9 10 11 |
# File 'lib/guard/sunspot.rb', line 7 def initialize(watchers=[], ={}) super @environment = [:environment] || 'development' end |
Instance Method Details
#reload ⇒ Object
23 24 25 26 |
# File 'lib/guard/sunspot.rb', line 23 def reload stop start end |
#run_on_changes(path) ⇒ Object
28 29 30 |
# File 'lib/guard/sunspot.rb', line 28 def run_on_changes(path) reload end |
#start ⇒ Object
13 14 15 16 |
# File 'lib/guard/sunspot.rb', line 13 def start system("rake sunspot:solr:start RAILS_ENV=#{@environment}") UI.info "Sunspot started" end |
#stop ⇒ Object
18 19 20 21 |
# File 'lib/guard/sunspot.rb', line 18 def stop system("rake sunspot:solr:stop RAILS_ENV=#{@environment}") UI.info "Sunspot stopped" end |