eltesla 0.0.2 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/eltesla/client.rb +4 -2
- data/lib/eltesla/configuration.rb +11 -0
- data/lib/eltesla/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4e7520c1394694294d1fdbab00367c3dec3c01e436b3773778d6ac03fcdb5ef7
|
4
|
+
data.tar.gz: 4155476a6632f309539487b271cb149fb7642062fb2ad83f85db87a7e84f4da6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a88845ef7751dcddef46437ee1af4e3c87c101b42dc90c8d5ed3d5c08cbeebb3a3980680c5ead1ec3afd2912b65473768a5d53130f00c0427046a4c641a48fbb
|
7
|
+
data.tar.gz: 2290df53217c14638ef852e1584e0649532d24442454682a3407c4c790c6d434b6701ddea6b8fb80d6d20e6be25e5782001f9d778e0d724682aa2557487c016f
|
data/lib/eltesla/client.rb
CHANGED
@@ -4,7 +4,6 @@ require 'httparty'
|
|
4
4
|
require 'uri'
|
5
5
|
require 'json'
|
6
6
|
|
7
|
-
# rb(main):004> HTTParty.post('https://eltesla.dev/metrics', body: { results: []}.to_json, headers: { 'Content-Type' => 'application/json' })
|
8
7
|
module Eltesla
|
9
8
|
# Client for the Eltesla backend
|
10
9
|
class Client
|
@@ -53,7 +52,10 @@ module Eltesla
|
|
53
52
|
def http_post!
|
54
53
|
result = HTTParty.post(
|
55
54
|
'https://eltesla.dev/metrics',
|
56
|
-
headers: {
|
55
|
+
headers: {
|
56
|
+
'Content-Type' => 'application/json',
|
57
|
+
'X-API-Key' => Eltesla::Configuration.api_key || raise('Missing API KEY')
|
58
|
+
},
|
57
59
|
body: { results: queue.map(&:to_h) }.to_json
|
58
60
|
)
|
59
61
|
return if result.success?
|
data/lib/eltesla/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: eltesla
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexandre Ignjatovic
|
@@ -46,6 +46,7 @@ extra_rdoc_files: []
|
|
46
46
|
files:
|
47
47
|
- lib/eltesla.rb
|
48
48
|
- lib/eltesla/client.rb
|
49
|
+
- lib/eltesla/configuration.rb
|
49
50
|
- lib/eltesla/experiment.rb
|
50
51
|
- lib/eltesla/observation.rb
|
51
52
|
- lib/eltesla/result.rb
|