system_browser 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f1ced922cd811036db806862d7bc097ad029b8ca
4
- data.tar.gz: b9df9ad2c7acb0c13cf06fa19e98d3f088078010
3
+ metadata.gz: 338b936e004171055f0097b60e47397b721be26d
4
+ data.tar.gz: f55554b5c83afe3df64adeb92975a5a7f60de27f
5
5
  SHA512:
6
- metadata.gz: 41f3ada003323e20198b82c4f6c59ca9ec1f51e92c00f4bf466ad7c6f565487482f7c2fb6da8537090eeeb41477134047945c11d39b2b1cece8e81f2d071c1bb
7
- data.tar.gz: 4415a9bb3c1463f0aac5b2a130b1b5ba9292cba5d8b4a3f04f59ff727c539cd69db3bb85f4db3b29377d8c062427d06d39327696f8ad9b5fc03c94cc32682d15
6
+ metadata.gz: 4501536af64df037e517ed3bbfd353b8ba5afeff5833dba0ca412d8741740915448d9dec2875c8f6a0c0b5d64f0a925737bc6d19c213af05c433398657ca62b4
7
+ data.tar.gz: b4ad3de83662538418758dde97311ca1431389e536689925e242f4fdf6695ecab8a0341bc38c1d6619ec0746eaafcb5045b2d7153f99c97d6841478fea0cfc5e
@@ -1,6 +1,10 @@
1
1
  System Browser
2
2
  ==============
3
3
 
4
+ ### v0.1.2 (July 20, 2015)
5
+
6
+ * Added support for OSX executables
7
+
4
8
  ### v0.1.1 (July 20, 2015)
5
9
 
6
10
  * Raise an explicit error if System Browser Client is not installed
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.1
1
+ 0.1.2
@@ -7,7 +7,7 @@ module SystemBrowser
7
7
 
8
8
  ##
9
9
  # The name of the executable of the client application.
10
- CLIENT_EXECUTABLE = 'system_browser'
10
+ CLIENT_NAME = 'system_browser'
11
11
 
12
12
  ##
13
13
  # @return [SystemBrowser::Session]
@@ -32,11 +32,13 @@ module SystemBrowser
32
32
  # @return [Integer] the process ID of the client application
33
33
  # @raise [RuntimeError]
34
34
  def start
35
- unless system("which #{CLIENT_EXECUTABLE} > /dev/null 2>&1")
36
- fail ClientNotFoundError, "executable '#{CLIENT_EXECUTABLE}' is not on your $PATH"
35
+ executable = self.client_executable
36
+
37
+ unless system("which #{executable} > /dev/null 2>&1")
38
+ fail ClientNotFoundError, "executable '#{executable}' is not on your $PATH"
37
39
  end
38
40
 
39
- @init_pid = spawn(CLIENT_EXECUTABLE, pgroup: true)
41
+ @init_pid = spawn(executable, pgroup: true)
40
42
  Process.wait(@init_pid)
41
43
 
42
44
  @init_pid
@@ -59,5 +61,18 @@ module SystemBrowser
59
61
 
60
62
  Process.kill(:INT, @window_pid)
61
63
  end
64
+
65
+ protected
66
+
67
+ def client_executable
68
+ case RUBY_PLATFORM
69
+ when /linux/
70
+ CLIENT_NAME
71
+ when /darwin/
72
+ "/Applications/#{CLIENT_NAME}.app/Contents/MacOS/nwjs"
73
+ else
74
+ raise RuntimeError, "unsupported platform #{RUBY_PLATFORM}"
75
+ end
76
+ end
62
77
  end
63
78
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: system_browser
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kyrylo Silin