ms_header_trail 0.1.1 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f6bc222d2e57099d4d6e318372f496e58a1bf549e0becf485b2fe11f5af0e9f2
4
- data.tar.gz: da9b2a4f6fc1976441e305201801b9d34ffab86a21d156f614e9e84a052c3d96
3
+ metadata.gz: e50f67baf8272084c90750b118a1f359c73c0b4e5449970d355be9600d3ff62a
4
+ data.tar.gz: f6eac97b73cf3debb3bd217cb7c506a48aca92e8e684c1a6a53223c92b78eb87
5
5
  SHA512:
6
- metadata.gz: 9c0471b0c4b26c6178a09dae300506d502af588b3fcb14d81ffcc027acb3b6f02249704779f16da4d95770c6e049278464a87e123c9fd6dd81f8236ef60b888d
7
- data.tar.gz: b4186c2f09842f5fefc6f53a75ab1edcf2c8c5d8b3478c8fc4ad5d848eac96a6cad1ab5f3d0c9e1ea8567d3c5a6c578491ff658669969292ec37ae2861b82abe
6
+ metadata.gz: 3aa6b704a71c78e110508b4f32a424dcf5cb515b908a10958fd2e96922c6f60ffef2765cfc254bfd19c862e9289404b9cbc1e3c1bbe6826c8096d0d2175ae306
7
+ data.tar.gz: e341ffb0e9ef3060d7d7146e882e5d1342a169e34e6de396fd1e33a5597542bb8db9aebf87100b798431001247890b60efec08aa443fff520a39792520be2a64
data/CHANGELOG.md CHANGED
@@ -1,6 +1,11 @@
1
1
  ## [Unreleased]
2
2
 
3
- ## [0.1.0] - 2024-06-04
3
+ ## [0.2.1] - 2024-06-04
4
+ - Allow to use ruby >= 2.4
4
5
 
6
+ ## [0.2.0] - 2024-06-04
7
+ - Allow to reset current thread values
8
+
9
+ ## [0.1.1] - 2024-06-04
5
10
  - Initial release
6
11
  - Process the data into headers and retrieve from header ENV
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module MsHeaderTrail
4
- VERSION = "0.1.1"
4
+ VERSION = "0.2.1"
5
5
  end
@@ -27,7 +27,7 @@ module MsHeaderTrail
27
27
  def retrieve
28
28
  Thread.current
29
29
  .keys
30
- .select { |key| key.start_with?(configuration.prefix_keyname) }
30
+ .select { |key| start_with?(key, configuration.prefix_keyname) }
31
31
  .each_with_object({}) { |key, memo| memo[configuration.from_store(key)] = get(key) }
32
32
  end
33
33
 
@@ -37,6 +37,14 @@ module MsHeaderTrail
37
37
  yield
38
38
  end
39
39
 
40
+ # Public: Reset values into current thread
41
+ def reset
42
+ Thread.current
43
+ .keys
44
+ .select { |key| start_with?(key, configuration.prefix_keyname) }
45
+ .each { |key| Thread.current[key] = nil }
46
+ end
47
+
40
48
  # Public: Retrieve the given key
41
49
  def get(key)
42
50
  Thread.current[key]
@@ -61,5 +69,11 @@ module MsHeaderTrail
61
69
  def configure
62
70
  yield configuration
63
71
  end
72
+
73
+ private
74
+
75
+ def start_with?(value, expected)
76
+ value.to_s.start_with?(expected)
77
+ end
64
78
  end
65
79
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ms_header_trail
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adriano Dadario
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-06-17 00:00:00.000000000 Z
11
+ date: 2024-06-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -24,6 +24,48 @@ dependencies:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '13.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '13.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '3.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '3.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rubocop
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '1.0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '1.0'
27
69
  description:
28
70
  email:
29
71
  - dadario@gmail.com
@@ -59,14 +101,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
59
101
  requirements:
60
102
  - - ">="
61
103
  - !ruby/object:Gem::Version
62
- version: 3.0.0
104
+ version: '2.4'
63
105
  required_rubygems_version: !ruby/object:Gem::Requirement
64
106
  requirements:
65
107
  - - ">="
66
108
  - !ruby/object:Gem::Version
67
109
  version: '0'
68
110
  requirements: []
69
- rubygems_version: 3.3.26
111
+ rubygems_version: 3.0.9
70
112
  signing_key:
71
113
  specification_version: 4
72
114
  summary: Transport collected data through HTTP header from microservices requests.