sauce_whisk 0.1.0 → 0.2.0

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: db9f0babbf8cbbe03565ede8db3230015dfa07b0
4
- data.tar.gz: 157a7f2299699b214bda199308f6c263e0539b30
3
+ metadata.gz: 1e054d13b0187277b77496a400e4fc801cdbbfaa
4
+ data.tar.gz: 86c3c3b0421604c47ded59dfd13f325541ce86b8
5
5
  SHA512:
6
- metadata.gz: a04cc8f7d64626161af77960da9799cecd47a6f0936e7852471a3f520a93cf0d8ceecac6a238bc93bbf5be8fcc3ec756649e7b03befd46783a42985c46e405a1
7
- data.tar.gz: 3e507b7d68856d3c77fd992d01482d1516181e1feb44a89e7d3cac2f32fd5e8bd1cc5ff8b2f51ecf139507d31beb28306672ed4861a30459d28f6ba491815e71
6
+ metadata.gz: d841ca7bf1c4ac3a7bb9f3e651bdd3295c3a7512a3374a34aa8eb3a5f18226071899dc802054a3783ca8e0057089b2bc52cb5e3e1bcae5f03370db2519f353e0
7
+ data.tar.gz: 7b42821bb29b03c17dd8aa812a03c74f7305d665bb572697e3ce61481cb61d09d63ba9451f68879cb71c419982d4b062b2b537506d2774024b07843082173af1
data/README.md CHANGED
@@ -26,6 +26,14 @@ We recommend setting a hard version for now, as the gem is still kinda beta-y.
26
26
 
27
27
  You'll need a [Sauce Labs account](http://www.saucelabs.com/signup). They're free to try and, if you're an open source project, [your access is always free](http://saucelabs.com/opensauce).
28
28
 
29
+ ## Data Center
30
+ As Sauce Labs now has two data centers, you'll need to select the DC your account is located in.
31
+
32
+ Choose `:EU_VDC` for the European Data Center.
33
+ Choose `:US_VDC` for the US Data Center.
34
+
35
+ Read more about the data center options [here](https://wiki.saucelabs.com/display/DOCS/Accessing+the+API).
36
+
29
37
  ### Values
30
38
  | Value | ENV Variable | Meaning |
31
39
  |-------|--------------|---------|
@@ -33,13 +41,14 @@ You'll need a [Sauce Labs account](http://www.saucelabs.com/signup). They're fr
33
41
  |:access\_key | SAUCE\_ACCESS\_KEY| Your Access Key, found on the lower left of your Account page (Not your password!) |
34
42
  |:asset\_fetch\_retries | SAUCE\_ASSET\_FETCH\_RETRY | Number of times to retry fetching assets |
35
43
  |:rest_retries | SAUCE_REST_RETRIES | Number of times to try failing REST calls |
44
+ |:data_center | SAUCE_DATA_CENTER | Which Data Center to access |
36
45
 
37
46
 
38
47
  ### Locations
39
48
  There are four ways to configure SauceWhisk. The gem tries each of the following locations in turn. Note, Environment Variables are the preferred means of setting configuration.
40
49
 
41
50
  #### Directly on the SauceWhisk object
42
- `username`, `access_key`, `asset_fetch_retries` and `rest_retries` can be set directly on the SauceWhisk object:
51
+ `username`, `access_key`, `asset_fetch_retries`, `rest_retries` and `data_center` can be set directly on the SauceWhisk object:
43
52
  ```ruby
44
53
  SauceWhisk.username = 'some_rad_tester'
45
54
  SauceWhisk.asset_fetch_retries = 5
data/changelog.markdown CHANGED
@@ -1,4 +1,10 @@
1
1
  # Major Version 0
2
+ ## Minor Version 0.2
3
+ ### 0.2.0
4
+ * Added the ability to select between US & EU VDC
5
+ * Made US VDC the default endpoint
6
+ * Added Deprecation warning for using the default endpoint instead of specifying it
7
+
2
8
  ## Minor Version 0.1
3
9
  ### 0.1.0
4
10
  * Update REST_CLIENT and JSON libraries to allow them to place nicer with Ruby 2.4.x
data/lib/sauce_whisk.rb CHANGED
@@ -14,7 +14,7 @@ require 'logger'
14
14
  module SauceWhisk
15
15
 
16
16
  def self.base_url
17
- "https://saucelabs.com/rest/v1"
17
+ data_center == :US_VDC ? "https://saucelabs.com/rest/v1" : "https://eu-central-1.saucelabs.com/rest/v1"
18
18
  end
19
19
 
20
20
  def self.username= username
@@ -67,6 +67,35 @@ module SauceWhisk
67
67
  return 1
68
68
  end
69
69
 
70
+ def self.data_center
71
+ configured_dc = self.load_first_found(:data_center)
72
+
73
+ if configured_dc.nil?
74
+ logger.warn "[DEPRECATED] You have not selected a REST API Endpoint - using US by default. This behaviour is deprecated and will be removed in an upcoming version. Please select a data center as described here: https://github.com/saucelabs/sauce_whisk#data-center"
75
+ configured_dc = :US_VDC
76
+ end
77
+
78
+ validated_dc = validate_dc configured_dc
79
+ validated_dc
80
+ end
81
+
82
+ def self.data_center= dc
83
+ @data_center = validate_dc dc
84
+ end
85
+
86
+ def self.validate_dc dc
87
+ dc = :eu_vdc if dc == :eu
88
+ dc = :us_vdc if dc == :us
89
+
90
+ ucdc = dc.to_s.upcase.to_sym
91
+
92
+ if ![:EU_VDC, :US_VDC].include? ucdc
93
+ raise ::ArgumentError.new("Invalid data center requested: #{ucdc}. Value values are :eu_vdc and :us_vdc.")
94
+ end
95
+
96
+ @data_center = ucdc
97
+ end
98
+
70
99
  def self.pass_job(job_id)
71
100
  Jobs.pass_job job_id
72
101
  end
@@ -1,3 +1,3 @@
1
1
  module SauceWhisk
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.0"
3
3
  end
data/test.rb ADDED
@@ -0,0 +1,6 @@
1
+ require "sauce_whisk"
2
+
3
+ SauceWhisk.data_center = :eu
4
+ SauceWhisk.logger.level = Logger::DEBUG
5
+
6
+ SauceWhisk::Accounts.concurrency_for "dylanatsauce"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sauce_whisk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dylan Lacey
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-04-20 00:00:00.000000000 Z
11
+ date: 2019-04-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client
@@ -122,7 +122,8 @@ files:
122
122
  - lib/sauce_whisk/tunnels.rb
123
123
  - lib/sauce_whisk/version.rb
124
124
  - lib/saucewhisk.rb
125
- homepage: http://www.github.com/dylanlacey/sauce_whisk
125
+ - test.rb
126
+ homepage: http://www.github.com/saucelabs/sauce_whisk
126
127
  licenses:
127
128
  - MIT
128
129
  metadata: {}