exceptionhandler 0.0.3 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/exceptionhandler.rb +3 -3
  3. metadata +2 -22
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: dc49633e85b1a22d5d4fa05de6857ea6ab74ae35
4
- data.tar.gz: eb30e8ad44ecd02e4034143825187eade59af88c
3
+ metadata.gz: 412d919eea85891e9c7e7013e13f40c753c6edc8
4
+ data.tar.gz: c050defccfeb9353636dcbf9215a5319c3022c91
5
5
  SHA512:
6
- metadata.gz: c8ea1915282ca3deb70b302450d34ba7c29d959581e3a3c3e102d5c5d68f1452b6fe3c81973573d7da9edfbeaf7fa33e72af0ce8cf566c763af5a644ff1718b1
7
- data.tar.gz: 383b6eb62a2984a278a08d7e48f75dece6cd49a266bf66b49dd32e20758e4a9eb40e2d7169625ff7b7a22af0f66b80880c1867ff017850f834c5e50a00ced368
6
+ metadata.gz: 310ea00110a5261040bdbeb8c49be064c53839b1aa72600bc377980f54b1303fb79cedd174c1d145fc88acf9c3e85204ec91fdccf2da798a36aa6c78ab067fe5
7
+ data.tar.gz: a75b09616c998e1b35d3b45ad561af60a7615c1e0cd055b3a7e469b78f8a4fa8752658f35b6a9623c1510f76ae3b5625c484e464b5e4d34ef12ed5c033d5421e
@@ -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
- response = Unirest.get('http://metadata.google.internal/computeMetadata/v1/instance/attributes/cluster-name',headers:{ "Metadata-Flavor" => "Google"})
13
- if response.code == 200
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.3
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: 2016-06-13 00:00:00.000000000 Z
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: []