lib/flammarion/revelator.rb in flammarion-0.0.14 vs lib/flammarion/revelator.rb in flammarion-0.1.0
- old
+ new
@@ -5,9 +5,10 @@
CHROME_PATH = 'C:\Program Files (x86)\Google\Chrome\Application\chrome.exe'
def open_a_window_on_windows(options)
file_path = File.absolute_path(File.join(File.dirname(__FILE__), ".."))
file_path = `cygpath -w '#{file_path}'`.strip if RbConfig::CONFIG["host_os"] == "cygwin"
resource = %[file\://#{file_path}/html/build/index.html]
+ resource = "http://localhost:4567/" if ENV["FLAMMARION_DEVELOPMENT"] == "true"
chrome_path = CHROME_PATH
chrome_path = `cygpath -u '#{CHROME_PATH}'`.strip if RbConfig::CONFIG["host_os"] == "cygwin"
Process.detach(spawn(chrome_path, %[--app=#{resource}?path=#{@window_id}&port=#{server.port}&title="#{options[:title] || "Flammarion%20Engraving"}"]))
end