Class: Guard::Websocketrails
- Defined in:
- lib/guard/websocket-rails.rb
Instance Method Summary collapse
-
#initialize(watchers = [], options = {}) ⇒ Websocketrails
constructor
A new instance of Websocketrails.
- #reload ⇒ Object
- #run_on_change(path) ⇒ Object
- #start ⇒ Object
- #stop ⇒ Object
Constructor Details
#initialize(watchers = [], options = {}) ⇒ Websocketrails
Returns a new instance of Websocketrails.
9 10 11 12 |
# File 'lib/guard/websocket-rails.rb', line 9 def initialize(watchers=[], ={}) super @environment = [:environment] || 'development' end |
Instance Method Details
#reload ⇒ Object
24 25 26 27 |
# File 'lib/guard/websocket-rails.rb', line 24 def reload stop start end |
#run_on_change(path) ⇒ Object
29 30 31 |
# File 'lib/guard/websocket-rails.rb', line 29 def run_on_change(path) reload end |
#start ⇒ Object
14 15 16 17 |
# File 'lib/guard/websocket-rails.rb', line 14 def start system("rake websocket_rails:start_server RAILS_ENV=#{@environment}") UI.info "Websocket standalone server started (#{@environment})" end |
#stop ⇒ Object
19 20 21 22 |
# File 'lib/guard/websocket-rails.rb', line 19 def stop system("rake websocket_rails:stop_server RAILS_ENV=#{@environment}") UI.info "Websocket standalone server stopped (#{@environment})" end |