exceptionhandler 0.0.3 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/exceptionhandler.rb +3 -3
- metadata +2 -22
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 412d919eea85891e9c7e7013e13f40c753c6edc8
|
4
|
+
data.tar.gz: c050defccfeb9353636dcbf9215a5319c3022c91
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 310ea00110a5261040bdbeb8c49be064c53839b1aa72600bc377980f54b1303fb79cedd174c1d145fc88acf9c3e85204ec91fdccf2da798a36aa6c78ab067fe5
|
7
|
+
data.tar.gz: a75b09616c998e1b35d3b45ad561af60a7615c1e0cd055b3a7e469b78f8a4fa8752658f35b6a9623c1510f76ae3b5625c484e464b5e4d34ef12ed5c033d5421e
|
data/lib/exceptionhandler.rb
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
require 'logger'
|
2
|
-
require 'unirest'
|
3
2
|
require 'httpclient'
|
4
3
|
|
5
4
|
|
@@ -9,8 +8,9 @@ class ExceptionHandler
|
|
9
8
|
#Get the cluster name from Google metadata service
|
10
9
|
cluster_name="unknown_cluster"
|
11
10
|
begin
|
12
|
-
|
13
|
-
|
11
|
+
clnt = HTTPClient.new()
|
12
|
+
response = clnt.get "http://metadata.google.internal/computeMetadata/v1/instance/attributes/cluster-name", nil, "Metadata-Flavor" => "Google"
|
13
|
+
if response.status == 200
|
14
14
|
cluster_name=response.body
|
15
15
|
end
|
16
16
|
rescue
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: exceptionhandler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt Knox
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-05-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httpclient
|
@@ -30,26 +30,6 @@ dependencies:
|
|
30
30
|
- - ">="
|
31
31
|
- !ruby/object:Gem::Version
|
32
32
|
version: 2.8.2.2
|
33
|
-
- !ruby/object:Gem::Dependency
|
34
|
-
name: unirest
|
35
|
-
requirement: !ruby/object:Gem::Requirement
|
36
|
-
requirements:
|
37
|
-
- - "~>"
|
38
|
-
- !ruby/object:Gem::Version
|
39
|
-
version: '1.1'
|
40
|
-
- - ">="
|
41
|
-
- !ruby/object:Gem::Version
|
42
|
-
version: 1.1.2
|
43
|
-
type: :runtime
|
44
|
-
prerelease: false
|
45
|
-
version_requirements: !ruby/object:Gem::Requirement
|
46
|
-
requirements:
|
47
|
-
- - "~>"
|
48
|
-
- !ruby/object:Gem::Version
|
49
|
-
version: '1.1'
|
50
|
-
- - ">="
|
51
|
-
- !ruby/object:Gem::Version
|
52
|
-
version: 1.1.2
|
53
33
|
description: Log exceptions in a log friendly way.
|
54
34
|
email: matt.knox@sphero.com
|
55
35
|
executables: []
|