injest-client 0.1.7 → 0.1.8
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/README.md +4 -2
- data/lib/injest/configuration.rb +19 -5
- data/lib/injest/middleware.rb +0 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 537873778e69eb1891c08cd6f07d1d1a438dad7e16e2d3ce055858d8a1bb7f45
|
4
|
+
data.tar.gz: ce4241f6f40c171a8d5e47a931358d30fb099169d6da139b2145559c53629f90
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0b8ab0523bb1747ff28f558d2357c535bac33cae5170bcda0c667ef10f93444dc414c53a4d6426cfb95b992b80e9d9bc96300dda4e17299bd28d851201c468c2
|
7
|
+
data.tar.gz: a31278290f4a744026eb27507b29e22d030868c7b09f00d61774401b8183a962d8969f92f4567c9f513991e918efc8846eab3c41b467cf1852b0b025f0988873
|
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
|
data/lib/injest/configuration.rb
CHANGED
@@ -1,18 +1,32 @@
|
|
1
1
|
class Injest::Configuration
|
2
2
|
include Singleton
|
3
3
|
|
4
|
-
attr_reader :strategy,
|
5
|
-
|
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'
|
13
|
+
@strategy = ENV.fetch('INJEST_STRATEGY')
|
14
|
+
set_strategies
|
10
15
|
|
11
|
-
if
|
16
|
+
if @strategies.include?('push') || @strategies.include?('http')
|
12
17
|
@injest_root = ENV.fetch('INJEST_ROOT')
|
13
18
|
@injest_token = ENV.fetch('INJEST_JWT')
|
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
|
data/lib/injest/middleware.rb
CHANGED
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.
|
4
|
+
version: 0.1.8
|
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-
|
11
|
+
date: 2024-09-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sidekiq
|