activesupport-tagged_logging 1.0.0 → 2.0.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 +4 -4
- checksums.yaml.gz.sig +4 -1
- data/CHANGELOG.md +15 -0
- data/CONTRIBUTING.md +57 -6
- data/README.md +110 -48
- data/SECURITY.md +2 -1
- data/lib/activesupport/fix_pr_53105.rb +5 -2
- data/lib/activesupport/tagged_logging/version.rb +1 -1
- data/lib/activesupport-tagged_logging.rb +25 -39
- data.tar.gz.sig +0 -0
- metadata +157 -37
- metadata.gz.sig +0 -0
- data/lib/activesupport/isolated_execution_state.rb +0 -75
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2a2fb64b04b8c492751201d2f737e59b35a81d09de245c56d45161e6c8a9fd62
|
4
|
+
data.tar.gz: 541731d47abedd585cccf075659b4570de58561c5da373011ae44fd31f27dbbe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9880b952b57714774f9c4a191c6863179348aa23c3b2a86d1fddf96aab238fb3e63ea111f9c76606e006b5cbd0a765918a1b33a0edf069ad769717b413f877a4
|
7
|
+
data.tar.gz: 1f6cf87a2b8b118cec5d62041711efc47a1a1b8bc00f82c8d0b46b3449d3ab73a3fb658e4c62e6aef83f736164df102710bbb1c0fabc48d9e1e11d4482003a7e
|
checksums.yaml.gz.sig
CHANGED
@@ -1 +1,4 @@
|
|
1
|
-
|
1
|
+
N���HdL�Q*��ק:֤LV$k#c����w<�-���������#Vb�0�f�$e�ޜ�
|
2
|
+
M3���Y�xK�s�3`���T=K�'��:�h�y讞��Av��řr��U�̡�߷����˃�L^��ٕ��dX���*lP����ó�j�OF�3ɲ�X��諢��C���R��On�^�*�
|
3
|
+
)o)OPY����Ll�nYZ�Y�էO���6���뫇��D�EJ�"��v�K����/�1#4Fi$1NbC�k�˕���]3M�O�s��_�Z�-�0�-P�.-�+[1q����^�^Z��cS����&^\���3��)⻛
|
4
|
+
h�Ee�#`��/W�^��%�h�CP/��8DF?yB� A���Z�x�~����
|
data/CHANGELOG.md
CHANGED
@@ -10,6 +10,21 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
10
10
|
### Fixed
|
11
11
|
### Removed
|
12
12
|
|
13
|
+
## [2.0.0] - 2024-11-21
|
14
|
+
- COVERAGE: 98.11% -- 104/106 lines in 5 files
|
15
|
+
- BRANCH COVERAGE: 81.82% -- 18/22 branches in 5 files
|
16
|
+
- 36.36% documented
|
17
|
+
### Changed
|
18
|
+
- `ActiveSupport::FixPr53105` => `Activesupport::FixPr53105`
|
19
|
+
- **BREAKING CHANGE**: change `ActiveSupport::FixPr53105.init` to `Activesupport::FixPr53105.init`
|
20
|
+
- This is to keep the code of this gem in a consistent namespace separate from the standard Rails `ActiveSupport`.
|
21
|
+
- Upgrade to `activesupport-logger` v2.0.0
|
22
|
+
### Fixed
|
23
|
+
- Compatibility with Rails v5.2, v6.0, v6.1, v7.0, v7.1, and v8
|
24
|
+
### Added
|
25
|
+
- Dependency on `activesupport-broadcast_logger` v2.0.0
|
26
|
+
- Real test suite
|
27
|
+
|
13
28
|
## [1.0.0] - 2024-10-10
|
14
29
|
- COVERAGE: 46.84% -- 74/158 lines in 6 files
|
15
30
|
- BRANCH COVERAGE: 21.74% -- 5/23 branches in 6 files
|
data/CONTRIBUTING.md
CHANGED
@@ -7,6 +7,63 @@ the [code of conduct][🤝conduct].
|
|
7
7
|
To submit a patch, please fork the project and create a patch with tests.
|
8
8
|
Once you're happy with it send a pull request.
|
9
9
|
|
10
|
+
## You can help!
|
11
|
+
|
12
|
+
Take a look at the `reek` list which is the file called `REEK` and find something to improve.
|
13
|
+
|
14
|
+
Simply follow these instructions:
|
15
|
+
|
16
|
+
1. Fork the repository
|
17
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
18
|
+
3. Make some fixes.
|
19
|
+
4. Commit your changes (`git commit -am 'Added some feature'`)
|
20
|
+
5. Push to the branch (`git push origin my-new-feature`)
|
21
|
+
6. Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
|
22
|
+
7. Create new Pull Request.
|
23
|
+
|
24
|
+
## Contributors
|
25
|
+
|
26
|
+
Your picture could be here!
|
27
|
+
|
28
|
+
[![Contributors][🖐contributors-img]][🖐contributors]
|
29
|
+
|
30
|
+
Made with [contributors-img][🖐contrib-rocks].
|
31
|
+
|
32
|
+
## The Reek List
|
33
|
+
|
34
|
+
To refresh the `reek` list:
|
35
|
+
|
36
|
+
```bash
|
37
|
+
bundle exec reek > REEK
|
38
|
+
```
|
39
|
+
|
40
|
+
## Appraisal
|
41
|
+
|
42
|
+
### Generate a new set of Appraisal gemfiles:
|
43
|
+
|
44
|
+
```bash
|
45
|
+
BUNDLE_GEMFILE=Appraisal.root.gemfile appraisal update
|
46
|
+
```
|
47
|
+
|
48
|
+
## Run Tests
|
49
|
+
|
50
|
+
```bash
|
51
|
+
bundle exec rake test
|
52
|
+
```
|
53
|
+
|
54
|
+
## Lint It
|
55
|
+
|
56
|
+
Run all the default tasks, which includes running the gradually autocorrecting linter, `rubocop-gradual`.
|
57
|
+
|
58
|
+
```bash
|
59
|
+
bundle exec rake
|
60
|
+
```
|
61
|
+
|
62
|
+
Or just run the linter.
|
63
|
+
```bash
|
64
|
+
bundle exec rubocop_gradual:autocorrect
|
65
|
+
```
|
66
|
+
|
10
67
|
## Release
|
11
68
|
|
12
69
|
### One-time, Per-developer, Setup
|
@@ -38,12 +95,6 @@ See: [RubyGems Security Guide][🔒️rubygems-security-guide]
|
|
38
95
|
12. Run `bundle exec rake release` which will create a git tag for the version,
|
39
96
|
push git commits and tags, and push the `.gem` file to [rubygems.org][💎rubygems]
|
40
97
|
|
41
|
-
## Contributors
|
42
|
-
|
43
|
-
[![Contributors][🖐contributors-img]][🖐contributors]
|
44
|
-
|
45
|
-
Made with [contributors-img][🖐contrib-rocks].
|
46
|
-
|
47
98
|
[🧪build]: https://github.com/pboling/activesupport-tagged_logging/actions
|
48
99
|
[🤝conduct]: https://github.com/pboling/activesupport-tagged_logging/blob/main/CODE_OF_CONDUCT.md
|
49
100
|
[🖐contrib-rocks]: https://contrib.rocks
|
data/README.md
CHANGED
@@ -1,14 +1,54 @@
|
|
1
1
|
# Activesupport::TaggedLogging
|
2
2
|
|
3
|
-
[![
|
4
|
-
[![
|
5
|
-
[![Downloads
|
6
|
-
[![
|
7
|
-
[![
|
8
|
-
[![
|
9
|
-
[![
|
10
|
-
[![
|
11
|
-
[![CI
|
3
|
+
[![Version][👽versioni]][👽version]
|
4
|
+
[![License: MIT][📄license-img]][📄license-ref]
|
5
|
+
[![Downloads Rank][👽dl-ranki]][👽dl-rank]
|
6
|
+
[![Open Source Helpers][👽oss-helpi]][👽oss-help]
|
7
|
+
[![Depfu][🔑depfui♻️]][🔑depfu]
|
8
|
+
[![CodeCov][🔑codecovi♻️]][🔑codecov]
|
9
|
+
[![Test Coverage][🔑cc-covi♻️]][🔑cc-cov]
|
10
|
+
[![Maintainability][🔑cc-mnti♻️]][🔑cc-mnt]
|
11
|
+
[![CI Supported Build][🚎6-s-wfi]][🚎6-s-wf]
|
12
|
+
[![CI Legacy Build][🚎4-lg-wfi]][🚎4-lg-wf]
|
13
|
+
[![CI Unsupported Build][🚎7-us-wfi]][🚎7-us-wf]
|
14
|
+
[![CI Heads Build][🚎3-hd-wfi]][🚎3-hd-wf]
|
15
|
+
[![CI Coverage Build][🚎2-cov-wfi]][🚎2-cov-wf]
|
16
|
+
[![CI Style Build][🚎5-st-wfi]][🚎5-st-wf]
|
17
|
+
|
18
|
+
<!--- ( 👽️ INFO LINKS ) -->
|
19
|
+
|
20
|
+
[👽dl-rank]: https://rubygems.org/gems/activesupport-tagged_logging
|
21
|
+
[👽dl-ranki]: https://img.shields.io/gem/rd/activesupport-tagged_logging.svg
|
22
|
+
[👽oss-help]: https://www.codetriage.com/pboling/activesupport-tagged_logging
|
23
|
+
[👽oss-helpi]: https://www.codetriage.com/pboling/activesupport-tagged_logging/badges/users.svg
|
24
|
+
[👽version]: https://rubygems.org/gems/activesupport-tagged_logging
|
25
|
+
[👽versioni]: https://img.shields.io/gem/v/activesupport-tagged_logging.svg
|
26
|
+
|
27
|
+
<!--- ( 🔑 KEYED LINKS ) -->
|
28
|
+
|
29
|
+
[🔑cc-mnt]: https://codeclimate.com/github/pboling/activesupport-tagged_logging/maintainability
|
30
|
+
[🔑cc-mnti♻️]: https://api.codeclimate.com/v1/badges/ce5a654a5f9fe07ecb0a/maintainability
|
31
|
+
[🔑cc-cov]: https://codeclimate.com/github/pboling/activesupport-tagged_logging/test_coverage
|
32
|
+
[🔑cc-covi♻️]: https://api.codeclimate.com/v1/badges/ce5a654a5f9fe07ecb0a/test_coverage
|
33
|
+
[🔑codecov]: https://codecov.io/gh/pboling/activesupport-tagged_logging
|
34
|
+
[🔑codecovi♻️]: https://codecov.io/gh/pboling/activesupport-tagged_logging/branch/main/graph/badge.svg?token=lhefE7Tkzq
|
35
|
+
[🔑depfu]: https://depfu.com/github/pboling/activesupport-tagged_logging
|
36
|
+
[🔑depfui♻️]: https://badges.depfu.com/badges/160bf8da842f6caadfc2da5a407842ac/count.svg
|
37
|
+
|
38
|
+
<!--- ( 🚎 BUILD LINKS ) -->
|
39
|
+
|
40
|
+
[🚎2-cov-wf]: https://github.com/pboling/activesupport-tagged_logging/actions/workflows/coverage.yml
|
41
|
+
[🚎2-cov-wfi]: https://github.com/pboling/activesupport-tagged_logging/actions/workflows/coverage.yml/badge.svg
|
42
|
+
[🚎3-hd-wf]: https://github.com/pboling/activesupport-tagged_logging/actions/workflows/heads.yml
|
43
|
+
[🚎3-hd-wfi]: https://github.com/pboling/activesupport-tagged_logging/actions/workflows/heads.yml/badge.svg
|
44
|
+
[🚎4-lg-wf]: https://github.com/pboling/activesupport-tagged_logging/actions/workflows/legacy.yml
|
45
|
+
[🚎4-lg-wfi]: https://github.com/pboling/activesupport-tagged_logging/actions/workflows/legacy.yml/badge.svg
|
46
|
+
[🚎5-st-wf]: https://github.com/pboling/activesupport-tagged_logging/actions/workflows/style.yml
|
47
|
+
[🚎5-st-wfi]: https://github.com/pboling/activesupport-tagged_logging/actions/workflows/style.yml/badge.svg
|
48
|
+
[🚎6-s-wf]: https://github.com/pboling/activesupport-tagged_logging/actions/workflows/supported.yml
|
49
|
+
[🚎6-s-wfi]: https://github.com/pboling/activesupport-tagged_logging/actions/workflows/supported.yml/badge.svg
|
50
|
+
[🚎7-us-wf]: https://github.com/pboling/activesupport-tagged_logging/actions/workflows/unsupported.yml
|
51
|
+
[🚎7-us-wfi]: https://github.com/pboling/activesupport-tagged_logging/actions/workflows/unsupported.yml/badge.svg
|
12
52
|
|
13
53
|
-----
|
14
54
|
|
@@ -18,19 +58,6 @@
|
|
18
58
|
[![Donate to my FLOSS or refugee efforts at ko-fi.com][🖇kofi-img]][🖇kofi]
|
19
59
|
[![Donate to my FLOSS or refugee efforts using Patreon][🖇patreon-img]][🖇patreon]
|
20
60
|
|
21
|
-
[🚎s-wf]: https://github.com/pboling/activesupport-tagged_logging/actions/workflows/supported.yml
|
22
|
-
[🚎s-wfi]: https://github.com/pboling/activesupport-tagged_logging/actions/workflows/supported.yml/badge.svg
|
23
|
-
[🚎us-wf]: https://github.com/pboling/activesupport-tagged_logging/actions/workflows/unsupported.yml
|
24
|
-
[🚎us-wfi]: https://github.com/pboling/activesupport-tagged_logging/actions/workflows/unsupported.yml/badge.svg
|
25
|
-
[🚎a-wf]: https://github.com/pboling/activesupport-tagged_logging/actions/workflows/ancient.yml
|
26
|
-
[🚎a-wfi]: https://github.com/pboling/activesupport-tagged_logging/actions/workflows/ancient.yml/badge.svg
|
27
|
-
[🚎st-wf]: https://github.com/pboling/activesupport-tagged_logging/actions/workflows/style.yml
|
28
|
-
[🚎st-wfi]: https://github.com/pboling/activesupport-tagged_logging/actions/workflows/style.yml/badge.svg
|
29
|
-
[🚎cov-wf]: https://github.com/pboling/activesupport-tagged_logging/actions/workflows/coverage.yml
|
30
|
-
[🚎cov-wfi]: https://github.com/pboling/activesupport-tagged_logging/actions/workflows/coverage.yml/badge.svg
|
31
|
-
[🚎hd-wf]: https://github.com/pboling/activesupport-tagged_logging/actions/workflows/heads.yml
|
32
|
-
[🚎hd-wfi]: https://github.com/pboling/activesupport-tagged_logging/actions/workflows/heads.yml/badge.svg
|
33
|
-
|
34
61
|
[⛳liberapay-img]: https://img.shields.io/liberapay/patrons/pboling.svg?logo=liberapay
|
35
62
|
[⛳liberapay]: https://liberapay.com/pboling/donate
|
36
63
|
[🖇sponsor-img]: https://img.shields.io/badge/Sponsor_Me!-pboling.svg?style=social&logo=github
|
@@ -42,9 +69,30 @@
|
|
42
69
|
[🖇patreon-img]: https://img.shields.io/badge/patreon-donate-yellow.svg
|
43
70
|
[🖇patreon]: https://patreon.com/galtzo
|
44
71
|
|
45
|
-
This is an **unofficial** extraction of Rails' v8 `ActiveSupport::TaggedLogging`
|
72
|
+
This is an **unofficial** extraction of Rails' v8 `ActiveSupport::TaggedLogging` which has been:
|
73
|
+
* refactored ([here][pr-53105]) to work with [broadcast logging][activesupport-broadcast_logger], and
|
74
|
+
* backported to work with Rails v5.2+ and Ruby 2.7+.
|
75
|
+
|
76
|
+
If the suite of gems this is part of is loaded in any version of Rails >= 5.2,
|
77
|
+
it will replace the logging tooling completely.
|
78
|
+
|
79
|
+
This gem automatically depends on and configures the other gems in the suite.
|
80
|
+
Simply add it to your Gemfile, and configure. The other gems will just work.
|
81
|
+
|
82
|
+
Simplified, the load order is basically:
|
83
|
+
|
84
|
+
- Enhanced [activesupport-logger][activesupport-logger] which was ripped from Rails v8.0
|
85
|
+
- Enhanced [activesupport-broadcast_logger][activesupport-broadcast_logger] which was ripped from Rails v8.0, and [this PR][pr-53093]
|
86
|
+
- Enhanced [activesupport-tagged_logging][activesupport-tagged_logging] (this gem) which was ripped from Rails v8.0, and [this PR][pr-53105]
|
46
87
|
|
47
|
-
|
88
|
+
Above load order is handled for you in [activesupport-tagged_logging][activesupport-tagged_logging] (this gem),
|
89
|
+
so depend on this gem, not the siblings. ;)
|
90
|
+
|
91
|
+
[activesupport-logger]: https://github.com/pboling/activesupport-logger
|
92
|
+
[activesupport-broadcast_logger]: https://github.com/pboling/activesupport-broadcast_logger
|
93
|
+
[activesupport-tagged_logging]: https://github.com/pboling/activesupport-tagged_logging
|
94
|
+
[pr-53105]: https://github.com/rails/rails/pull/53105
|
95
|
+
[pr-53093]: https://github.com/rails/rails/pull/53093
|
48
96
|
|
49
97
|
## Installation
|
50
98
|
|
@@ -64,43 +112,42 @@ require "activesupport-tagged_logging"
|
|
64
112
|
|
65
113
|
### With `activesupport-logger` gem
|
66
114
|
|
67
|
-
[
|
115
|
+
[activesupport-logger][activesupport-logger]
|
116
|
+
is automatically depended on and configured by this gem,
|
68
117
|
so you don't need to do anything else.
|
69
118
|
|
70
119
|
IMPORTANT: When using this gem,
|
71
|
-
**do not require
|
120
|
+
**do not `require "activesupport-logger"` in your code.**
|
72
121
|
Load order matters.
|
73
122
|
|
74
|
-
|
75
|
-
|
76
|
-
- Standard `active_support/logger` from the Rails version loaded by your application
|
77
|
-
- Standard `active_support/tagged_logging` from the Rails version loaded by your application
|
78
|
-
- This gem's dependency [`activesupport-logger`][activesupport-logger] which was ripped from the Rails v8 beta
|
79
|
-
- This gem's `activesupport-tagged_logging` which was ripped from the Rails v8 beta
|
123
|
+
### With `activesupport-broadcast_logger` gem
|
80
124
|
|
81
|
-
|
125
|
+
[activesupport-broadcast_logger][activesupport-broadcast_logger]
|
126
|
+
is automatically depended on and configured by this gem,
|
127
|
+
so you don't need to do anything else.
|
82
128
|
|
83
|
-
|
84
|
-
|
129
|
+
IMPORTANT: When using this gem,
|
130
|
+
**do not `require "activesupport-broadcast_logger"` in your code.**
|
131
|
+
Load order matters.
|
85
132
|
|
86
133
|
### With broadcasting support
|
87
134
|
|
88
135
|
If you want to try an experimental fix from a PR, run:
|
89
136
|
|
90
137
|
```ruby
|
91
|
-
|
138
|
+
Activesupport::FixPr53105.init
|
92
139
|
```
|
140
|
+
NOTE: The bits of logic that are unique to this gem are in the namespace `Activesupport` (sic).
|
93
141
|
|
94
142
|
See: https://github.com/rails/rails/pull/53105/files
|
95
143
|
|
96
144
|
## General Info
|
97
145
|
|
98
|
-
| Primary
|
99
|
-
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
| `...` 💖 | [![Liberapay Patrons][⛳liberapay-img]][⛳liberapay] [![Sponsor Me][🖇sponsor-img]][🖇sponsor] [![Follow Me on LinkedIn][🖇linkedin-img]][🖇linkedin] [![Find Me on WellFound:][✌️wellfound-img]][✌️wellfound] [![Find Me on CrunchBase][💲crunchbase-img]][💲crunchbase] [![My LinkTree][🌳linktree-img]][🌳linktree] [![Follow Me on Ruby.Social][🐘ruby-mast-img]][🐘ruby-mast] [![Tweet @ Peter][🐦tweet-img]][🐦tweet] [💻][coderme] [🌏][aboutme] |
|
146
|
+
| Primary Namespaces | `Activesupport::TaggedLogging` && `ActiveSupport::TaggedLogging` && `Activesupport::FixPr53105` |
|
147
|
+
|--------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
148
|
+
| documentation | [on Github.com][homepage], [Latest release on RubyDoc.info][documentation], [HEAD on RubyDoc.info][documentation-head] |
|
149
|
+
| expert support | [](https://www.codementor.io/peterboling?utm_source=github&utm_medium=button&utm_term=peterboling&utm_campaign=github) |
|
150
|
+
| `...` 💖 | [![Follow Me on LinkedIn][🖇linkedin-img]][🖇linkedin] [![Find Me on WellFound:][✌️wellfound-img]][✌️wellfound] [![Find Me on CrunchBase][💲crunchbase-img]][💲crunchbase] [![My LinkTree][🌳linktree-img]][🌳linktree] [![Follow Me on Ruby.Social][🐘ruby-mast-img]][🐘ruby-mast] [![Tweet @ Peter][🐦tweet-img]][🐦tweet] [💻][coderme] [🌏][aboutme] |
|
104
151
|
|
105
152
|
<!-- 7️⃣ spread 💖 -->
|
106
153
|
[🐦tweet-img]: https://img.shields.io/twitter/follow/galtzo.svg?style=social&label=Follow%20%40galtzo
|
@@ -117,8 +164,6 @@ See: https://github.com/rails/rails/pull/53105/files
|
|
117
164
|
[🐘ruby-mast-img]: https://img.shields.io/mastodon/follow/109447111526622197?domain=https%3A%2F%2Fruby.social&style=plastic&logo=mastodon&label=Ruby%20%40galtzo
|
118
165
|
[🌳linktree]: https://linktr.ee/galtzo
|
119
166
|
[🌳linktree-img]: https://img.shields.io/badge/galtzo-purple?style=plastic&logo=linktree
|
120
|
-
[documentation]: https://rubydoc.info/github/pboling/activesupport-tagged_logging
|
121
|
-
[homepage]: https://github.com/pboling/activesupport-tagged_logging
|
122
167
|
|
123
168
|
<!-- Maintainer Contact Links -->
|
124
169
|
[aboutme]: https://about.me/peter.boling
|
@@ -136,6 +181,12 @@ Also, see [CONTRIBUTING.md][🤝contributing].
|
|
136
181
|
[🤝pulls]: https://github.com/pboling/activesupport-tagged_logging/pulls
|
137
182
|
[🤝contributing]: CONTRIBUTING.md
|
138
183
|
|
184
|
+
### Code Coverage
|
185
|
+
|
186
|
+
[![Coverage Graph][🔑codecov-g]][🔑codecov]
|
187
|
+
|
188
|
+
[🔑codecov-g]: https://codecov.io/gh/pboling/activesupport-tagged_logging/graphs/tree.svg?token=cc6UdZCpAL
|
189
|
+
|
139
190
|
## 🌈 Contributors
|
140
191
|
|
141
192
|
[![Contributors][🖐contributors-img]][🖐contributors]
|
@@ -146,6 +197,16 @@ Made with [contributors-img][🖐contrib-rocks].
|
|
146
197
|
[🖐contributors]: https://github.com/pboling/activesupport-tagged_logging/graphs/contributors
|
147
198
|
[🖐contributors-img]: https://contrib.rocks/image?repo=pboling/activesupport-tagged_logging
|
148
199
|
|
200
|
+
## Star History
|
201
|
+
|
202
|
+
<a href="https://star-history.com/#pboling/activesupport-tagged_logging&Date">
|
203
|
+
<picture>
|
204
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=pboling/activesupport-tagged_logging&type=Date&theme=dark" />
|
205
|
+
<source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/svg?repos=pboling/activesupport-tagged_logging&type=Date" />
|
206
|
+
<img alt="Star History Chart" src="https://api.star-history.com/svg?repos=pboling/activesupport-tagged_logging&type=Date" />
|
207
|
+
</picture>
|
208
|
+
</a>
|
209
|
+
|
149
210
|
## 🪇 Code of Conduct
|
150
211
|
|
151
212
|
Everyone interacting in this project's codebases, issue trackers,
|
@@ -172,12 +233,12 @@ the [Pessimistic Version Constraint][📌pvc] with two digits of precision.
|
|
172
233
|
For example:
|
173
234
|
|
174
235
|
```ruby
|
175
|
-
spec.add_dependency("activesupport-tagged_logging", "~>
|
236
|
+
spec.add_dependency("activesupport-tagged_logging", "~> 2.0")
|
176
237
|
```
|
177
238
|
|
178
239
|
See [CHANGELOG.md][📌changelog] for list of releases.
|
179
240
|
|
180
|
-
|
241
|
+
<!--- ( 📌 VERSIONING LINKS ) -->
|
181
242
|
|
182
243
|
[📌pvc]: http://guides.rubygems.org/patterns/#pessimistic-version-constraint
|
183
244
|
[📌semver]: http://semver.org/
|
@@ -191,7 +252,7 @@ the [MIT License][📄license] [![License: MIT][📄license-img]][📄license-re
|
|
191
252
|
|
192
253
|
See [LICENSE.txt][📄license] for the official [Copyright Notice][📄copyright-notice-explainer].
|
193
254
|
|
194
|
-
|
255
|
+
<!--- ( 📄 LEGAL LINKS ) -->
|
195
256
|
|
196
257
|
[📄copyright-notice-explainer]: https://opensource.stackexchange.com/questions/5778/why-do-licenses-such-as-the-mit-license-specify-a-single-year
|
197
258
|
[📄license]: LICENSE.txt
|
@@ -202,12 +263,13 @@ See [LICENSE.txt][📄license] for the official [Copyright Notice][📄copyright
|
|
202
263
|
|
203
264
|
* Copyright (c) David Heinemeier Hansson
|
204
265
|
* Parts original to this extraction are:
|
205
|
-
|
266
|
+
* Copyright (c) 2024 [Peter H. Boling][peterboling] of [Rails Bling][railsbling]
|
206
267
|
|
207
268
|
[railsbling]: http://www.railsbling.com
|
208
269
|
[peterboling]: http://www.peterboling.com
|
209
270
|
[bundle-group-pattern]: https://gist.github.com/pboling/4564780
|
210
271
|
[documentation]: http://rubydoc.info/gems/activesupport-tagged_logging
|
272
|
+
[documentation-head]: https://rubydoc.info/github/pboling/activesupport-tagged_logging/main
|
211
273
|
[homepage]: https://github.com/pboling/activesupport-tagged_logging
|
212
274
|
|
213
275
|
## 🤑 One more thing
|
data/SECURITY.md
CHANGED
@@ -1,10 +1,13 @@
|
|
1
1
|
# Support for tagged logging from broadcast logging.
|
2
|
-
#
|
2
|
+
# Activesupport::FixPr53105.init
|
3
3
|
# See: https://github.com/rails/rails/pull/53105
|
4
|
-
module
|
4
|
+
module Activesupport
|
5
5
|
module FixPr53105
|
6
|
+
# @return void
|
6
7
|
def init
|
7
8
|
require_relative "tagged_logging/broadcasting"
|
9
|
+
|
10
|
+
nil
|
8
11
|
end
|
9
12
|
module_function :init
|
10
13
|
end
|
@@ -2,47 +2,33 @@
|
|
2
2
|
require "active_support/version"
|
3
3
|
require "version_gem"
|
4
4
|
|
5
|
-
# This library
|
5
|
+
# This library's version
|
6
6
|
require_relative "activesupport/tagged_logging/version"
|
7
7
|
|
8
|
-
#
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
# https://github.com/rails/rails/blob/main/activesupport/lib/active_support/tagged_logging.rb
|
33
|
-
#
|
34
|
-
# All this reloading might print warnings about redefined methods, and this is expected.
|
35
|
-
# Technically it might even break things, but we don't expect it to, and YMMV.
|
36
|
-
require_relative "activesupport/tagged_logging"
|
37
|
-
|
38
|
-
# If you want to use the fix in the PR, run:
|
39
|
-
# ActiveSupport::FixPr53105.init
|
40
|
-
# See: https://github.com/rails/rails/pull/53105/files
|
41
|
-
require_relative "activesupport/fix_pr_53105"
|
42
|
-
|
43
|
-
# Fallback to the original
|
44
|
-
require "active_support/tagged_logging"
|
45
|
-
end
|
8
|
+
# Loads supporting features from Rails v5, 6, 7, or 8
|
9
|
+
require "active_support/core_ext/module/delegation"
|
10
|
+
require "active_support/core_ext/object/blank"
|
11
|
+
|
12
|
+
# Require the extracted-from-Rails-8 ActiveSupport::BroadcastLogger
|
13
|
+
# It will handle properly loading the extracted-from-Rails-8 ActiveSupport::Logger
|
14
|
+
require "activesupport-broadcast_logger"
|
15
|
+
|
16
|
+
# !!ORDER MATTERS!!
|
17
|
+
#
|
18
|
+
# Extracted from:
|
19
|
+
# https://github.com/rails/rails/blob/592a52b9370df79787d74b1bac9b201891c45054/activesupport/lib/active_support/tagged_logging.rb
|
20
|
+
# which at the time was the latest version of the file on `main` branch.
|
21
|
+
# Compare SHA with latest commit to the same file on `main` to check for changes:
|
22
|
+
# https://github.com/rails/rails/blob/main/activesupport/lib/active_support/tagged_logging.rb
|
23
|
+
#
|
24
|
+
# All this reloading might print warnings about redefined methods, and this is expected.
|
25
|
+
# Technically it might even break things, but we don't expect it to, and YMMV.
|
26
|
+
require_relative "activesupport/tagged_logging"
|
27
|
+
|
28
|
+
# If you want to use the fix in the PR, run:
|
29
|
+
# Activesupport::FixPr53105.init
|
30
|
+
# See: https://github.com/rails/rails/pull/53105/files
|
31
|
+
require_relative "activesupport/fix_pr_53105"
|
46
32
|
|
47
33
|
# Namespace for the Version of this gem (and nothing else)
|
48
34
|
module Activesupport
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activesupport-tagged_logging
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Peter Boling
|
@@ -36,8 +36,76 @@ cert_chain:
|
|
36
36
|
I5o+DRfXQHqKucx1ldFHvI2rE/kSCWqGTHN2eyu1sqCPeOoIMxrltJhaejKPkxqj
|
37
37
|
zaF9Og==
|
38
38
|
-----END CERTIFICATE-----
|
39
|
-
date: 2024-
|
39
|
+
date: 2024-11-21 00:00:00.000000000 Z
|
40
40
|
dependencies:
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: logger
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '1.6'
|
48
|
+
- - ">="
|
49
|
+
- !ruby/object:Gem::Version
|
50
|
+
version: 1.6.1
|
51
|
+
type: :runtime
|
52
|
+
prerelease: false
|
53
|
+
version_requirements: !ruby/object:Gem::Requirement
|
54
|
+
requirements:
|
55
|
+
- - "~>"
|
56
|
+
- !ruby/object:Gem::Version
|
57
|
+
version: '1.6'
|
58
|
+
- - ">="
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: 1.6.1
|
61
|
+
- !ruby/object:Gem::Dependency
|
62
|
+
name: mutex_m
|
63
|
+
requirement: !ruby/object:Gem::Requirement
|
64
|
+
requirements:
|
65
|
+
- - "~>"
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: '0.1'
|
68
|
+
type: :runtime
|
69
|
+
prerelease: false
|
70
|
+
version_requirements: !ruby/object:Gem::Requirement
|
71
|
+
requirements:
|
72
|
+
- - "~>"
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: '0.1'
|
75
|
+
- !ruby/object:Gem::Dependency
|
76
|
+
name: rdoc
|
77
|
+
requirement: !ruby/object:Gem::Requirement
|
78
|
+
requirements:
|
79
|
+
- - "~>"
|
80
|
+
- !ruby/object:Gem::Version
|
81
|
+
version: '6.8'
|
82
|
+
- - ">="
|
83
|
+
- !ruby/object:Gem::Version
|
84
|
+
version: 6.8.1
|
85
|
+
type: :runtime
|
86
|
+
prerelease: false
|
87
|
+
version_requirements: !ruby/object:Gem::Requirement
|
88
|
+
requirements:
|
89
|
+
- - "~>"
|
90
|
+
- !ruby/object:Gem::Version
|
91
|
+
version: '6.8'
|
92
|
+
- - ">="
|
93
|
+
- !ruby/object:Gem::Version
|
94
|
+
version: 6.8.1
|
95
|
+
- !ruby/object:Gem::Dependency
|
96
|
+
name: stringio
|
97
|
+
requirement: !ruby/object:Gem::Requirement
|
98
|
+
requirements:
|
99
|
+
- - ">="
|
100
|
+
- !ruby/object:Gem::Version
|
101
|
+
version: 0.0.2
|
102
|
+
type: :runtime
|
103
|
+
prerelease: false
|
104
|
+
version_requirements: !ruby/object:Gem::Requirement
|
105
|
+
requirements:
|
106
|
+
- - ">="
|
107
|
+
- !ruby/object:Gem::Version
|
108
|
+
version: 0.0.2
|
41
109
|
- !ruby/object:Gem::Dependency
|
42
110
|
name: activesupport
|
43
111
|
requirement: !ruby/object:Gem::Requirement
|
@@ -52,26 +120,46 @@ dependencies:
|
|
52
120
|
- - ">="
|
53
121
|
- !ruby/object:Gem::Version
|
54
122
|
version: '5.2'
|
123
|
+
- !ruby/object:Gem::Dependency
|
124
|
+
name: activesupport-broadcast_logger
|
125
|
+
requirement: !ruby/object:Gem::Requirement
|
126
|
+
requirements:
|
127
|
+
- - "~>"
|
128
|
+
- !ruby/object:Gem::Version
|
129
|
+
version: '2.0'
|
130
|
+
- - ">="
|
131
|
+
- !ruby/object:Gem::Version
|
132
|
+
version: 2.0.0
|
133
|
+
type: :runtime
|
134
|
+
prerelease: false
|
135
|
+
version_requirements: !ruby/object:Gem::Requirement
|
136
|
+
requirements:
|
137
|
+
- - "~>"
|
138
|
+
- !ruby/object:Gem::Version
|
139
|
+
version: '2.0'
|
140
|
+
- - ">="
|
141
|
+
- !ruby/object:Gem::Version
|
142
|
+
version: 2.0.0
|
55
143
|
- !ruby/object:Gem::Dependency
|
56
144
|
name: activesupport-logger
|
57
145
|
requirement: !ruby/object:Gem::Requirement
|
58
146
|
requirements:
|
59
147
|
- - "~>"
|
60
148
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
149
|
+
version: '2.0'
|
62
150
|
- - ">="
|
63
151
|
- !ruby/object:Gem::Version
|
64
|
-
version:
|
152
|
+
version: 2.0.0
|
65
153
|
type: :runtime
|
66
154
|
prerelease: false
|
67
155
|
version_requirements: !ruby/object:Gem::Requirement
|
68
156
|
requirements:
|
69
157
|
- - "~>"
|
70
158
|
- !ruby/object:Gem::Version
|
71
|
-
version: '
|
159
|
+
version: '2.0'
|
72
160
|
- - ">="
|
73
161
|
- !ruby/object:Gem::Version
|
74
|
-
version:
|
162
|
+
version: 2.0.0
|
75
163
|
- !ruby/object:Gem::Dependency
|
76
164
|
name: version_gem
|
77
165
|
requirement: !ruby/object:Gem::Requirement
|
@@ -101,7 +189,7 @@ dependencies:
|
|
101
189
|
version: '0.9'
|
102
190
|
- - ">="
|
103
191
|
- !ruby/object:Gem::Version
|
104
|
-
version: 0.9.
|
192
|
+
version: 0.9.37
|
105
193
|
type: :development
|
106
194
|
prerelease: false
|
107
195
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -111,7 +199,7 @@ dependencies:
|
|
111
199
|
version: '0.9'
|
112
200
|
- - ">="
|
113
201
|
- !ruby/object:Gem::Version
|
114
|
-
version: 0.9.
|
202
|
+
version: 0.9.37
|
115
203
|
- !ruby/object:Gem::Dependency
|
116
204
|
name: yard-junk
|
117
205
|
requirement: !ruby/object:Gem::Requirement
|
@@ -135,7 +223,7 @@ dependencies:
|
|
135
223
|
version: '1.0'
|
136
224
|
- - ">="
|
137
225
|
- !ruby/object:Gem::Version
|
138
|
-
version: 1.0.
|
226
|
+
version: 1.0.4
|
139
227
|
type: :development
|
140
228
|
prerelease: false
|
141
229
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -145,35 +233,55 @@ dependencies:
|
|
145
233
|
version: '1.0'
|
146
234
|
- - ">="
|
147
235
|
- !ruby/object:Gem::Version
|
148
|
-
version: 1.0.
|
236
|
+
version: 1.0.4
|
149
237
|
- !ruby/object:Gem::Dependency
|
150
|
-
name:
|
238
|
+
name: appraisal
|
151
239
|
requirement: !ruby/object:Gem::Requirement
|
152
240
|
requirements:
|
241
|
+
- - "~>"
|
242
|
+
- !ruby/object:Gem::Version
|
243
|
+
version: '2.5'
|
244
|
+
type: :development
|
245
|
+
prerelease: false
|
246
|
+
version_requirements: !ruby/object:Gem::Requirement
|
247
|
+
requirements:
|
248
|
+
- - "~>"
|
249
|
+
- !ruby/object:Gem::Version
|
250
|
+
version: '2.5'
|
251
|
+
- !ruby/object:Gem::Dependency
|
252
|
+
name: minitest
|
253
|
+
requirement: !ruby/object:Gem::Requirement
|
254
|
+
requirements:
|
255
|
+
- - "~>"
|
256
|
+
- !ruby/object:Gem::Version
|
257
|
+
version: '5.25'
|
153
258
|
- - ">="
|
154
259
|
- !ruby/object:Gem::Version
|
155
|
-
version:
|
260
|
+
version: 5.25.1
|
156
261
|
type: :development
|
157
262
|
prerelease: false
|
158
263
|
version_requirements: !ruby/object:Gem::Requirement
|
159
264
|
requirements:
|
265
|
+
- - "~>"
|
266
|
+
- !ruby/object:Gem::Version
|
267
|
+
version: '5.25'
|
160
268
|
- - ">="
|
161
269
|
- !ruby/object:Gem::Version
|
162
|
-
version:
|
270
|
+
version: 5.25.1
|
163
271
|
- !ruby/object:Gem::Dependency
|
164
272
|
name: rake
|
165
273
|
requirement: !ruby/object:Gem::Requirement
|
166
274
|
requirements:
|
167
275
|
- - ">="
|
168
276
|
- !ruby/object:Gem::Version
|
169
|
-
version: '
|
277
|
+
version: '13'
|
170
278
|
type: :development
|
171
279
|
prerelease: false
|
172
280
|
version_requirements: !ruby/object:Gem::Requirement
|
173
281
|
requirements:
|
174
282
|
- - ">="
|
175
283
|
- !ruby/object:Gem::Version
|
176
|
-
version: '
|
284
|
+
version: '13'
|
177
285
|
- !ruby/object:Gem::Dependency
|
178
286
|
name: rspec
|
179
287
|
requirement: !ruby/object:Gem::Requirement
|
@@ -209,69 +317,81 @@ dependencies:
|
|
209
317
|
- !ruby/object:Gem::Version
|
210
318
|
version: 1.0.6
|
211
319
|
- !ruby/object:Gem::Dependency
|
212
|
-
name:
|
320
|
+
name: test-unit
|
213
321
|
requirement: !ruby/object:Gem::Requirement
|
214
322
|
requirements:
|
215
323
|
- - "~>"
|
216
324
|
- !ruby/object:Gem::Version
|
217
|
-
version: '
|
325
|
+
version: '3.6'
|
326
|
+
- - ">="
|
327
|
+
- !ruby/object:Gem::Version
|
328
|
+
version: 3.6.2
|
218
329
|
type: :development
|
219
330
|
prerelease: false
|
220
331
|
version_requirements: !ruby/object:Gem::Requirement
|
221
332
|
requirements:
|
222
333
|
- - "~>"
|
223
334
|
- !ruby/object:Gem::Version
|
224
|
-
version: '
|
335
|
+
version: '3.6'
|
336
|
+
- - ">="
|
337
|
+
- !ruby/object:Gem::Version
|
338
|
+
version: 3.6.2
|
225
339
|
- !ruby/object:Gem::Dependency
|
226
|
-
name: rubocop-
|
340
|
+
name: rubocop-lts
|
227
341
|
requirement: !ruby/object:Gem::Requirement
|
228
342
|
requirements:
|
229
343
|
- - "~>"
|
230
344
|
- !ruby/object:Gem::Version
|
231
|
-
version: '
|
345
|
+
version: '18.2'
|
232
346
|
- - ">="
|
233
347
|
- !ruby/object:Gem::Version
|
234
|
-
version:
|
348
|
+
version: 18.2.1
|
235
349
|
type: :development
|
236
350
|
prerelease: false
|
237
351
|
version_requirements: !ruby/object:Gem::Requirement
|
238
352
|
requirements:
|
239
353
|
- - "~>"
|
240
354
|
- !ruby/object:Gem::Version
|
241
|
-
version: '
|
355
|
+
version: '18.2'
|
242
356
|
- - ">="
|
243
357
|
- !ruby/object:Gem::Version
|
244
|
-
version:
|
358
|
+
version: 18.2.1
|
245
359
|
- !ruby/object:Gem::Dependency
|
246
|
-
name: rubocop-
|
360
|
+
name: rubocop-packaging
|
247
361
|
requirement: !ruby/object:Gem::Requirement
|
248
362
|
requirements:
|
249
363
|
- - "~>"
|
250
364
|
- !ruby/object:Gem::Version
|
251
|
-
version: '
|
365
|
+
version: '0.5'
|
366
|
+
- - ">="
|
367
|
+
- !ruby/object:Gem::Version
|
368
|
+
version: 0.5.2
|
252
369
|
type: :development
|
253
370
|
prerelease: false
|
254
371
|
version_requirements: !ruby/object:Gem::Requirement
|
255
372
|
requirements:
|
256
373
|
- - "~>"
|
257
374
|
- !ruby/object:Gem::Version
|
258
|
-
version: '
|
375
|
+
version: '0.5'
|
376
|
+
- - ">="
|
377
|
+
- !ruby/object:Gem::Version
|
378
|
+
version: 0.5.2
|
259
379
|
- !ruby/object:Gem::Dependency
|
260
|
-
name:
|
380
|
+
name: rubocop-rspec
|
261
381
|
requirement: !ruby/object:Gem::Requirement
|
262
382
|
requirements:
|
263
383
|
- - "~>"
|
264
384
|
- !ruby/object:Gem::Version
|
265
|
-
version: '
|
385
|
+
version: '3.0'
|
266
386
|
type: :development
|
267
387
|
prerelease: false
|
268
388
|
version_requirements: !ruby/object:Gem::Requirement
|
269
389
|
requirements:
|
270
390
|
- - "~>"
|
271
391
|
- !ruby/object:Gem::Version
|
272
|
-
version: '
|
273
|
-
description: Rails v8 ActiveSupport::TaggedLogging backported to Rails v5.2+
|
274
|
-
2.7+
|
392
|
+
version: '3.0'
|
393
|
+
description: Rails v8 ActiveSupport::TaggedLogging, fixed & backported to Rails v5.2+
|
394
|
+
& Ruby 2.7+
|
275
395
|
email:
|
276
396
|
- peter.boling@gmail.com
|
277
397
|
executables: []
|
@@ -286,7 +406,6 @@ files:
|
|
286
406
|
- SECURITY.md
|
287
407
|
- lib/activesupport-tagged_logging.rb
|
288
408
|
- lib/activesupport/fix_pr_53105.rb
|
289
|
-
- lib/activesupport/isolated_execution_state.rb
|
290
409
|
- lib/activesupport/tagged_logging.rb
|
291
410
|
- lib/activesupport/tagged_logging/broadcasting.rb
|
292
411
|
- lib/activesupport/tagged_logging/version.rb
|
@@ -295,10 +414,10 @@ licenses:
|
|
295
414
|
- MIT
|
296
415
|
metadata:
|
297
416
|
homepage_uri: https://github.com/pboling/activesupport-tagged_logging
|
298
|
-
source_code_uri: https://github.com/pboling/activesupport-tagged_logging/tree/
|
299
|
-
changelog_uri: https://github.com/pboling/activesupport-tagged_logging/blob/
|
417
|
+
source_code_uri: https://github.com/pboling/activesupport-tagged_logging/tree/v2.0.0
|
418
|
+
changelog_uri: https://github.com/pboling/activesupport-tagged_logging/blob/v2.0.0/CHANGELOG.md
|
300
419
|
bug_tracker_uri: https://github.com/pboling/activesupport-tagged_logging/issues
|
301
|
-
documentation_uri: https://www.rubydoc.info/gems/activesupport-tagged_logging/
|
420
|
+
documentation_uri: https://www.rubydoc.info/gems/activesupport-tagged_logging/2.0.0
|
302
421
|
wiki_uri: https://github.com/pboling/activesupport-tagged_logging/wiki
|
303
422
|
funding_uri: https://liberapay.com/pboling
|
304
423
|
rubygems_mfa_required: 'true'
|
@@ -317,8 +436,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
317
436
|
- !ruby/object:Gem::Version
|
318
437
|
version: '0'
|
319
438
|
requirements: []
|
320
|
-
rubygems_version: 3.5.
|
439
|
+
rubygems_version: 3.5.23
|
321
440
|
signing_key:
|
322
441
|
specification_version: 4
|
323
|
-
summary: Rails v8 ActiveSupport::TaggedLogging backported to Rails v5.2+
|
442
|
+
summary: Rails v8 ActiveSupport::TaggedLogging, fixed & backported to Rails v5.2+
|
443
|
+
& Ruby 2.7+
|
324
444
|
test_files: []
|
metadata.gz.sig
CHANGED
Binary file
|
@@ -1,75 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module ActiveSupport
|
4
|
-
module IsolatedExecutionState # :nodoc:
|
5
|
-
@isolation_level = nil
|
6
|
-
|
7
|
-
Thread.attr_accessor(:active_support_execution_state)
|
8
|
-
Fiber.attr_accessor(:active_support_execution_state)
|
9
|
-
|
10
|
-
class << self
|
11
|
-
attr_reader :isolation_level, :scope
|
12
|
-
|
13
|
-
def isolation_level=(level)
|
14
|
-
return if level == @isolation_level
|
15
|
-
|
16
|
-
unless %i(thread fiber).include?(level)
|
17
|
-
raise ArgumentError, "isolation_level must be `:thread` or `:fiber`, got: `#{level.inspect}`"
|
18
|
-
end
|
19
|
-
|
20
|
-
clear if @isolation_level
|
21
|
-
|
22
|
-
@scope =
|
23
|
-
case level
|
24
|
-
when :thread then Thread
|
25
|
-
when :fiber then Fiber
|
26
|
-
end
|
27
|
-
|
28
|
-
@isolation_level = level
|
29
|
-
end
|
30
|
-
|
31
|
-
def unique_id
|
32
|
-
self[:__id__] ||= Object.new
|
33
|
-
end
|
34
|
-
|
35
|
-
def [](key)
|
36
|
-
state[key]
|
37
|
-
end
|
38
|
-
|
39
|
-
def []=(key, value)
|
40
|
-
state[key] = value
|
41
|
-
end
|
42
|
-
|
43
|
-
def key?(key)
|
44
|
-
state.key?(key)
|
45
|
-
end
|
46
|
-
|
47
|
-
def delete(key)
|
48
|
-
state.delete(key)
|
49
|
-
end
|
50
|
-
|
51
|
-
def clear
|
52
|
-
state.clear
|
53
|
-
end
|
54
|
-
|
55
|
-
def context
|
56
|
-
scope.current
|
57
|
-
end
|
58
|
-
|
59
|
-
def share_with(other)
|
60
|
-
# Action Controller streaming spawns a new thread and copy thread locals.
|
61
|
-
# We do the same here for backward compatibility, but this is very much a hack
|
62
|
-
# and streaming should be rethought.
|
63
|
-
context.active_support_execution_state = other.active_support_execution_state.dup
|
64
|
-
end
|
65
|
-
|
66
|
-
private
|
67
|
-
|
68
|
-
def state
|
69
|
-
context.active_support_execution_state ||= {}
|
70
|
-
end
|
71
|
-
end
|
72
|
-
|
73
|
-
self.isolation_level = :thread
|
74
|
-
end
|
75
|
-
end
|