chef-telemetry 1.0.5 → 1.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/chef/telemetry/client.rb +12 -3
- data/lib/chef/telemetry/version.rb +1 -1
- metadata +2 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9f2ff4beb037d29b86146839a762c60921a201762c1d1d747df5c19ba3c244b0
|
4
|
+
data.tar.gz: 24c6da8c811b432061f122c9574a6defdcc432f8228db2aae6fcf98a301d36db
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 54e5b9ba49b785a70db72c9d03a7ceadf4a52f1f78c3fb6be191e43494c022a98fe905bea220f5e962f784a30daca4b8ce94921ccc1f367fb91a9050837efe66
|
7
|
+
data.tar.gz: 8806715da530362fe23e6ae512b9455aa5e13115476a5e749f593a4ff19cda706322859818e047573ad0410a46afdb6e1af64318a30f42fcdcbe31c8aa7e6845
|
@@ -1,4 +1,6 @@
|
|
1
|
-
require "http"
|
1
|
+
require "net/http"
|
2
|
+
require "uri"
|
3
|
+
require "json"
|
2
4
|
require "concurrent"
|
3
5
|
|
4
6
|
class Chef
|
@@ -11,11 +13,18 @@ class Chef
|
|
11
13
|
attr_reader :http
|
12
14
|
def initialize(endpoint = TELEMETRY_ENDPOINT)
|
13
15
|
super()
|
14
|
-
|
16
|
+
uri = URI(endpoint)
|
17
|
+
@http = Net::HTTP.new(uri.host, uri.port)
|
18
|
+
@http.use_ssl = uri.scheme == "https"
|
19
|
+
@http.start
|
15
20
|
end
|
16
21
|
|
17
22
|
def fire(event)
|
18
|
-
|
23
|
+
req = Net::HTTP::Post.new("/events")
|
24
|
+
req["Content-Type"] = "application/json"
|
25
|
+
req.body = JSON.dump(event)
|
26
|
+
# TODO: @cwolfe use response and at least debug log status
|
27
|
+
http.request req
|
19
28
|
end
|
20
29
|
end
|
21
30
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chef-telemetry
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chef Software, Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-05-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -24,20 +24,6 @@ dependencies:
|
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: http
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - "~>"
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '4'
|
34
|
-
type: :runtime
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - "~>"
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '4'
|
41
27
|
- !ruby/object:Gem::Dependency
|
42
28
|
name: ffi-yajl
|
43
29
|
requirement: !ruby/object:Gem::Requirement
|