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 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
- resource = %[file\://#{File.absolute_path(File.dirname(__FILE__))}/html/build/index.html]
85
- spawn(CHROME_PATH, %[--app=#{resource}?path=#{@window_id}&port=#{@@server.port}])
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 Gem.win_platform?
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
@@ -1,3 +1,3 @@
1
1
  module Flammarion
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flammarion
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: