lib/vegas/runner.rb in quirkey-vegas-0.0.3.1 vs lib/vegas/runner.rb in quirkey-vegas-0.0.4
- old
+ new
@@ -44,11 +44,11 @@
check_for_running
find_port
write_url
begin
- launch!
+ launch! unless options[:skip_launch]
daemonize! unless options[:foreground]
run!
rescue RuntimeError => e
logger.warn "There was an error starting #{app_name}: #{e}"
exit
@@ -149,11 +149,10 @@
File.open(pid_file, 'w') {|f| f.write("#{Process.pid}") }
at_exit { delete_pid! }
end
def launch!(specific_url = nil)
- # Launchy.open(specific_url || url)
cmd = WINDOWS ? "start" : "sleep 2 && open"
system "#{cmd} #{specific_url || url}"
end
def kill!
@@ -207,11 +206,15 @@
}
opts.on("-F", "--foreground", "don't daemonize, run in the foreground") { |f|
@options[:foreground] = true
}
-
+
+ opts.on("-L", "--no-launch", "don't launch the browser") { |f|
+ @options[:skip_launch] = true
+ }
+
opts.on('-K', "--kill", "kill the running process and exit") {|k|
kill!
exit
}
@@ -256,6 +259,6 @@
def delete_pid!
File.delete(pid_file) if File.exist?(pid_file)
end
end
-end
\ No newline at end of file
+end