lib/guard/jekyll-plus.rb in guard-jekyll-plus-1.4.0 vs lib/guard/jekyll-plus.rb in guard-jekyll-plus-1.4.1
- old
+ new
@@ -56,11 +56,11 @@
@pid = nil
# Create a Jekyll site
#
@site = ::Jekyll::Site.new @config
- @rack = ::Rack::Server.new(rack_config) if USE_RACK
+ @rack = ::Rack::Server.new(rack_config(@destination)) if USE_RACK
puts @rack
end
def start
@@ -212,12 +212,14 @@
config = options
end
::Jekyll.configuration(config)
end
- def rack_config
+ def rack_config(root)
+ ENV['RACK_ROOT'] = root
default_config = File.expand_path("../rack/config.ru", File.dirname(__FILE__))
local_config = File.exist? 'config.ru' ? 'config.ru' : nil
+
config = (@config['rack_config'] || local_config || default_config)
puts config
{ :config => config, :Port => @config['port'], :Host => @config['host'] }
end