Class: Tane::Commands::Open
Class Method Summary collapse
Methods inherited from Base
Methods included from Helpers
Class Method Details
.help_text ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/tane/commands/open.rb', line 20 def help_text <<-EOL Usage: tane open Waits until there's a webserver running at port 3000 and then opens the browser to it. tane open EOL end |
.process(args) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/tane/commands/open.rb', line 5 def process(args) timeout = opts.timeout || 120 started = try_for(:seconds => timeout) do begin RestClient.get("http://localhost:3000/") true rescue => e false end end Launchy.open("http://localhost:3000/") if started end |