sauce 0.19.0 → 0.19.1

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -40,8 +40,6 @@ rescue LoadError
40
40
  end
41
41
  end
42
42
 
43
- task :default => :test
44
-
45
43
  require 'rake/rdoctask'
46
44
  Rake::RDocTask.new do |rdoc|
47
45
  version = File.exist?('VERSION') ? File.read('VERSION') : ""
@@ -56,6 +54,30 @@ task :build do
56
54
  system "gem build sauce.gemspec"
57
55
  end
58
56
 
59
- task :push => :build do
57
+ desc 'Release gem to rubygems.org'
58
+ task :release => :build do
60
59
  system "gem push `ls *.gem | sort | tail -n 1`"
61
60
  end
61
+
62
+ desc 'tag current version'
63
+ task :tag do
64
+ version = nil
65
+ File.open("sauce.gemspec").each do |line|
66
+ if line =~ /s.version = "(.*)"/
67
+ version = $1
68
+ end
69
+ end
70
+
71
+ if version.nil?
72
+ raise "Couldn't find version"
73
+ end
74
+
75
+ system "git tag v#{version}"
76
+ end
77
+
78
+ desc 'push to github'
79
+ task :push do
80
+ system "git push origin master --tags"
81
+ end
82
+
83
+ task :default => [:tag, :release, :push]
data/lib/sauce/connect.rb CHANGED
@@ -15,6 +15,12 @@ module Sauce
15
15
  options.delete(:port)
16
16
  options.delete(:tunnel_port)
17
17
  config = Sauce::Config.new(options)
18
+ if config.username.nil?
19
+ raise ArgumentError, "Username required to launch Sauce Connect. Please set the environment variable $SAUCE_USERNAME"
20
+ end
21
+ if config.access_key.nil?
22
+ raise ArgumentError, "Access key required to launch Sauce Connect. Please set the environment variable $SAUCE_ACCESS_KEY"
23
+ end
18
24
  args = ['-u', config.username, '-k', config.access_key, '-s', host, '-p', port, '-d', config.domain, '-t', tunnel_port]
19
25
  @pipe = IO.popen((["exec", "\"#{Sauce::Connect.find_sauce_connect}\""] + args + ["2>&1"]).join(' '))
20
26
  @process_status = $?
data/sauce.gemspec CHANGED
@@ -2,11 +2,11 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{sauce}
5
- s.version = "0.19.0"
5
+ s.version = "0.19.1"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Eric Allen", "Sean Grove", "Steven Hazel"]
9
- s.date = %q{2011-03-25}
9
+ s.date = %q{2011-03-26}
10
10
  s.default_executable = %q{sauce}
11
11
  s.description = %q{A Ruby interface to Sauce Labs' services. Start/stop tunnels, retrieve Selenium logs, access video replays, etc.}
12
12
  s.email = %q{help@saucelabs.com}
data/test/test_connect.rb CHANGED
@@ -19,4 +19,26 @@ class TestConnect < Test::Unit::TestCase
19
19
  assert connect.error
20
20
  connect.disconnect
21
21
  end
22
+
23
+ def test_fails_fast_with_no_username
24
+ Sauce.config {|config|}
25
+ username = ENV['SAUCE_USERNAME']
26
+ access_key = ENV['SAUCE_ACCESS_KEY']
27
+
28
+ begin
29
+ ENV['SAUCE_USERNAME'] = nil
30
+ assert_raises ArgumentError do
31
+ connect = Sauce::Connect.new(:host => "saucelabs.com", :port => 80)
32
+ end
33
+
34
+ ENV['SAUCE_USERNAME'] = username
35
+ ENV['SAUCE_ACCESS_KEY'] = nil
36
+ assert_raises ArgumentError do
37
+ connect = Sauce::Connect.new(:host => "saucelabs.com", :port => 80)
38
+ end
39
+ ensure
40
+ ENV['SAUCE_USERNAME'] = username
41
+ ENV['SAUCE_ACCESS_KEY'] = access_key
42
+ end
43
+ end
22
44
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sauce
3
3
  version: !ruby/object:Gem::Version
4
- hash: 83
4
+ hash: 81
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 19
9
- - 0
10
- version: 0.19.0
9
+ - 1
10
+ version: 0.19.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Eric Allen
@@ -17,7 +17,7 @@ autorequire:
17
17
  bindir: bin
18
18
  cert_chain: []
19
19
 
20
- date: 2011-03-25 00:00:00 -07:00
20
+ date: 2011-03-26 00:00:00 -07:00
21
21
  default_executable: sauce
22
22
  dependencies:
23
23
  - !ruby/object:Gem::Dependency