flammarion 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/flammarion.rb +8 -3
- data/lib/flammarion/version.rb +1 -1
- metadata +1 -1
data/lib/flammarion.rb
CHANGED
@@ -8,6 +8,7 @@ require 'coffee-script'
|
|
8
8
|
require 'sass'
|
9
9
|
require 'colorize'
|
10
10
|
require 'filewatcher'
|
11
|
+
require 'rbconfig'
|
11
12
|
|
12
13
|
require_relative 'flammarion/writeable.rb'
|
13
14
|
require_relative 'flammarion/pane.rb'
|
@@ -81,12 +82,16 @@ module Flammarion
|
|
81
82
|
|
82
83
|
CHROME_PATH = 'C:\Program Files (x86)\Google\Chrome\Application\chrome.exe'
|
83
84
|
def open_a_window_on_windows
|
84
|
-
|
85
|
-
|
85
|
+
file_path = File.absolute_path(File.dirname(__FILE__))
|
86
|
+
file_path = `cygpath -w '#{file_path}'`.strip if RbConfig::CONFIG["host_os"] == "cygwin"
|
87
|
+
resource = %[file\://#{file_path}/html/build/index.html]
|
88
|
+
chrome_path = CHROME_PATH
|
89
|
+
chrome_path = `cygpath -u '#{CHROME_PATH}'`.strip if RbConfig::CONFIG["host_os"] == "cygwin"
|
90
|
+
spawn(chrome_path, %[--app=#{resource}?path=#{@window_id}&port=#{@@server.port}])
|
86
91
|
end
|
87
92
|
|
88
93
|
def open_a_window
|
89
|
-
return open_a_window_on_windows if
|
94
|
+
return open_a_window_on_windows if RbConfig::CONFIG["host_os"] =~ /cygwin|mswin|mingw/
|
90
95
|
developmentMode = system("lsof -i:#{4567}", out: '/dev/null')
|
91
96
|
host = "file://#{File.dirname(File.absolute_path(__FILE__))}/html/build/index.html"
|
92
97
|
host = "http://localhost:4567/" if developmentMode
|
data/lib/flammarion/version.rb
CHANGED