status_cake 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.rdoc +8 -8
- data/VERSION +1 -1
- data/lib/status_cake/status_cake.rb +5 -0
- data/lib/status_cake/version.rb +1 -1
- data/spec/fixtures/vcr/retrieve_by_id.yml +47 -0
- data/spec/status_cake/status_cake_spec.rb +8 -0
- data/status_cake.gemspec +4 -3
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 54631854b22ce18d59ba60b7a63bcd7851b7704c
|
4
|
+
data.tar.gz: f4b449653d6c70d5870494dd40d6d6029566655d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 795cb752256910ee4a82a51077f0c9c4f622f88dbc46e7a7c880d1907b3d246ae8686b6b23367176b6bf38e31d080f961788e2b948333554395c94bb7e4f740b
|
7
|
+
data.tar.gz: 081cbbcac9510bd31cbcdcdf9a67da6fa6ff8ca8c23b365f84cdb19c2353e02625efa665f30329957e0192f260cc36c3b2aac71c3dca6662186bf6fbd1d9f90b
|
data/README.rdoc
CHANGED
@@ -6,14 +6,6 @@ StatusCake gem for Ruby. See the StatusCake API documentation at http://kb.stat
|
|
6
6
|
|
7
7
|
@sc = StatusCake.new(:username => 'username', :api_key => 'apikey')
|
8
8
|
|
9
|
-
== Logging
|
10
|
-
|
11
|
-
Override the debug_output, see Net::HTTP#set_debug_output for options.
|
12
|
-
|
13
|
-
class StatusCake
|
14
|
-
debug_output $stdout
|
15
|
-
end
|
16
|
-
|
17
9
|
=== Updating and Inserting Tests
|
18
10
|
|
19
11
|
response = @sc.update_test({
|
@@ -37,6 +29,14 @@ Please be aware that although filtering is supported on any criteria via the gem
|
|
37
29
|
@sc.pause_test(t)
|
38
30
|
@sc.unpause_test(t)
|
39
31
|
|
32
|
+
== Logging
|
33
|
+
|
34
|
+
Override the debug_output, see Net::HTTP#set_debug_output for options.
|
35
|
+
|
36
|
+
class StatusCake
|
37
|
+
debug_output $stdout
|
38
|
+
end
|
39
|
+
|
40
40
|
== License
|
41
41
|
|
42
42
|
Apache 2.0 License. See LICENSE.txt for further details.
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.1
|
@@ -16,6 +16,11 @@ class StatusCake
|
|
16
16
|
@auth = {'Username' => opts[:username], 'API' => opts[:api_key]}
|
17
17
|
end
|
18
18
|
|
19
|
+
def find(id)
|
20
|
+
@opts = {headers:@auth, query:{ 'TestID' => id }}
|
21
|
+
respond(self.class.get("/Tests/Details", @opts))
|
22
|
+
end
|
23
|
+
|
19
24
|
def tests(options={})
|
20
25
|
# Hash#slice w/o activesupport
|
21
26
|
query_opts = options.select { |k,v| SUPPORTED_QUERIES.index(k) }
|
data/lib/status_cake/version.rb
CHANGED
@@ -0,0 +1,47 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://www.statuscake.com/API/Tests/Details?TestID=170051
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
Username:
|
11
|
+
- <USER>
|
12
|
+
Api:
|
13
|
+
- <APIKEY>
|
14
|
+
response:
|
15
|
+
status:
|
16
|
+
code: 200
|
17
|
+
message: OK
|
18
|
+
headers:
|
19
|
+
Date:
|
20
|
+
- Tue, 10 Jun 2014 20:06:20 GMT
|
21
|
+
Server:
|
22
|
+
- LiteSpeed
|
23
|
+
Connection:
|
24
|
+
- close
|
25
|
+
X-Powered-By:
|
26
|
+
- PHP/5.4.9
|
27
|
+
Set-Cookie:
|
28
|
+
- PHPSESSID=4d7519cbc74b653b69a9b72f2f6e1b10; path=/
|
29
|
+
Expires:
|
30
|
+
- Thu, 19 Nov 1981 08:52:00 GMT
|
31
|
+
Cache-Control:
|
32
|
+
- no-store, no-cache, must-revalidate, post-check=0, pre-check=0
|
33
|
+
Pragma:
|
34
|
+
- no-cache
|
35
|
+
Content-Type:
|
36
|
+
- application/json
|
37
|
+
Content-Length:
|
38
|
+
- '455'
|
39
|
+
body:
|
40
|
+
encoding: UTF-8
|
41
|
+
string: '{"Method":"GET","TestID":170051,"TestType":"HTTP","Paused":true,"WebsiteName":"google.com","ContactGroup":"All
|
42
|
+
Sites","ContactID":10395,"Status":"Up","Uptime":100,"CheckRate":3600,"Timeout":60,"LogoImage":"","WebsiteHost":"","NodeLocations":[""],"FindString":"","DoNotFind":false,"LastTested":"2014-06-10
|
43
|
+
19:21:19","NextLocation":"DA5","Processing":false,"ProcessingState":"Finished
|
44
|
+
Logging","ProcessingOn":"DA11","DownTimes":"0","Sensitive":false}'
|
45
|
+
http_version:
|
46
|
+
recorded_at: Tue, 10 Jun 2014 20:06:24 GMT
|
47
|
+
recorded_with: VCR 2.9.2
|
@@ -33,6 +33,14 @@ describe StatusCake do
|
|
33
33
|
end
|
34
34
|
end
|
35
35
|
|
36
|
+
it 'should be able to retrieve a test by id' do
|
37
|
+
VCR.use_cassette('retrieve_by_id') do
|
38
|
+
test = subject.find(170051)
|
39
|
+
expect(test).not_to be_nil
|
40
|
+
expect(test['WebsiteName']).to eq('google.com')
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
36
44
|
it 'should be able to retrieve a test by name' do
|
37
45
|
VCR.use_cassette('retrieve_by_name') do
|
38
46
|
test = subject.tests('WebsiteName' => 'google.com', 'CUID' => '10395').first
|
data/status_cake.gemspec
CHANGED
@@ -2,16 +2,16 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: status_cake 0.1.
|
5
|
+
# stub: status_cake 0.1.1 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "status_cake"
|
9
|
-
s.version = "0.1.
|
9
|
+
s.version = "0.1.1"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib"]
|
13
13
|
s.authors = ["Charles Cooke"]
|
14
|
-
s.date = "2014-06-
|
14
|
+
s.date = "2014-06-10"
|
15
15
|
s.description = "Ruby gem for StatusCake API - supports basic functions on tests"
|
16
16
|
s.email = "charles@coupa.com"
|
17
17
|
s.extra_rdoc_files = [
|
@@ -35,6 +35,7 @@ Gem::Specification.new do |s|
|
|
35
35
|
"spec/fixtures/vcr/delete_test.yml",
|
36
36
|
"spec/fixtures/vcr/pause_test.yml",
|
37
37
|
"spec/fixtures/vcr/retrieve_all.yml",
|
38
|
+
"spec/fixtures/vcr/retrieve_by_id.yml",
|
38
39
|
"spec/fixtures/vcr/retrieve_by_name.yml",
|
39
40
|
"spec/fixtures/vcr/unpause_test.yml",
|
40
41
|
"spec/spec_helper.rb",
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: status_cake
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Charles Cooke
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-06-
|
11
|
+
date: 2014-06-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|
@@ -202,6 +202,7 @@ files:
|
|
202
202
|
- spec/fixtures/vcr/delete_test.yml
|
203
203
|
- spec/fixtures/vcr/pause_test.yml
|
204
204
|
- spec/fixtures/vcr/retrieve_all.yml
|
205
|
+
- spec/fixtures/vcr/retrieve_by_id.yml
|
205
206
|
- spec/fixtures/vcr/retrieve_by_name.yml
|
206
207
|
- spec/fixtures/vcr/unpause_test.yml
|
207
208
|
- spec/spec_helper.rb
|