finalize basic tweaks

This commit is contained in:
John Bintz 2011-05-27 14:51:49 -04:00
parent e373939dec
commit 21878134e3
1 changed files with 2 additions and 1 deletions

View File

@ -6,6 +6,7 @@ module Guard
attr_reader :options attr_reader :options
def initialize(watchers = [], options = {}) def initialize(watchers = [], options = {})
super
@options = { :port => 3000, :environment => 'development', :start_on_start => true }.merge(options) @options = { :port => 3000, :environment => 'development', :start_on_start => true }.merge(options)
end end
@ -17,7 +18,7 @@ module Guard
def run_all def run_all
Notifier.notify("Rails restarting on port #{options[:port]} in #{options[:environment]}", :title => "Restarting Rails...", :image => :pending) Notifier.notify("Rails restarting on port #{options[:port]} in #{options[:environment]}", :title => "Restarting Rails...", :image => :pending)
system %{sh -c '[[ -f tmp/pids/#{options[:environment]}.pid ]] && kill $(cat tmp/pids/#{options[:environment]}.pid)'} system %{sh -c '[[ -f tmp/pids/#{options[:environment]}.pid ]] && kill $(cat tmp/pids/#{options[:environment]}.pid)'}
system %{rails s -d e #{options[:environment]} -p #{options[:port]}} system %{rails s -d -e #{options[:environment]} -p #{options[:port]}}
end end
def run_on_change(paths) def run_on_change(paths)