Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Launch opens an HTTPS URL if SSL option is set.

  • Loading branch information...
commit 787a4a3baa918f0e28f542f2dd31d2e63ebef1da 1 parent d6a3b8e
@fnichol authored
Showing with 10 additions and 2 deletions.
  1. +2 −1  lib/guard/webrick.rb
  2. +8 −1 spec/guard/webrick_spec.rb
View
3  lib/guard/webrick.rb
@@ -41,7 +41,8 @@ def start
)
wait_for_port
if @options[:launchy]
- Launchy.open("http://#{@options[:host]}:#{@options[:port]}")
+ scheme = options[:ssl] ? "https" : "http"
+ Launchy.open("#{scheme}://#{@options[:host]}:#{@options[:port]}")
@options[:launchy] = false # only run once
end
@pid
View
9 spec/guard/webrick_spec.rb
@@ -123,11 +123,18 @@
subject.start
end
- it "should open a web browser page" do
+ it "should open an HTTP web browser page" do
Launchy.should_receive(:open).with("http://0.0.0.0:3000")
subject.start
end
+ it "should open an HTTPS web browser page" do
+ Launchy.should_receive(:open).with("https://0.0.0.0:3000")
+ subject = Guard::WEBrick.new([], { :ssl => true })
+ subject.stub(:wait_for_port)
+ subject.start
+ end
+
it "should not open a web browser if disabled" do
subject = Guard::WEBrick.new([], { :launchy => false })
subject.stub(:wait_for_port)
Please sign in to comment.
Something went wrong with that request. Please try again.