sauce-connect 3.5.3 → 3.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/sauce/connect.rb +64 -87
- metadata +14 -8
- data/support/Sauce-Connect.jar +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 339e50f0444a31f173d2ed8128d59fa8e0bdd3f5
|
4
|
+
data.tar.gz: 39aaac5a74ab6c607f6b130581f7b6072d3de6fa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fc2a7ca12fb914304a8bdeb24230621de703be394a173d7fa01da638e03adbc035d5d69e00b6a9f2d51876f838a0761c30a80a1950a09e1ae53099958e76410b
|
7
|
+
data.tar.gz: 0e2d09f5a9c45d550d7a0e9c15ea8012e8cad464bd4a1d9d7e1dc7c7f50751f8911d4622dc785e3bf8895e3b848b2f00e3c867f3708a76ebe4437ca68071e51b
|
data/lib/sauce/connect.rb
CHANGED
@@ -29,6 +29,10 @@ module Sauce
|
|
29
29
|
if @config.access_key.nil?
|
30
30
|
raise ArgumentError, "Access key required to launch Sauce Connect. Please set the environment variable $SAUCE_ACCESS_KEY"
|
31
31
|
end
|
32
|
+
|
33
|
+
if @sc4_executable.nil?
|
34
|
+
raise TunnelNotPossibleException, Sauce::Connect.plzGetSC4
|
35
|
+
end
|
32
36
|
end
|
33
37
|
|
34
38
|
def ensure_connection_is_possible
|
@@ -54,7 +58,6 @@ module Sauce
|
|
54
58
|
$stderr.puts Sauce::Connect.port_not_open_message
|
55
59
|
raise TunnelNotPossibleException, "Couldn't use port 443"
|
56
60
|
end
|
57
|
-
|
58
61
|
end
|
59
62
|
|
60
63
|
def connect
|
@@ -62,63 +65,54 @@ module Sauce
|
|
62
65
|
ensure_connection_is_possible
|
63
66
|
end
|
64
67
|
|
65
|
-
|
66
|
-
puts "[Sauce Connect is connecting to Sauce Labs...]"
|
68
|
+
puts "[Sauce Connect is connecting to Sauce Labs...]"
|
67
69
|
|
68
|
-
|
70
|
+
formatted_cli_options = array_of_formatted_cli_options_from_hash(cli_options)
|
69
71
|
|
70
|
-
|
71
|
-
|
72
|
-
command_args = ['-u', @config.username, '-k', @config.access_key]
|
73
|
-
else
|
74
|
-
command_args = [@config.username, @config.access_key]
|
75
|
-
end
|
72
|
+
command_args = ['-u', @config.username, '-k', @config.access_key]
|
73
|
+
command_args << formatted_cli_options
|
76
74
|
|
77
|
-
|
78
|
-
command = "exec #{connect_command} #{command_args.join(' ')} 2>&1"
|
75
|
+
command = "exec #{find_sauce_connect} #{command_args.join(' ')} 2>&1"
|
79
76
|
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
77
|
+
unless @quiet
|
78
|
+
string_arguments = formatted_cli_options.join(' ')
|
79
|
+
puts "[Sauce Connect arguments: '#{string_arguments}' ]"
|
80
|
+
end
|
84
81
|
|
85
|
-
|
82
|
+
@pipe = IO.popen(command)
|
86
83
|
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
end
|
84
|
+
@process_status = $?
|
85
|
+
at_exit do
|
86
|
+
Process.kill("INT", @pipe.pid)
|
87
|
+
while @ready
|
88
|
+
sleep 1
|
93
89
|
end
|
90
|
+
end
|
94
91
|
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
end
|
107
|
-
if line =~ /== Missing requirements ==/
|
108
|
-
@error = "Missing requirements"
|
109
|
-
@quiet = false
|
110
|
-
end
|
111
|
-
if line =~/Invalid API_KEY provided/
|
112
|
-
@error = "Invalid API_KEY provided"
|
113
|
-
@quiet = false
|
114
|
-
end
|
115
|
-
$stderr.puts line unless @quiet
|
92
|
+
Thread.new {
|
93
|
+
while( (line = @pipe.gets) )
|
94
|
+
if line =~ /Tunnel remote VM is (.*) (\.\.|at)/
|
95
|
+
@status = $1
|
96
|
+
end
|
97
|
+
if line =~/You may start your tests\./i
|
98
|
+
@ready = true
|
99
|
+
end
|
100
|
+
if line =~ /- (Problem.*)$/
|
101
|
+
@error = $1
|
102
|
+
@quiet = false
|
116
103
|
end
|
117
|
-
|
104
|
+
if line =~ /== Missing requirements ==/
|
105
|
+
@error = "Missing requirements"
|
106
|
+
@quiet = false
|
107
|
+
end
|
108
|
+
if line =~/Invalid API_KEY provided/
|
109
|
+
@error = "Invalid API_KEY provided"
|
110
|
+
@quiet = false
|
111
|
+
end
|
112
|
+
$stderr.puts line unless @quiet
|
113
|
+
end
|
114
|
+
@ready = false
|
118
115
|
}
|
119
|
-
else
|
120
|
-
raise "Java doesn't seem to be installed. Sauce Connect requires a working install of Java to proceed."
|
121
|
-
end
|
122
116
|
end
|
123
117
|
|
124
118
|
def cli_options
|
@@ -139,7 +133,7 @@ module Sauce
|
|
139
133
|
|
140
134
|
if !@ready
|
141
135
|
error_message = "Sauce Connect failed to connect after #{@timeout} seconds"
|
142
|
-
error_message << "\n(Using Sauce Connect at #{@sc4_executable}"
|
136
|
+
error_message << "\n(Using Sauce Connect at #{@sc4_executable}"
|
143
137
|
raise error_message
|
144
138
|
end
|
145
139
|
end
|
@@ -153,42 +147,24 @@ module Sauce
|
|
153
147
|
end
|
154
148
|
end
|
155
149
|
|
156
|
-
# Check the
|
157
|
-
# Returns true only if the path exists and is executable by the
|
158
|
-
# effective current user.
|
150
|
+
# Check whether the path, or it's bin/sc descendant, exists and is executable
|
159
151
|
def find_sauce_connect
|
160
|
-
|
161
|
-
File.absolute_path @sc4_executable
|
162
|
-
else
|
163
|
-
File.expand_path(File.dirname(__FILE__) + '/../../support/Sauce-Connect.jar')
|
164
|
-
end
|
165
|
-
end
|
152
|
+
paths = [@sc4_executable, File.join("#{@sc4_executable}", "bin", "sc")]
|
166
153
|
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
end
|
154
|
+
sc_path = paths.find do |path|
|
155
|
+
path_is_connect_executable? path
|
156
|
+
end
|
171
157
|
|
172
|
-
|
173
|
-
|
174
|
-
unless @sc4_executable
|
175
|
-
"java -jar "
|
158
|
+
if sc_path.nil?
|
159
|
+
raise TunnelNotPossibleException, "No executable found at #{sc_path}, or it can't be executed by #{Process.euid}"
|
176
160
|
end
|
177
161
|
|
178
|
-
|
162
|
+
return File.absolute_path sc_path
|
179
163
|
end
|
180
164
|
|
181
165
|
def path_is_connect_executable? path
|
182
166
|
absolute_path = File.absolute_path path
|
183
|
-
|
184
|
-
if File.executable? absolute_path
|
185
|
-
true
|
186
|
-
else
|
187
|
-
raise TunnelNotPossibleException, "#{absolute_path} is not executable by #{Process.euid}"
|
188
|
-
end
|
189
|
-
else
|
190
|
-
raise TunnelNotPossibleException, "#{absolute_path} does not exist"
|
191
|
-
end
|
167
|
+
return (File.exist? absolute_path) && (File.executable? absolute_path) && !(Dir.exist? absolute_path)
|
192
168
|
end
|
193
169
|
|
194
170
|
# Global Sauce Connect-ness
|
@@ -216,20 +192,10 @@ module Sauce
|
|
216
192
|
def array_of_formatted_cli_options_from_hash(hash)
|
217
193
|
hash.collect do |key, value|
|
218
194
|
opt_name = key.to_s.gsub("_", "-")
|
219
|
-
|
220
|
-
if !@sc4_executable
|
221
|
-
"--#{opt_name}=#{value}"
|
222
|
-
else
|
223
|
-
"--#{opt_name} #{value}"
|
224
|
-
end
|
195
|
+
return "--#{opt_name} #{value}"
|
225
196
|
end
|
226
197
|
end
|
227
198
|
|
228
|
-
def java_is_present?
|
229
|
-
# This is nieve; Can we be better?
|
230
|
-
system 'java -version'
|
231
|
-
end
|
232
|
-
|
233
199
|
def self.port_not_open_message
|
234
200
|
<<-ENDLINE
|
235
201
|
Unable to connect to port 443 on saucelabs.com, which may interfere with
|
@@ -261,5 +227,16 @@ module Sauce
|
|
261
227
|
your Sauce.config block.
|
262
228
|
ENDLINE
|
263
229
|
end
|
230
|
+
|
231
|
+
def self.plzGetSC4
|
232
|
+
<<-ENDLINE
|
233
|
+
Using Sauce Connect 3 has been deprecated. Please set the :sauce_connect_4_executable
|
234
|
+
option in your Sauce.config block to the path of an installation of
|
235
|
+
Sauce Connect 4.
|
236
|
+
|
237
|
+
You can download Sauce Connect 4 for free at
|
238
|
+
http://docs.saucelabs.com/sauce_connect
|
239
|
+
ENDLINE
|
240
|
+
end
|
264
241
|
end
|
265
242
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sauce-connect
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- R. Tyler Croy
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2015-04-
|
14
|
+
date: 2015-04-27 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: sauce
|
@@ -27,7 +27,7 @@ dependencies:
|
|
27
27
|
- - "~>"
|
28
28
|
- !ruby/object:Gem::Version
|
29
29
|
version: '3.5'
|
30
|
-
description:
|
30
|
+
description: A wrapper to start and stop a Sauce Connect tunnel programatically.
|
31
31
|
email:
|
32
32
|
- tyler@monkeypox.org
|
33
33
|
executables: []
|
@@ -35,12 +35,16 @@ extensions: []
|
|
35
35
|
extra_rdoc_files: []
|
36
36
|
files:
|
37
37
|
- lib/sauce/connect.rb
|
38
|
-
|
39
|
-
homepage: ''
|
38
|
+
homepage: https://docs.saucelabs.com/reference/sauce-connect
|
40
39
|
licenses:
|
41
40
|
- Apache 2.0
|
42
41
|
metadata: {}
|
43
|
-
post_install_message:
|
42
|
+
post_install_message: |2
|
43
|
+
To use the Sauce Connect gem, you'll need to download the appropriate
|
44
|
+
Sauce Connect binary from https://docs.saucelabs.com/reference/sauce-connect
|
45
|
+
|
46
|
+
Then, set the 'sauce_connect_4_executable' key in your Sauce.config block, to
|
47
|
+
the path of the unzipped file's /bin/sc.
|
44
48
|
rdoc_options: []
|
45
49
|
require_paths:
|
46
50
|
- lib
|
@@ -54,11 +58,13 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
54
58
|
- - ">="
|
55
59
|
- !ruby/object:Gem::Version
|
56
60
|
version: '0'
|
57
|
-
requirements:
|
61
|
+
requirements:
|
62
|
+
- An account at http://www.saucelabs.com
|
63
|
+
- A working copy of Sauce Connect from https://docs.saucelabs.com/reference/sauce-connect
|
58
64
|
rubyforge_project:
|
59
65
|
rubygems_version: 2.2.2
|
60
66
|
signing_key:
|
61
67
|
specification_version: 4
|
62
|
-
summary:
|
68
|
+
summary: Manage Sauce Connect from within your tests
|
63
69
|
test_files: []
|
64
70
|
has_rdoc:
|
data/support/Sauce-Connect.jar
DELETED
Binary file
|