Class: Guard::RemoteRails
Constant Summary
Constants included from Guard
Instance Method Summary collapse
-
#initialize(watchers = [], options = { :rails_env => "development" }) ⇒ RemoteRails
constructor
A new instance of RemoteRails.
- #reload ⇒ Object
- #run_on_changes(paths_or_symbol) ⇒ Object
- #start ⇒ Object
- #stop ⇒ Object
Constructor Details
#initialize(watchers = [], options = { :rails_env => "development" }) ⇒ RemoteRails
Returns a new instance of RemoteRails.
7 8 9 10 |
# File 'lib/guard/rrails.rb', line 7 def initialize(watchers=[], ={ :rails_env => "development" }) super @options = end |
Instance Method Details
#reload ⇒ Object
19 20 21 22 |
# File 'lib/guard/rrails.rb', line 19 def reload self.stop self.start end |
#run_on_changes(paths_or_symbol) ⇒ Object
24 25 26 |
# File 'lib/guard/rrails.rb', line 24 def run_on_changes(paths_or_symbol) self.reload end |
#start ⇒ Object
12 13 14 15 16 17 |
# File 'lib/guard/rrails.rb', line 12 def start @pid = fork do $0 = "guard[rrails][#{@options[:rails_env]}]" ::RemoteRails::Server.new(@options).start end end |
#stop ⇒ Object
28 29 30 31 |
# File 'lib/guard/rrails.rb', line 28 def stop Process.kill('TERM', @pid) @pid = nil end |