sauce_whisk 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YmIzOTdjOTU0M2IyNDIyOWE4YWRiZGIyYjdlNjY1ZTA5OTFjMWIxOQ==
4
+ OGZmYWI0OTdkOGZhN2Y4MTJlOGI3NmIwZDkwODA4MTBhZmViOTlmYg==
5
5
  data.tar.gz: !binary |-
6
- YThkYzRhMTNiNTk5MTYwYTlmZTc0MzBlOTliMTQzMmJjNTk0ODgwNA==
6
+ MTMzNDg5Y2Q5YjdjNjlkMWIwZDNkZTBjNDc2Y2FhYzhmODIxZmQ4MA==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- M2MwNWVkNTk0YzI0N2NmMmUxZGZmOTJjMDFjNmY2NmE0OTc1OWFjNjgyMDc5
10
- ZWI3ZDE2ZTNiMzdhYTNkMmYzMWFjMTE4YzdlNjZhOWFhMzZhN2NlZTdkMzk0
11
- MTViZjZiMWM3MDkyMDViMWEzZWYxOTBlM2YwZThlZDNhMzZiMDY=
9
+ ZmVlZjYzMDY5YjUwYzE2ZDBjMTc5OGZhN2Y1Njk3MjUyODk2NTgyZDBkM2Nk
10
+ ZjdlYTBiODc1OTFkNGVmOGYxNGYyMjBiZmE4ODVjOWFhOTMxMjE0MjQ4MGE3
11
+ MWM5YWE5MTU5NGEyOWU3ODNhZTA1NDUyNGZmYmZhYWRmNDQ3Nzc=
12
12
  data.tar.gz: !binary |-
13
- NmEwZjAzMDc2MDk1NTNjYTVkNDFjYmQ1NzE1Mzg0YjE5ZDVhODNiYWU1NmI2
14
- NGJhZmY3MTFkN2M1ZjQ0NjhhYTg0YjQyOThhM2U3ZmI2ZTUwOGY5NzVmOWNm
15
- ZmJkOTQwZGE4ZjE0NTgwYzI0NjNmMDExZTZjOGE2ZWIwMWQ3ZTQ=
13
+ NWUwYjk5MjJjYzE0MGY4MzliODhhZGIwMGZhZThlYzNiYTEzZmY1ZTQxMjM2
14
+ OGE1MDE2MGNiZjIyYzk5NzNlMjA2OGEzMDhkYjA4NGY0YzNiZTk4Y2IwN2Y0
15
+ OTEwMDI1N2Q2MGM5ZWEyYjFjYzQzMTg3OGI1ZTU2MTU3NTVhOTU=
data/README.md CHANGED
@@ -87,6 +87,16 @@ There are three types of asset for Sauce Labs jobs: screenshots, video and logs.
87
87
  video = job.video # A single Asset, holding the video
88
88
  ```
89
89
 
90
+ ### Logger
91
+
92
+ You can set a custom logger object, passing anything that responds to puts:
93
+
94
+ ```ruby
95
+ SauceWhisk.logger = my_logger
96
+ ```
97
+
98
+ SauceWhisk.logger defaults to STDOUT.
99
+
90
100
  ## Contributing
91
101
 
92
102
  1. Fork it
@@ -20,4 +20,12 @@ module SauceWhisk
20
20
  def self.pass_job(job_id)
21
21
  Jobs.pass_job job_id
22
22
  end
23
+
24
+ def self.logger=(logger)
25
+ @logger = logger
26
+ end
27
+
28
+ def self.logger
29
+ @logger||= STDOUT
30
+ end
23
31
  end
@@ -17,6 +17,8 @@ module SauceWhisk
17
17
 
18
18
  def self.change_status(job_id, status)
19
19
  put job_id, {"passed" => status}.to_json
20
+ rescue e
21
+ SauceWhisk.logger "Unable to change_status for #{job_id} to #{status}\nReason: #{e.to_s}"
20
22
  end
21
23
 
22
24
  def self.pass_job(job_id)
@@ -1,3 +1,3 @@
1
1
  module SauceWhisk
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -24,4 +24,20 @@ describe SauceWhisk do
24
24
  SauceWhisk.pass_job job_id
25
25
  end
26
26
  end
27
+
28
+ describe "##logger" do
29
+ it "accepts a logger object" do
30
+ dummy_logger = Object.new do
31
+ def puts(input)
32
+ end
33
+ end
34
+ SauceWhisk.logger = dummy_logger
35
+ SauceWhisk.logger.should be dummy_logger
36
+ end
37
+
38
+ it "defaults to STDIN" do
39
+ SauceWhisk.logger = nil
40
+ SauceWhisk.logger.should be STDOUT
41
+ end
42
+ end
27
43
  end
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.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dylan Lacey
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-06-01 00:00:00.000000000 Z
11
+ date: 2013-06-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client