injest-client 0.1.7 → 0.1.9

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: 0d0693548127e95424b8163d5b76979759d60ab69360b48d97aa902bc6a4bf9b
4
- data.tar.gz: 33337fa8f25784efc17e309945a309433b5b73441d18bb713a1df16f89dadfd3
3
+ metadata.gz: 2b57869bc0a018753b1ed29e5103992002f0812b853f76ab76c476499ec8a7a8
4
+ data.tar.gz: ddc8956a96d0e1b36eb7374e942f2da41c15f72e2c2fac625c23d5c4daaf12c1
5
5
  SHA512:
6
- metadata.gz: d167f7a7baa9d1762bdf7cdff253c5bb12010c9a2c96b5e8ce4fd9666f8705b663d7fb845dda00a1e764689a1ee654068209a2b83635d3a09f976ce175c6e977
7
- data.tar.gz: 1a6d1bb5f865c30a794273133fea236d05e6d7c22c1845ff05a05ae5d7b583c664c6f8de0482387e6c4ad1d2e253b045230873e40e70c5313732e3c5ec90f318
6
+ metadata.gz: 762dbd7602b47c7dfb36ee406aa2bc809c71e68b135af239d3355ce6e5b8b456d1ca5982ecdb4e026b692993d579517b4357a7753748619b49c6c49679992d6b
7
+ data.tar.gz: fd50ffe8c9ad00292f0a58d2f004aedce40209e146cfb4458af99600e6573048efb672226ee0b2701496d0df85f883ca164411ab4ab527a3162bfa98ce7e320c
data/lib/README.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  ## Changelog
4
4
 
5
+ ### 0.1.8
6
+
7
+ - Fix bug in the configuration initialization which prevented the INJEST_ROOT and INJEST_JWT from being set correctly
8
+
5
9
  ### 0.1.7
6
10
 
7
11
  - Support multiple strategies via the `INJEST_STRATEGY` env var, example: `INJEST_STRATEGY="stdout,http"`
@@ -40,7 +44,5 @@ ENV vars
40
44
 
41
45
  ## TODO:
42
46
 
43
- - **use json output wich ideally should not depend on sidekiq**
44
-
45
47
  - Customization with procs
46
48
  - Tests: https://guides.rubygems.org/make-your-own-gem/#writing-tests
@@ -1,18 +1,32 @@
1
1
  class Injest::Configuration
2
2
  include Singleton
3
3
 
4
- attr_reader :strategy,
5
- :injest_root, :injest_token, :injest_client
4
+ attr_reader :strategy,
5
+ :strategies,
6
+ :injest_root,
7
+ :injest_token,
8
+ :injest_client
6
9
 
7
10
  private
11
+
8
12
  def initialize
9
- @strategy = ENV.fetch('INJEST_STRATEGY', 'stdout')
13
+ @strategy = ENV.fetch('INJEST_STRATEGY', 'null')
14
+ set_strategies
10
15
 
11
- if strategy == 'http' || strategy == 'push'
12
- @injest_root = ENV.fetch('INJEST_ROOT')
13
- @injest_token = ENV.fetch('INJEST_JWT')
16
+ if @strategies.include?('push') || @strategies.include?('http')
17
+ @injest_root = ENV.fetch('INJEST_ROOT', nil)
18
+ @injest_token = ENV.fetch('INJEST_JWT', nil)
14
19
  end
15
-
20
+
16
21
  @injest_client = ENV.fetch('INJEST_CLIENT', nil)
17
22
  end
23
+
24
+ def set_strategies
25
+ raw = @strategy
26
+ if raw == nil || raw == ''
27
+ @strategies = ['null']
28
+ else
29
+ @strategies = raw.split(',')
30
+ end
31
+ end
18
32
  end
@@ -43,7 +43,6 @@ class Injest::Middleware
43
43
  private
44
44
 
45
45
  def append(data)
46
- puts @configuration.inspect
47
46
  Injest::Writer.instance.append(data)
48
47
  end
49
48
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: injest-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stefano Lampis
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-07-22 00:00:00.000000000 Z
11
+ date: 2024-11-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sidekiq