ms_header_trail 0.2.0 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -1
- data/lib/ms_header_trail/version.rb +1 -1
- data/lib/ms_header_trail.rb +17 -9
- metadata +45 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b6f5b7d930f103822d5ab65e2ea7d10635002ea286dd7ab4ceffa8b00a2fe64c
|
4
|
+
data.tar.gz: e05ef826175b047c7550fdee630c4273bbc032886d9e899596a0b6f179786c00
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cf12574b911a2ccb5ea20983df7325f56618ddc8319b5bbe687d058ce417dc4f8f11e9b23c763f86c7b03c9167682a95c45d6c135213ae42b3b51eb59a675e1c
|
7
|
+
data.tar.gz: 4ee19e03f861239819ecb1575c10a9b7cb2e0e59be25cd4c98792055a2c844433af394ffbd3dfa3026f89bfa1dd02e13ae19b5b49f645710603c1ba6412fc561
|
data/CHANGELOG.md
CHANGED
data/lib/ms_header_trail.rb
CHANGED
@@ -25,24 +25,20 @@ module MsHeaderTrail
|
|
25
25
|
# Public: Retrive the stored parameters, which was set by user
|
26
26
|
# during the Rack middleware, faraday connection or manually
|
27
27
|
def retrieve
|
28
|
-
|
29
|
-
|
30
|
-
.select { |key| key.start_with?(configuration.prefix_keyname) }
|
31
|
-
.each_with_object({}) { |key, memo| memo[configuration.from_store(key)] = get(key) }
|
28
|
+
current_thread_data
|
29
|
+
.each_with_object({}) { |key, memo| memo[configuration.from_store(key)] = get(key) }
|
32
30
|
end
|
33
31
|
|
34
|
-
# Public: Execute a block code after data
|
32
|
+
# Public: Execute a block code after reset and collect data
|
35
33
|
def with(attributes)
|
34
|
+
reset
|
36
35
|
collect(attributes)
|
37
36
|
yield
|
38
37
|
end
|
39
38
|
|
40
39
|
# Public: Reset values into current thread
|
41
40
|
def reset
|
42
|
-
Thread.current
|
43
|
-
.keys
|
44
|
-
.select { |key| key.start_with?(configuration.prefix_keyname) }
|
45
|
-
.each { |key| Thread.current[key] = nil }
|
41
|
+
current_thread_data.each { |key| Thread.current[key] = nil }
|
46
42
|
end
|
47
43
|
|
48
44
|
# Public: Retrieve the given key
|
@@ -69,5 +65,17 @@ module MsHeaderTrail
|
|
69
65
|
def configure
|
70
66
|
yield configuration
|
71
67
|
end
|
68
|
+
|
69
|
+
private
|
70
|
+
|
71
|
+
def current_thread_data
|
72
|
+
Thread.current
|
73
|
+
.keys
|
74
|
+
.select { |key| start_with?(key, configuration.prefix_keyname) }
|
75
|
+
end
|
76
|
+
|
77
|
+
def start_with?(value, expected)
|
78
|
+
value.to_s.start_with?(expected)
|
79
|
+
end
|
72
80
|
end
|
73
81
|
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.2.
|
4
|
+
version: 0.2.2
|
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-
|
11
|
+
date: 2024-06-24 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,7 +101,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
59
101
|
requirements:
|
60
102
|
- - ">="
|
61
103
|
- !ruby/object:Gem::Version
|
62
|
-
version:
|
104
|
+
version: '2.4'
|
63
105
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
64
106
|
requirements:
|
65
107
|
- - ">="
|