lib/guard/webrick.rb in guard-webrick-0.1.1 vs lib/guard/webrick.rb in guard-webrick-0.1.2
- old
+ new
@@ -13,10 +13,11 @@
def initialize(watchers=[], options={})
super
@options = {
:host => '0.0.0.0',
:port => 3000,
+ :ssl => false,
:docroot => Dir::pwd,
:launchy => true
}.update(options)
end
@@ -33,14 +34,16 @@
else
@pid = Spoon.spawnp('ruby',
File.expand_path(File.join(File.dirname(__FILE__), %w{webrick server.rb})),
@options[:host],
@options[:port].to_s,
+ @options[:ssl].to_s,
@options[:docroot]
)
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
end
end