Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Allow start_tunnel to accept a block

  • Loading branch information...
commit d4302e617b8c151da1c37e27c2505741ce57d859 1 parent 44816f8
@rtyler authored
Showing with 8 additions and 1 deletion.
  1. +8 −1 lib/passageway/client.rb
View
9 lib/passageway/client.rb
@@ -54,7 +54,14 @@ def start_tunnel
end
puts " Port #{port} is now publicly accessible from http://#{tunnel['host']} ..."
begin
- sleep 1 while true
+ # If we're using Passageway from within Ruby
+ if block_given?
+ yield
+ else
+ # Otherwise, we're probably calling it on the command line, so
+ # let's just block forever
+ sleep 1 while true
+ end
rescue Interrupt
gateway.close_remote(rp, rh)
exit
Please sign in to comment.
Something went wrong with that request. Please try again.