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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fe285ae92d66faa2dd75811848c19a3f2822154ac843289022623159ebaa9fd6
4
- data.tar.gz: a1a75c68b07739500005ba57fe69d617b8d6d3d05caaca2496d7ec48a2edd777
3
+ metadata.gz: 4e7520c1394694294d1fdbab00367c3dec3c01e436b3773778d6ac03fcdb5ef7
4
+ data.tar.gz: 4155476a6632f309539487b271cb149fb7642062fb2ad83f85db87a7e84f4da6
5
5
  SHA512:
6
- metadata.gz: 8ce15a43687eb8602a50071b27f73dde7ab39eb59afb4433f120d7637007f73d2164d53c63066e13968ddb93d0a6e9252032add720fa7e0a877b50f54446287c
7
- data.tar.gz: 79604e4f914721f4333437c172b6eb3c67961468715037a8e50b55f8d1320793e5d0963ce48ebbd5281e27b46ade426cf291a44a5328e34edc810559e15055a2
6
+ metadata.gz: a88845ef7751dcddef46437ee1af4e3c87c101b42dc90c8d5ed3d5c08cbeebb3a3980680c5ead1ec3afd2912b65473768a5d53130f00c0427046a4c641a48fbb
7
+ data.tar.gz: 2290df53217c14638ef852e1584e0649532d24442454682a3407c4c790c6d434b6701ddea6b8fb80d6d20e6be25e5782001f9d778e0d724682aa2557487c016f
@@ -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: { 'Content-Type' => 'application/json' },
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?
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Eltesla
4
+ # Client for the Eltesla backend
5
+ class Configuration
6
+ class << self
7
+ attr_accessor :api_key
8
+ end
9
+ end
10
+ end
11
+
@@ -1,3 +1,3 @@
1
1
  module Eltesla
2
- VERSION = '0.0.2'
2
+ VERSION = '0.1.0'
3
3
  end
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.2
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