sauce-connect 3.0.0 → 3.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. checksums.yaml +8 -8
  2. data/lib/sauce/connect.rb +23 -7
  3. metadata +7 -4
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MjZjOWEwOTZjZjcyMzFjMzliNGRkZDhmYjU4Y2M0YzIwN2VlZmYxYg==
4
+ NTQwNTgyNzgwZWRiZDllMmQ0OTEwYWY4ZmZhMmFiNTU3N2UwNDIxZA==
5
5
  data.tar.gz: !binary |-
6
- YzU1NjdmZWQwYWE4ZDAxMTc3NzZiMjA2NDBjNGVlOWY1Yzc1NmVkOQ==
6
+ OGUyZTU2ODIyMWI5ODc3ZmE1NmRmZTgzYzM5OGNhYzMyZjMxYzVjMw==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- OWQwZjgzMTBmZWJjNjMwMmUxNTU0YTQ0ZTZlNTI5ZjllZjc3NDJmYmIyMWQ3
10
- NWZhZmNkYWVlNDhkYWM3ZWIyZmRlYTBhMWE0OTE1ODdmY2NjNzkzMGIwMTky
11
- NjNjN2Y1NDk1N2ZkZWI5ZDE1OGU4MWQ4OTlkODYyN2UyNGE3NDI=
9
+ Y2ZkY2QzZWJlOTY0MTcxYzNhZGJjMDFkMGRmNTM1NzkyYmU5ZjBjMTE4Yjlm
10
+ OThlMjYwZGIyNzEzNTAxZDk1YzlmYTFmYTEwNGVmOGUxYTIyMDIxODBkYjNk
11
+ ZDk3MzdiYjg4N2Y1NzU4YzczZDk0YmI0MmYzZjI1MDMzODc5ZjU=
12
12
  data.tar.gz: !binary |-
13
- ZjdmZGY0NzBhZjM1NjAxNTUzZTczYTY4ZDhlNjg3YWFlZjE4M2M1Mzc1ODZh
14
- NjQ2MGRmYjlhNTkzYmYyMTYwZTcxYmY3NTQxZDkzNjVmMjA2ODA5ZmFiYTlh
15
- NjBkNzUwY2FiZjlkMTcyNWU5MjNhM2Y0NzAxNWNkNWViZmVlNjc=
13
+ ZGI3ZDBiNzM1YzA5ZmE1MGM1M2M0OWFjMWE5NTUwYjhlZGRjOTJmYjcwOGI0
14
+ ZDMyZWU4NzQwY2I5N2ZkYTk3N2UwMTNjZTJhM2JhOGE0MGE3ZDhlMjU5YjIx
15
+ NWFlYTJiNDRlM2M2NGE2YTBkNjBiYTIyMzI2YmNmNTk4ZGFlZDA=
data/lib/sauce/connect.rb CHANGED
@@ -11,16 +11,12 @@ module Sauce
11
11
  @status = "uninitialized"
12
12
  @error = nil
13
13
  @quiet = options[:quiet]
14
- host = options[:host] || '127.0.0.1'
15
- port = options[:port] || '3000'
16
- tunnel_port = options[:tunnel_port] || '80'
17
- options.delete(:host)
18
- options.delete(:port)
19
- options.delete(:tunnel_port)
20
14
  @config = Sauce::Config.new(options)
15
+
21
16
  if @config.username.nil?
22
17
  raise ArgumentError, "Username required to launch Sauce Connect. Please set the environment variable $SAUCE_USERNAME"
23
18
  end
19
+
24
20
  if @config.access_key.nil?
25
21
  raise ArgumentError, "Access key required to launch Sauce Connect. Please set the environment variable $SAUCE_ACCESS_KEY"
26
22
  end
@@ -28,7 +24,12 @@ module Sauce
28
24
 
29
25
  def connect
30
26
  puts "[Connecting to Sauce Labs...]"
31
- @pipe = IO.popen("exec #{Sauce::Connect.connect_command} #{@config.username} #{@config.access_key} -f sauce_connect.ready 2>&1")
27
+
28
+ formatted_cli_options = array_of_formatted_cli_options_from_hash(cli_options)
29
+ command_args = [@config.username, @config.access_key] + formatted_cli_options
30
+ command = "exec #{Sauce::Connect.connect_command} #{command_args.join(' ')} 2>&1"
31
+ @pipe = IO.popen(command)
32
+
32
33
  @process_status = $?
33
34
  at_exit do
34
35
  Process.kill("INT", @pipe.pid)
@@ -61,6 +62,12 @@ module Sauce
61
62
  }
62
63
  end
63
64
 
65
+ def cli_options
66
+ cli_options = { readyfile: "sauce_connect.ready" }
67
+ cli_options.merge!(@config[:connect_options]) if @config.has_key?(:connect_options)
68
+ cli_options
69
+ end
70
+
64
71
  def wait_until_ready
65
72
  start = Time.now
66
73
  while !@ready and (Time.now-start) < TIMEOUT and @error != "Missing requirements"
@@ -112,5 +119,14 @@ module Sauce
112
119
  connect!(*args)
113
120
  end
114
121
  end
122
+
123
+ private
124
+
125
+ def array_of_formatted_cli_options_from_hash(hash)
126
+ hash.collect do |key, value|
127
+ opt_name = key.to_s.gsub("_", "-")
128
+ "--#{opt_name}=#{value}"
129
+ end
130
+ end
115
131
  end
116
132
  end
metadata CHANGED
@@ -1,14 +1,17 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sauce-connect
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0
4
+ version: 3.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - R. Tyler Croy
8
+ - Steve Hazel
9
+ - Dylan Lacey
10
+ - Rick Martínez
8
11
  autorequire:
9
12
  bindir: bin
10
13
  cert_chain: []
11
- date: 2013-06-02 00:00:00.000000000 Z
14
+ date: 2013-07-19 00:00:00.000000000 Z
12
15
  dependencies:
13
16
  - !ruby/object:Gem::Dependency
14
17
  name: sauce
@@ -16,14 +19,14 @@ dependencies:
16
19
  requirements:
17
20
  - - ~>
18
21
  - !ruby/object:Gem::Version
19
- version: 3.0.0.beta.2
22
+ version: 3.0.6
20
23
  type: :runtime
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
24
27
  - - ~>
25
28
  - !ruby/object:Gem::Version
26
- version: 3.0.0.beta.2
29
+ version: 3.0.6
27
30
  description: ''
28
31
  email:
29
32
  - tyler@monkeypox.org