sanitize_email 2.0.8 → 2.0.9

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: f6ef5b657f6d07f549ff25ac616556c2ff879358dfb94300b532a5f119f76de8
4
- data.tar.gz: a0308990971eadb314ca264856b18b02a025ba280e10352b58d3ff80ef8e8b31
3
+ metadata.gz: 1167c24cc1aced77acaacde4efb9eda2c312eb2a367c9fabf6ce6745f17c86e9
4
+ data.tar.gz: c3b3fb56ecb69ef997e3c18d11a24410471aeda066e3cb89d572e8434e0f1a78
5
5
  SHA512:
6
- metadata.gz: 61b2e1f677658f2fd0bb713a2eab720e7d6fdfcd02ca1a2d90f6e0a52f396bf913e8438d2e26a0af38afbcaab13384a1b772f5fd18fafbb4fa1f206315b412e1
7
- data.tar.gz: ca8d289b27a29b4ba5542b2e19b3357789739103138a7d53be53e6f53dd46648ba09f0cb11bc2772be920c7b69144f05daa481f694751a96afa07b163755d917
6
+ metadata.gz: ba2aca4420833ee104c2973d55f241b8fed176799a03f61178df64072d390964da5bcbe81716f75757f85778e23b5b833fdb4eb3e44d001606abaebdbd683abb
7
+ data.tar.gz: ef649d7e9e03a9477be8dc505359481ae06aaeb99ebcf46bb2678db28fd971b38f8572b0c6d6357c4182003985124ea75854193dbc72b80e2011a6a68e81965f
checksums.yaml.gz.sig CHANGED
Binary file
data/CHANGELOG.md CHANGED
@@ -10,9 +10,17 @@ 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.9] - 2024-11-09 ([tag][2.0.9t])
14
+ - COVERAGE: 90.15% -- 247/274 lines in 8 files
15
+ - BRANCH COVERAGE: 71.68% -- 81/113 branches in 8 files
16
+ - 61.73% documented
17
+ ### Added
18
+ * More & better documentation
19
+ * Rails 8.0 to CI
20
+
13
21
  ## [2.0.8] - 2024-06-11 ([tag][2.0.8t])
14
22
  ### Fixed
15
- # [#110](https://github.com/pboling/sanitize_email/issues/110) - interceptor not working via Rails 6+ engine (actual fix!)
23
+ * [#110](https://github.com/pboling/sanitize_email/issues/110) - interceptor not working via Rails 6+ engine (actual fix!)
16
24
 
17
25
  ## [2.0.7] - 2024-04-25 ([tag][2.0.7t])
18
26
  ### Added
@@ -20,7 +28,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
20
28
  ### Changed
21
29
  * Documentation is now via yard instead of rdoc
22
30
  ### Fixed
23
- # [#110](https://github.com/pboling/sanitize_email/issues/110) - interceptor not working via Rails 6+ engine
31
+ * [#110](https://github.com/pboling/sanitize_email/issues/110) - interceptor not working via Rails 6+ engine
24
32
 
25
33
  ## [2.0.6] - 2024-04-25 ([tag][2.0.6t])
26
34
  ### Added
@@ -303,7 +311,9 @@ Old version?
303
311
  * Fixed require paths
304
312
  * added about.yml and this CHANGELOG
305
313
 
306
- [Unreleased]: https://github.com/pboling/sanitize_email/compare/v2.0.8...HEAD
314
+ [Unreleased]: https://github.com/pboling/sanitize_email/compare/v2.0.9...HEAD
315
+ [2.0.9]: https://github.com/pboling/sanitize_email/compare/v2.0.8...v2.0.9
316
+ [2.0.9t]: https://github.com/pboling/sanitize_email/tags/v2.0.9
307
317
  [2.0.8]: https://github.com/pboling/sanitize_email/compare/v2.0.7...v2.0.8
308
318
  [2.0.8t]: https://github.com/pboling/sanitize_email/tags/v2.0.8
309
319
  [2.0.7]: https://github.com/pboling/sanitize_email/compare/v2.0.6...v2.0.7
data/CONTRIBUTING.md CHANGED
@@ -7,41 +7,50 @@ the [code of conduct][🤝conduct].
7
7
  To submit a patch, please fork the project and create a patch with tests. Once you're happy with it send a pull request
8
8
  and post a message to the [gitter chat][🏘chat].
9
9
 
10
+ ### Find a smell to fix
11
+
12
+ bundle exec rake reek
13
+
10
14
  ## Appraisal & Combustion
11
15
 
12
16
  ### Generate a new set of Appraisal gemfiles:
13
17
 
14
- ```sh
15
- BUNDLE_GEMFILE=gemfiles/vanilla.gemfile appraisal generate
16
- ```
18
+ BUNDLE_GEMFILE=gemfiles/vanilla.gemfile appraisal generate
19
+
20
+ NOTE: This results in bad paths to the gemspec from each of the appraisal `gemfiles/rails_*_*.gemfile` files.
21
+ `gemspec path: "../../"` needs to be replaced with `gemspec path: "../"` in each Appraisal gemfile.
17
22
 
18
23
  ## Release
19
24
 
20
- To release a new version:
25
+ ### One-time, Per-developer, Setup
26
+
27
+ **IMPORTANT**: Your public key for signing gems will need to be picked up by the line in the
28
+ `gemspec` defining the `spec.cert_chain` (check the relevant ENV variables there),
29
+ in order to sign the new release.
30
+ See: [RubyGems Security Guide][🔒️rubygems-security-guide]
31
+
32
+ ### To release a new version:
21
33
 
22
34
  1. Run `bin/setup && bin/rake` as a tests, coverage, & linting sanity check
23
35
  2. Update the version number in `version.rb`
24
36
  3. Run `bin/setup && bin/rake` again as a secondary check, and to update `Gemfile.lock`
25
37
  4. Run `git commit -am "🔖 Prepare release v<VERSION>"` to commit the changes
26
38
  5. Run `git push` to trigger the final CI pipeline before release, & merge PRs
27
- a. NOTE: Remember to [check the build][🧪build]!
28
- 6. Run `git checkout main`
29
- 7. Run `git pull origin main` to ensure you will release the latest trunk code.
30
- 8. Set `SOURCE_DATE_EPOCH` so `rake build` and `rake release` use same timestamp, and generate same checksums
31
- a. Run `export SOURCE_DATE_EPOCH=$EPOCHSECONDS && echo $SOURCE_DATE_EPOCH`
32
- b. If the echo above has no output, then it didn't work.
33
- c. Note that you'll need the `zsh/datetime` module, if running `zsh`.
34
- d. In `bash` you can use `date +%s` instead, i.e. `export SOURCE_DATE_EPOCH=$(date +%s) && echo $SOURCE_DATE_EPOCH`
35
- 9. Run `bundle exec rake build`
36
- 10. Run [`bin/checksums`][🔒️rubygems-checksums-pr] to create SHA-256 and SHA-512 checksums
37
- a. Checksums will be committed automatically by the script, but not pushed
38
- 11. Run `bundle exec rake release` which will create a git tag for the version,
39
+ - NOTE: Remember to [check the build][🧪build]!
40
+ 6. Run `export GIT_TRUNK_BRANCH_NAME="$(git remote show origin | grep 'HEAD branch' | cut -d ' ' -f5)" && echo $GIT_TRUNK_BRANCH_NAME`
41
+ 7. Run `git checkout $GIT_TRUNK_BRANCH_NAME`
42
+ 8. Run `git pull origin $GIT_TRUNK_BRANCH_NAME` to ensure you will release the latest trunk code
43
+ 9. Set `SOURCE_DATE_EPOCH` so `rake build` and `rake release` use same timestamp, and generate same checksums
44
+ - Run `export SOURCE_DATE_EPOCH=$EPOCHSECONDS && echo $SOURCE_DATE_EPOCH`
45
+ - If the echo above has no output, then it didn't work.
46
+ - Note that you'll need the `zsh/datetime` module, if running `zsh`.
47
+ - In `bash` you can use `date +%s` instead, i.e. `export SOURCE_DATE_EPOCH=$(date +%s) && echo $SOURCE_DATE_EPOCH`
48
+ 10. Run `bundle exec rake build`
49
+ 11. Run `bin/checksums` (more [context][🔒️rubygems-checksums-pr]) to create SHA-256 and SHA-512 checksums
50
+ - Checksums will be committed automatically by the script, but not pushed
51
+ 12. Run `bundle exec rake release` which will create a git tag for the version,
39
52
  push git commits and tags, and push the `.gem` file to [rubygems.org][💎rubygems]
40
53
 
41
- NOTE: You will need to have a public key in `certs/`, and list your cert in the
42
- `gemspec`, in order to sign the new release.
43
- See: [RubyGems Security Guide][🔒️rubygems-security-guide]
44
-
45
54
  ## Contributors
46
55
 
47
56
  [![Contributors][🖐contributors-img]][🖐contributors]
data/README.md CHANGED
@@ -1,55 +1,74 @@
1
1
  # sanitize_email
2
2
 
3
- <div id="badges">
4
-
5
- [![CI Build][🚎dl-cwfi]][🚎dl-cwf]
3
+ [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)
4
+ [![Version](https://img.shields.io/gem/v/sanitize_email.svg)](https://rubygems.org/gems/sanitize_email)
5
+ [![Downloads Today](https://img.shields.io/gem/rd/sanitize_email.svg)](https://github.com/pboling/sanitize_email)
6
+ [![Depfu][🔑depfui]][🔑depfu]
7
+ [![CodeCov][🖇codecov-img♻️]][🖇codecov]
6
8
  [![Test Coverage][🔑cc-covi]][🔑cc-cov]
7
9
  [![Maintainability][🔑cc-mnti]][🔑cc-mnt]
8
- [![Depfu][🔑depfui]][🔑depfu]
9
-
10
- [🚎dl-cwf]: https://github.com/pboling/sanitize_email/actions/workflows/supported.yml
11
- [🚎dl-cwfi]: https://github.com/pboling/sanitize_email/actions/workflows/supported.yml/badge.svg
12
-
13
- [comment]: <> ( 🔑 KEYED LINKS )
14
-
15
- [🔑cc-mnt]: https://codeclimate.com/github/pboling/sanitize_email/maintainability
16
- [🔑cc-mnti]: https://api.codeclimate.com/v1/badges/65af4948d859903a0372/maintainability
17
- [🔑cc-cov]: https://codeclimate.com/github/pboling/sanitize_email/test_coverage
18
- [🔑cc-covi]: https://api.codeclimate.com/v1/badges/65af4948d859903a0372/test_coverage
19
- [🔑depfu]: https://depfu.com/github/pboling/sanitize_email
20
- [🔑depfui]: https://badges.depfu.com/badges/bba430e8f19a2ba3273fb20d5e8c82d6/count.svg
10
+ [![CI Supported Build][🚎s-wfi]][🚎s-wf]
11
+ [![CI Unsupported Build][🚎us-wfi]][🚎us-wf]
12
+ [![CI Style Build][🚎st-wfi]][🚎st-wf]
13
+ [![CI Coverage Build][🚎cov-wfi]][🚎cov-wf]
14
+ [![CI Heads Build][🚎hd-wfi]][🚎hd-wf]
15
+ [![CI Ancient Build][🚎an-wfi]][🚎an-wf]
16
+
17
+ [🖇codecov-img♻️]: https://codecov.io/gh/pboling/sanitize_email/graph/badge.svg?token=selEoMrZzA
18
+ [🖇codecov]: https://codecov.io/gh/pboling/sanitize_email
19
+ [🚎s-wf]: https://github.com/pboling/sanitize_email/actions/workflows/supported.yml
20
+ [🚎s-wfi]: https://github.com/pboling/sanitize_email/actions/workflows/supported.yml/badge.svg
21
+ [🚎us-wf]: https://github.com/pboling/sanitize_email/actions/workflows/unsupported.yml
22
+ [🚎us-wfi]: https://github.com/pboling/sanitize_email/actions/workflows/unsupported.yml/badge.svg
23
+ [🚎st-wf]: https://github.com/pboling/sanitize_email/actions/workflows/style.yml
24
+ [🚎st-wfi]: https://github.com/pboling/sanitize_email/actions/workflows/style.yml/badge.svg
25
+ [🚎cov-wf]: https://github.com/pboling/sanitize_email/actions/workflows/coverage.yml
26
+ [🚎cov-wfi]: https://github.com/pboling/sanitize_email/actions/workflows/coverage.yml/badge.svg
27
+ [🚎hd-wf]: https://github.com/pboling/sanitize_email/actions/workflows/heads.yml
28
+ [🚎hd-wfi]: https://github.com/pboling/sanitize_email/actions/workflows/heads.yml/badge.svg
29
+ [🚎an-wf]: https://github.com/pboling/sanitize_email/actions/workflows/ancient.yml
30
+ [🚎an-wfi]: https://github.com/pboling/sanitize_email/actions/workflows/ancient.yml/badge.svg
21
31
 
22
32
  -----
23
33
 
24
34
  [![Liberapay Patrons][⛳liberapay-img]][⛳liberapay]
25
35
  [![Sponsor Me on Github][🖇sponsor-img]][🖇sponsor]
26
-
27
- <span class="badge-buymeacoffee">
28
- <a href="https://ko-fi.com/O5O86SNP4" target='_blank' title="Donate to my FLOSS or refugee efforts at ko-fi.com"><img src="https://img.shields.io/badge/buy%20me%20coffee-donate-yellow.svg" alt="Buy me coffee donation button" /></a>
29
- </span>
30
- <span class="badge-patreon">
31
- <a href="https://patreon.com/galtzo" title="Donate to my FLOSS or refugee efforts using Patreon"><img src="https://img.shields.io/badge/patreon-donate-yellow.svg" alt="Patreon donate button" /></a>
32
- </span>
33
-
34
- </div>
36
+ [![Polar Shield][🖇polar-img]][🖇polar]
37
+ [![Donate to my FLOSS or refugee efforts at ko-fi.com][🖇kofi-img]][🖇kofi]
38
+ [![Donate to my FLOSS or refugee efforts using Patreon][🖇patreon-img]][🖇patreon]
35
39
 
36
40
  [⛳liberapay-img]: https://img.shields.io/liberapay/patrons/pboling.svg?logo=liberapay
37
41
  [⛳liberapay]: https://liberapay.com/pboling/donate
38
42
  [🖇sponsor-img]: https://img.shields.io/badge/Sponsor_Me!-pboling.svg?style=social&logo=github
39
43
  [🖇sponsor]: https://github.com/sponsors/pboling
44
+ [🖇polar-img]: https://polar.sh/embed/seeks-funding-shield.svg?org=pboling
45
+ [🖇polar]: https://polar.sh/pboling
46
+ [🖇kofi-img]: https://img.shields.io/badge/buy%20me%20coffee-donate-yellow.svg
47
+ [🖇kofi]: https://ko-fi.com/O5O86SNP4
48
+ [🖇patreon-img]: https://img.shields.io/badge/patreon-donate-yellow.svg
49
+ [🖇patreon]: https://patreon.com/galtzo
50
+
51
+ [comment]: <> ( 🔑 KEYED LINKS )
52
+
53
+ [🔑cc-mnt]: https://codeclimate.com/github/pboling/sanitize_email/maintainability
54
+ [🔑cc-mnti]: https://api.codeclimate.com/v1/badges/65af4948d859903a0372/maintainability
55
+ [🔑cc-cov]: https://codeclimate.com/github/pboling/sanitize_email/test_coverage
56
+ [🔑cc-covi]: https://api.codeclimate.com/v1/badges/65af4948d859903a0372/test_coverage
57
+ [🔑depfu]: https://depfu.com/github/pboling/sanitize_email
58
+ [🔑depfui]: https://badges.depfu.com/badges/bba430e8f19a2ba3273fb20d5e8c82d6/count.svg
40
59
 
41
60
  This gem allows you to override your mail delivery settings, globally or in a local context.
42
61
  It is like a Ruby encrusted condom for your email server,
43
62
  just in case it decides to have intercourse with other servers via sundry mail protocols.
44
63
 
45
- Seriously though, this gem solves similar problems as the excellent [`mailcatcher`](https://mailcatcher.me/) gem,
46
- and mailcatcher solves those problems far more easily.
64
+ Seriously though, this gem solves similar problems as the excellent [mailcatcher](https://mailcatcher.me/) gem,
65
+ and `mailcatcher` solves those problems far more easily.
47
66
 
48
- In addition, this gem solves problems that mailcatcher does not solve. I recommend using both!
67
+ In addition, this gem solves problems that `mailcatcher` does not solve. I recommend using both!
49
68
 
50
69
  To make an analogy, `mailcatcher` is akin to `webmock`, entirely preventing interaction with your real live mail server,
51
- while this gem allows you to effectively use your real live (production!) mail server, while
52
- intercepting and modifying recipeients on the way out, so that testing emails go to safe locations.
70
+ while this gem allows you to effectively use your real live (production!) mail server, while
71
+ intercepting and modifying recipients on the way out, so that testing emails go to safe locations.
53
72
 
54
73
  It is a bit like using the "test" Visa credit card number `4701322211111234` with a real payment gateway.
55
74
 
@@ -71,7 +90,7 @@ then this is the gem for you.
71
90
  - ⚙️ Compatible with [`sendgrid-actionmailer`](https://github.com/eddiezane/sendgrid-actionmailer)'s support for personalizations, and will override email addresses there according to the configuration.
72
91
  - ⚙️ If this gem is not compatible with your use case, and you'd like it to be, I'd like to hear about it!
73
92
 
74
- It was a slog getting (very nearly) the entire compatibility matrix working with Github Actions, [`appraisal`](https://github.com/thoughtbot/appraisal), and [`combustion`](https://github.com/pat/combustion), and I'm very interested in hearing about ways to improve it!
93
+ It was a slog getting (very nearly) the entire compatibility matrix working with Github Actions, [appraisal](https://github.com/thoughtbot/appraisal), and [combustion](https://github.com/pat/combustion), and I'm very interested in hearing about ways to improve it!
75
94
 
76
95
  ## 🛞 DVCS
77
96
 
@@ -120,15 +139,14 @@ appended indicators:
120
139
  ♻️ / 🔑 - Tagged URLs need to be updated from SAAS integration. Find / Replace is insufficient.
121
140
  -->
122
141
 
123
- | | Project | bundle add sanitize_email |
124
- |:----|--------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
125
- | 1️⃣ | name, license, docs, standards | [![RubyGems.org][⛳️name-img]][⛳️gem] [![License: MIT][🖇src-license-img]][🖇src-license] [![RubyDoc.info][🚎yard-img]][🚎yard] [![YARD Documentation](http://inch-ci.org/github/pboling/sanitize_email.svg)][🚎yard] [![SemVer 2.0.0][🧮semver-img]][🧮semver] [![Keep-A-Changelog 1.0.0][📗keep-changelog-img]][📗keep-changelog] |
126
- | 2️⃣ | version & activity | [![Gem Version][⛳️version-img]][⛳️gem] [![Total Downloads][🖇DL-total-img]][⛳️gem] [![Download Rank][🏘DL-rank-img]][⛳️gem] [![Source Code][🚎src-main-img]][🚎src-main] [![Open PRs][🖐prs-o-img]][🖐prs-o] [![Closed PRs][🧮prs-c-img]][🧮prs-c] |
127
- | 3️⃣ | maintenance & linting | [![Maintainability][🔑cc-mnti]][🔑cc-mnt] [![Helpers][🖇triage-help-img]][🖇triage-help] [![Depfu][🔑depfui]][🔑depfu] [![Contributors][🚎contributors-img]][🚎contributors] [![Style][🖐style-wf-img]][🖐style-wf] |
128
- | 4️⃣ | testing | [![Supported][🏘sup-wf-img]][🏘sup-wf] [![Heads][🚎heads-wf-img]][🚎heads-wf] [![Heads][🖐uns-wf-img]][🖐uns-wf] |
129
- | 5️⃣ | coverage & security | [![CodeClimate][🔑cc-covi]][🔑cc-cov] [![CodeCov][🖇codecov-img♻️]][🖇codecov] [![Coveralls][🏘coveralls-img]][🏘coveralls] [![Security Policy][🚎sec-pol-img]][🚎sec-pol] [![CodeQL][🖐codeQL-img]][🖐codeQL] [![Code Coverage][🧮cov-wf-img]][🧮cov-wf] |
130
- | 6️⃣ | resources | [![Get help on Codementor][🖇codementor-img]][🖇codementor] [![Chat][🏘chat-img]][🏘chat] [![Blog][🚎blog-img]][🚎blog] [![Wiki][🖐wiki-img]][🖐wiki] |
131
- | 7️⃣ | `...` 💖 | [![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] |
142
+ | | Project | bundle add sanitize_email |
143
+ |:----|--------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
144
+ | 1️⃣ | name, license, docs, standards | [![RubyGems.org][⛳️name-img]][⛳️gem] [![License: MIT][🖇src-license-img]][🖇src-license] [![RubyDoc.info][🚎yard-img]][🚎yard] [![YARD Documentation](http://inch-ci.org/github/pboling/sanitize_email.svg)][🚎yard] [![SemVer 2.0.0][🧮semver-img]][🧮semver] [![Keep-A-Changelog 1.0.0][📗keep-changelog-img]][📗keep-changelog] |
145
+ | 2️⃣ | version & activity | [![Gem Version][⛳️version-img]][⛳️gem] [![Total Downloads][🖇DL-total-img]][⛳️gem] [![Download Rank][🏘DL-rank-img]][⛳️gem] [![Source Code][🚎src-main-img]][🚎src-main] [![Open PRs][🖐prs-o-img]][🖐prs-o] [![Closed PRs][🧮prs-c-img]][🧮prs-c] |
146
+ | 3️⃣ | maintenance & linting | [![Helpers][🖇triage-help-img]][🖇triage-help] [![Depfu][🔑depfui]][🔑depfu] [![Contributors][🚎contributors-img]][🚎contributors] |
147
+ | 4️⃣ | coverage & security | [![CodeCov][🖇codecov-img♻️]][🖇codecov] [![Coveralls][🏘coveralls-img]][🏘coveralls] [![Security Policy][🚎sec-pol-img]][🚎sec-pol] [![CodeQL][🖐codeQL-img]][🖐codeQL] |
148
+ | 5️⃣ | resources | [![Get help on Codementor][🖇codementor-img]][🖇codementor] [![Chat][🏘chat-img]][🏘chat] [![Blog][🚎blog-img]][🚎blog] [![Wiki][🖐wiki-img]][🖐wiki] |
149
+ | 6️⃣ | `...` 💖 | [![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] |
132
150
 
133
151
  <!--
134
152
  The link tokens in the following sections should be kept ordered by the row and badge numbering scheme
@@ -162,21 +180,8 @@ The link tokens in the following sections should be kept ordered by the row and
162
180
  [🖇triage-help-img]: https://www.codetriage.com/pboling/sanitize_email/badges/users.svg
163
181
  [🚎contributors]: https://gitlab.com/pboling/sanitize_email/-/graphs/main
164
182
  [🚎contributors-img]: https://img.shields.io/github/contributors-anon/pboling/sanitize_email
165
- [🖐style-wf]: https://github.com/pboling/sanitize_email/actions/workflows/style.yml
166
- [🖐style-wf-img]: https://github.com/pboling/sanitize_email/actions/workflows/style.yml/badge.svg
167
- <!-- TODO: tokei/lines shields badge is broken -->
168
- [🧮kloc]: https://www.youtube.com/watch?v=dQw4w9WgXcQ
169
- [🧮kloc-img]: https://img.shields.io/tokei/lines/github.com/pboling/sanitize_email
170
-
171
- <!-- 4️⃣ testing -->
172
- [🏘sup-wf]: https://github.com/pboling/sanitize_email/actions/workflows/supported.yml
173
- [🏘sup-wf-img]: https://github.com/pboling/sanitize_email/actions/workflows/supported.yml/badge.svg
174
- [🚎heads-wf]: https://github.com/pboling/sanitize_email/actions/workflows/heads.yml
175
- [🚎heads-wf-img]: https://github.com/pboling/sanitize_email/actions/workflows/heads.yml/badge.svg
176
- [🖐uns-wf]: https://github.com/pboling/sanitize_email/actions/workflows/unsupported.yml
177
- [🖐uns-wf-img]: https://github.com/pboling/sanitize_email/actions/workflows/unsupported.yml/badge.svg
178
-
179
- <!-- 5️⃣ coverage & security -->
183
+
184
+ <!-- 4️⃣ coverage & security -->
180
185
  [🖇codecov-img♻️]: https://codecov.io/gh/pboling/sanitize_email/graph/badge.svg?token=Joire8DbSW
181
186
  [🖇codecov]: https://codecov.io/gh/pboling/sanitize_email
182
187
  [🏘coveralls]: https://coveralls.io/github/pboling/sanitize_email?branch=main
@@ -185,10 +190,8 @@ The link tokens in the following sections should be kept ordered by the row and
185
190
  [🚎sec-pol-img]: https://img.shields.io/badge/security-policy-brightgreen.svg?style=flat
186
191
  [🖐codeQL]: https://github.com/pboling/sanitize_email/security/code-scanning
187
192
  [🖐codeQL-img]: https://github.com/pboling/sanitize_email/actions/workflows/codeql-analysis.yml/badge.svg
188
- [🧮cov-wf]: https://github.com/pboling/sanitize_email/actions/workflows/coverage.yml
189
- [🧮cov-wf-img]: https://github.com/pboling/sanitize_email/actions/workflows/coverage.yml/badge.svg
190
193
 
191
- <!-- 6️⃣ resources -->
194
+ <!-- 5️⃣ resources -->
192
195
  [🖇codementor]: https://www.codementor.io/peterboling?utm_source=github&utm_medium=button&utm_term=peterboling&utm_campaign=github
193
196
  [🖇codementor-img]: https://cdn.codementor.io/badges/get_help_github.svg
194
197
  [🏘chat]: https://gitter.im/pboling/sanitize_email
@@ -198,10 +201,10 @@ The link tokens in the following sections should be kept ordered by the row and
198
201
  [🖐wiki]: https://gitlab.com/pboling/sanitize_email/-/wikis/home
199
202
  [🖐wiki-img]: https://img.shields.io/badge/wiki-examples-brightgreen.svg?style=flat
200
203
 
201
- <!-- 7️⃣ spread 💖 -->
204
+ <!-- 6️⃣ spread 💖 -->
202
205
  [🐦tweet-img]: https://img.shields.io/twitter/follow/galtzo.svg?style=social&label=Follow%20%40galtzo
203
206
  [🐦tweet]: http://twitter.com/galtzo
204
- [🚎blog]: http://www.railsbling.com/tags/debug_logging/
207
+ [🚎blog]: http://www.railsbling.com/tags/sanitize_email/
205
208
  [🚎blog-img]: https://img.shields.io/badge/blog-railsbling-brightgreen.svg?style=flat
206
209
  [🖇linkedin]: http://www.linkedin.com/in/peterboling
207
210
  [🖇linkedin-img]: https://img.shields.io/badge/PeterBoling-blue?style=plastic&logo=linkedin
@@ -244,7 +247,7 @@ It's particularly helpful when you want to prevent the delivery of email (e.g. i
244
247
 
245
248
  ## Re-routing Email on a Staging or QA Server
246
249
 
247
- Another very important use case for me is to transparently re-route email generated from a staging or QA server to an appropriate person. For example, it's common for us to set up a staging server for a client to use to view our progress and test out new features. It's important for any email that is generated from our web application be delivered to the client's inbox so that they can review the content and ensure that it's acceptable. Similarly, we set up QA instances for our own QA team and we use [rails-caddy](http://github.com/jtrupiano/rails-caddy) to allow each QA person to configure it specifically for them.
250
+ Another very important use case for me is to transparently re-route email generated from a staging or QA server to an appropriate person. For example, it's common for us to set up a staging server for a client to use to view our progress and test out new features. It's important for any email that is generated from our web application be delivered to the client's inbox so that they can review the content and ensure that it's acceptable. `dotenv` or `direnv` allows each developer to configure the local behavior specifically for them via ENV vars.
248
251
 
249
252
  ## Testing Email from a Hot Production Server
250
253
 
@@ -264,47 +267,35 @@ SanitizeEmail comes with some lightweight RspecMatchers covering most of what em
264
267
 
265
268
  In Gemfile:
266
269
 
267
- ```ruby
268
- gem 'sanitize_email'
269
- ```
270
+ gem 'sanitize_email'
270
271
 
271
272
  Then:
272
273
 
273
- ```bash
274
- $ bundle install
275
- ```
274
+ bundle install
276
275
 
277
276
  ## Setup with Ruby
278
277
 
279
- *keep scrolling for Rails, but read this for a better understanding of Magic*
278
+ _keep scrolling for Rails, but read this for a better understanding of Magic_
280
279
 
281
280
  There are three ways SanitizeEmail can be turned on; in order of precedence they are:
282
281
 
283
282
  1. Only useful for local context. Inside a method where you will be sending an email, set `SanitizeEmail.force_sanitize = true` just prior to delivering it. Also useful in the console.
284
283
 
285
- ```ruby
286
- SanitizeEmail.force_sanitize = true # by default it is nil
287
- ```
284
+ SanitizeEmail.force_sanitize = true # by default it is nil
288
285
 
289
286
  2. If SanitizeEmail seems to not be sanitizing you have probably not registered the interceptor. SanitizeEmail tries to do this for you. *Note*: If you are working in an environment that has a Mail or Mailer class that uses the register_interceptor API, the interceptor will already have been registered by SanitizeEmail:
290
287
 
291
- ```ruby
292
- # The gem will probably have already done this for you, but some really old versions of Rails may need you to do this manually:
293
- Mail.register_interceptor(SanitizeEmail::Bleach)
294
- ```
288
+ # The gem will probably have already done this for you, but some really old versions of Rails may need you to do this manually:
289
+ Mail.register_interceptor(SanitizeEmail::Bleach)
295
290
 
296
- Once registered, SanitizeEmail needs to be engaged:
291
+ Once registered, SanitizeEmail needs to be engaged:
297
292
 
298
- ```ruby
299
- # in config/initializers/sanitize_email.rb
300
- SanitizeEmail::Config.configure {|config| config[:engage] = true }
301
- ```
293
+ # in config/initializers/sanitize_email.rb
294
+ SanitizeEmail::Config.configure { |config| config[:engage] = true }
302
295
 
303
296
  3. If you don't need to compute anything, then don't use this option, go with the previous option.
304
297
 
305
- ```ruby
306
- SanitizeEmail::Config.configure {|config| config[:activation_proc] = Proc.new { true } } # by default :activation_proc is false
307
- ```
298
+ SanitizeEmail::Config.configure { |config| config[:activation_proc] = proc { true } } # by default :activation_proc is false
308
299
 
309
300
  ### Examples
310
301
 
@@ -313,13 +304,14 @@ There are three ways SanitizeEmail can be turned on; in order of precedence they
313
304
  This works by ensuring that all recipients have the "allowed" domain.
314
305
  In other words, none of the recipients have a domain other than the allowed domain.
315
306
 
316
- ```ruby
317
- ALLOWED_DOMAIN = 'example.com'
318
- # NOTE: you may need to check CC and BCC also, depending on your use case...
319
- config[:activation_proc] = ->(message) do
320
- !Array(message.to).any? { |recipient| Mail::Address.new(recipient).domain != ALLOWED_DOMAIN }
321
- end
322
- ```
307
+ allowed_domain = "example.com"
308
+ # NOTE: you may need to check CC and BCC also, depending on your use case...
309
+ SanitizeEmail::Config.configure do |config|
310
+ config[:activation_proc] =
311
+ ->(message) do
312
+ !Array(message.to).any? { |recipient| Mail::Address.new(recipient).domain != allowed_domain }
313
+ end
314
+ end
323
315
 
324
316
  ### Notes
325
317
 
@@ -330,11 +322,9 @@ If installed but not configured, sanitize_email DOES NOTHING. Until configured
330
322
 
331
323
  IMPORTANT: You may need to setup your own register_interceptor. If sanitize_email doesn't seem to be working for you find your Mailer/Mail class and try this:
332
324
 
333
- ```ruby
334
- # in config/initializers/sanitize_email.rb
335
- Mail.register_interceptor(SanitizeEmail::Bleach)
336
- SanitizeEmail::Config.configure {|config| config[:engage] = true }
337
- ```
325
+ # in config/initializers/sanitize_email.rb
326
+ Mail.register_interceptor(SanitizeEmail::Bleach)
327
+ SanitizeEmail::Config.configure { |config| config[:engage] = true }
338
328
 
339
329
  If that causes an error you will know why sanitize_email doesn't work.
340
330
  Otherwise it will start working according to the rest of the configuration.
@@ -343,18 +333,16 @@ Otherwise it will start working according to the rest of the configuration.
343
333
 
344
334
  Create an initializer, if you are using rails, or otherwise configure:
345
335
 
346
- ```ruby
347
- SanitizeEmail::Config.configure do |config|
348
- config[:sanitized_to] = 'to@sanitize_email.org'
349
- config[:sanitized_cc] = 'cc@sanitize_email.org'
350
- config[:sanitized_bcc] = 'bcc@sanitize_email.org'
351
- # run/call whatever logic should turn sanitize_email on and off in this Proc:
352
- config[:activation_proc] = Proc.new { %w(development test).include?(Rails.env) }
353
- config[:use_actual_email_prepended_to_subject] = true # or false
354
- config[:use_actual_environment_prepended_to_subject] = true # or false
355
- config[:use_actual_email_as_sanitized_user_name] = true # or false
356
- end
357
- ```
336
+ SanitizeEmail::Config.configure do |config|
337
+ config[:sanitized_to] = "to@sanitize_email.org"
338
+ config[:sanitized_cc] = "cc@sanitize_email.org"
339
+ config[:sanitized_bcc] = "bcc@sanitize_email.org"
340
+ # run/call whatever logic should turn sanitize_email on and off in this Proc:
341
+ config[:activation_proc] = proc { %w(development test).include?(Rails.env) }
342
+ config[:use_actual_email_prepended_to_subject] = true # or false
343
+ config[:use_actual_environment_prepended_to_subject] = true # or false
344
+ config[:use_actual_email_as_sanitized_user_name] = true # or false
345
+ end
358
346
 
359
347
  Keep in mind, this is ruby (and possibly rails), so you can add conditionals or utilize different environment.rb files to customize these settings on a per-environment basis.
360
348
 
@@ -366,9 +354,7 @@ Let's say you have a method in your model that you can call to test the signup e
366
354
 
367
355
  To override the environment based switch use `force_sanitize`, which is normally `nil`, and ignored by default. When set to `true` or `false` it will turn sanitization on or off:
368
356
 
369
- ```ruby
370
- SanitizeEmail.force_sanitize = true
371
- ```
357
+ SanitizeEmail.force_sanitize = true
372
358
 
373
359
  When testing your email in a console, you can manipulate how email will be handled in this way.
374
360
 
@@ -376,31 +362,28 @@ There are also two methods that take a block and turn SanitizeEmail on or off (s
376
362
 
377
363
  Regardless of the Config settings of SanitizeEmail you can do a local override to force unsanitary email in any environment.
378
364
 
379
- ```ruby
380
- SanitizeEmail.unsanitary do
381
- Mail.deliver do
382
- from 'from@example.org'
383
- to 'to@example.org' # Will actually be sent to the specified address, not sanitized
384
- reply_to 'reply_to@example.org'
385
- subject 'subject'
386
- end
387
- end
388
- ```
365
+ SanitizeEmail.unsanitary do
366
+ Mail.deliver do
367
+ from "from@example.org"
368
+ to "to@example.org" # Will actually be sent to the specified address, not sanitized
369
+ reply_to "reply_to@example.org"
370
+ subject "subject"
371
+ end
372
+ end
389
373
 
390
374
  Regardless of the Config settings of SanitizeEmail you can do a local override to send sanitary email in any environment.
391
375
  You have access to all the same configuration options in the parameter hash as you can set in the actual
392
376
  `SanitizeEmail.configure` block.
393
377
 
394
- ```ruby
395
- SanitizeEmail.sanitary({:sanitized_to => 'boo@example.com'}) do # these config options are merged with the globals
396
- Mail.deliver do
397
- from 'from@example.org'
398
- to 'to@example.org' # Will actually be sent to the override addresses, in this case: boo@example.com
399
- reply_to 'reply_to@example.org'
400
- subject 'subject'
401
- end
402
- end
403
- ```
378
+
379
+ SanitizeEmail.sanitary({sanitized_to: "boo@example.com"}) do # these config options are merged with the globals
380
+ Mail.deliver do
381
+ from "from@example.org"
382
+ to "to@example.org" # Will actually be sent to the override addresses, in this case: boo@example.com
383
+ reply_to "reply_to@example.org"
384
+ subject "subject"
385
+ end
386
+ end
404
387
 
405
388
  ## Configuration Options
406
389
 
@@ -438,73 +421,64 @@ so I doubt I'll ever have a reason to make it "more" thread safe than it is now,
438
421
 
439
422
  In your `spec_helper.rb`:
440
423
 
441
- ```ruby
442
- require 'sanitize_email'
443
- # rspec matchers are *not* loaded by default in sanitize_email, as it is not primarily a gem for test suites.
444
- require 'sanitize_email/rspec_matchers'
445
-
446
- SanitizeEmail::Config.configure do |config|
447
- config[:sanitized_to] = 'sanitize_email@example.org'
448
- config[:sanitized_cc] = 'sanitize_email@example.org'
449
- config[:sanitized_bcc] = 'sanitize_email@example.org'
450
- # run/call whatever logic should turn sanitize_email on and off in this Proc.
451
- # config[:activation_proc] = Proc.new { true }
452
- # Since this configuration is *inside* the spec_helper, it might be assumed that we always want to sanitize. If we don't want to it can be easily manipulated with SanitizeEmail.unsanitary and SanitizeEmail.sanitary block helpers.
453
- # Thus instead of using the Proc (slower) we just engage it always:
454
- config[:engage] = true
455
- config[:use_actual_email_prepended_to_subject] = true # or false
456
- config[:use_actual_environment_prepended_to_subject] = true # or false
457
- config[:use_actual_email_as_sanitized_user_name] = true # or false
458
- end
459
-
460
- # If your mail system is not one that sanitize_email automatically configures an interceptor for (ActionMailer, Mail)
461
- # then you will need to do the equivalent for whatever Mail system you are using.
462
-
463
- RSpec.configure do |config|
464
- # ...
465
- # From sanitize_email gem
466
- config.include SanitizeEmail::RspecMatchers
467
- end
468
-
469
- context "an email test" do
470
- subject { Mail.deliver(@message_hash) }
471
- it { should have_to "sanitize_email@example.org" }
472
- end
473
- ```
424
+
425
+ require "sanitize_email"
426
+ # rspec matchers are *not* loaded by default in sanitize_email, as it is not primarily a gem for test suites.
427
+ require "sanitize_email/rspec_matchers"
428
+
429
+ SanitizeEmail::Config.configure do |config|
430
+ config[:sanitized_to] = "sanitize_email@example.org"
431
+ config[:sanitized_cc] = "sanitize_email@example.org"
432
+ config[:sanitized_bcc] = "sanitize_email@example.org"
433
+ # run/call whatever logic should turn sanitize_email on and off in this Proc.
434
+ # config[:activation_proc] = Proc.new { true }
435
+ # Since this configuration is *inside* the spec_helper, it might be assumed that we always want to sanitize. If we don't want to it can be easily manipulated with SanitizeEmail.unsanitary and SanitizeEmail.sanitary block helpers.
436
+ # Thus instead of using the Proc (slower) we just engage it always:
437
+ config[:engage] = true
438
+ config[:use_actual_email_prepended_to_subject] = true # or false
439
+ config[:use_actual_environment_prepended_to_subject] = true # or false
440
+ config[:use_actual_email_as_sanitized_user_name] = true # or false
441
+ end
442
+
443
+ # If your mail system is not one that sanitize_email automatically configures an interceptor for (ActionMailer, Mail)
444
+ # then you will need to do the equivalent for whatever Mail system you are using.
445
+
446
+ RSpec.configure do |config|
447
+ # ...
448
+ # From sanitize_email gem
449
+ config.include(SanitizeEmail::RspecMatchers)
450
+ end
451
+
452
+ context "an email test" do
453
+ subject { Mail.deliver(@message_hash) }
454
+ it { should have_to("sanitize_email@example.org") }
455
+ end
474
456
 
475
457
  #### have_* matchers
476
458
 
477
459
  These will look for an email address in any of the following mail attributes:
478
460
 
479
- ```ruby
480
- [:from, :to, :cc, :bcc, :subject, :reply_to]
481
- ```
461
+ [:from, :to, :cc, :bcc, :subject, :reply_to]
482
462
 
483
463
  Example:
484
464
 
485
- ```ruby
486
- context "the subject line must have the email address sanitize_email@example.org" do
487
- subject { Mail.deliver(@message_hash) }
488
- it { should have_subject "sanitize_email@example.org" }
489
- end
490
- ```
465
+ context "the subject line must have the email address sanitize_email@example.org" do
466
+ subject { Mail.deliver(@message_hash) }
467
+ it { should have_subject("sanitize_email@example.org") }
468
+ end
491
469
 
492
470
  #### be_* matchers
493
471
 
494
- These will look for a matching string in any of the following
472
+ These will look for a matching string in any of the following attributes:
495
473
 
496
- ```ruby
497
- :from, :to, :cc, :bcc, :subject, :reply_to
498
- ```
474
+ [:from, :to, :cc, :bcc, :subject, :reply_to]
499
475
 
500
476
  Example:
501
477
 
502
- ```ruby
503
- context "the subject line must have the string 'foobarbaz'" do
504
- subject { Mail.deliver(@message_hash) }
505
- it { should be_subject "foobarbaz" }
506
- end
507
- ```
478
+ context "the subject line must have the string 'foobarbaz'" do
479
+ subject { Mail.deliver(@message_hash) }
480
+ it { should be_subject("foobarbaz") }
481
+ end
508
482
 
509
483
  #### have_to_username matcher
510
484
 
@@ -514,12 +488,10 @@ The `username` in the `:to` field is when the `:to` field is formatted like this
514
488
 
515
489
  Example:
516
490
 
517
- ```ruby
518
- context "the to field must have the username 'Peter Boling'" do
519
- subject { Mail.deliver(@message_hash) }
520
- it { should have_to_username "Peter Boling" }
521
- end
522
- ```
491
+ context "the to field must have the username 'Peter Boling'" do
492
+ subject { Mail.deliver(@message_hash) }
493
+ it { should have_to_username("Peter Boling") }
494
+ end
523
495
 
524
496
  #### have_sanitized_to_header matcher
525
497
 
@@ -532,12 +504,10 @@ NOTE: It won't match subsequent headers like `"X-Sanitize-Email-To-2"`, or `"X-S
532
504
 
533
505
  Example:
534
506
 
535
- ```ruby
536
- context "the first 'X-Sanitize-Email-To' header must have the username 'Peter Boling'" do
537
- subject { Mail.deliver(@message_hash) }
538
- it { should have_sanitized_to_header "Peter Boling" }
539
- end
540
- ```
507
+ context "the first 'X-Sanitize-Email-To' header must have the username 'Peter Boling'" do
508
+ subject { Mail.deliver(@message_hash) }
509
+ it { should have_sanitized_to_header("Peter Boling") }
510
+ end
541
511
 
542
512
  #### have_cc_username matcher
543
513
 
@@ -547,12 +517,10 @@ The `username` in the `:cc` field is when the `:c` field is formatted like this:
547
517
 
548
518
  Example:
549
519
 
550
- ```ruby
551
- context "the cc field must have the username 'Peter Boling'" do
552
- subject { Mail.deliver(@message_hash) }
553
- it { should have_cc_username "Peter Boling" }
554
- end
555
- ```
520
+ context "the cc field must have the username 'Peter Boling'" do
521
+ subject { Mail.deliver(@message_hash) }
522
+ it { should have_cc_username("Peter Boling") }
523
+ end
556
524
 
557
525
  #### have_sanitized_cc_header matcher
558
526
 
@@ -565,60 +533,53 @@ NOTE: It won't match subsequent headers like `"X-Sanitize-Email-Cc-2"`, or `"X-S
565
533
 
566
534
  Example:
567
535
 
568
- ```ruby
569
- context "the first 'X-Sanitize-Email-Cc' header must have the username 'Peter Boling'" do
570
- subject { Mail.deliver(@message_hash) }
571
- it { should have_sanitized_cc_header "Peter Boling" }
572
- end
573
- ```
574
-
536
+ context "the first 'X-Sanitize-Email-Cc' header must have the username 'Peter Boling'" do
537
+ subject { Mail.deliver(@message_hash) }
538
+ it { should have_sanitized_cc_header("Peter Boling") }
539
+ end
575
540
 
576
541
  ### non-rspec (Test::Unit, mini-test, etc)
577
542
 
578
543
  In your setup file:
579
544
 
580
- ```ruby
581
- require 'sanitize_email'
582
- # test helpers are *not* loaded by default in sanitize_email, as it is not primarily a gem for test suites.
583
- require 'sanitize_email/test_helpers'
584
-
585
- SanitizeEmail::Config.configure do |config|
586
- config[:sanitized_to] = 'sanitize_email@example.org'
587
- config[:sanitized_cc] = 'sanitize_email@example.org'
588
- config[:sanitized_bcc] = 'sanitize_email@example.org'
589
- # run/call whatever logic should turn sanitize_email on and off in this Proc.
590
- # config[:activation_proc] = Proc.new { true }
591
- # Since this configuration is *inside* the spec_helper, it might be assumed that we always want to sanitize. If we don't want to it can be easily manipulated with SanitizeEmail.unsanitary and SanitizeEmail.sanitary block helpers.
592
- # Thus instead of using the Proc (slower) we just engage it always:
593
- config[:engage] = true
594
- config[:use_actual_email_prepended_to_subject] = true # or false
595
- config[:use_actual_environment_prepended_to_subject] = true # or false
596
- config[:use_actual_email_as_sanitized_user_name] = true # or false
597
- end
598
-
599
- # If your mail system is not one that sanitize_email automatically configures an interceptor for (ActionMailer, Mail)
600
- # then you will need to do the equivalent for whatever Mail system you are using.
601
-
602
- # You need to know what to do here... somehow get the methods into rhw scope of your tests.
603
- # Something like this maybe?
604
- include SanitizeEmail::TestHelpers
605
- # Look here to see what it gives you:
606
- # https://github.com/pboling/sanitize_email/blob/master/lib/sanitize_email/test_helpers.rb
607
- ```
545
+ require "sanitize_email"
546
+ # test helpers are *not* loaded by default in sanitize_email, as it is not primarily a gem for test suites.
547
+ require "sanitize_email/test_helpers"
548
+
549
+ SanitizeEmail::Config.configure do |config|
550
+ config[:sanitized_to] = "sanitize_email@example.org"
551
+ config[:sanitized_cc] = "sanitize_email@example.org"
552
+ config[:sanitized_bcc] = "sanitize_email@example.org"
553
+ # run/call whatever logic should turn sanitize_email on and off in this Proc.
554
+ # config[:activation_proc] = Proc.new { true }
555
+ # Since this configuration is *inside* the spec_helper, it might be assumed that we always want to sanitize. If we don't want to it can be easily manipulated with SanitizeEmail.unsanitary and SanitizeEmail.sanitary block helpers.
556
+ # Thus instead of using the Proc (slower) we just engage it always:
557
+ config[:engage] = true
558
+ config[:use_actual_email_prepended_to_subject] = true # or false
559
+ config[:use_actual_environment_prepended_to_subject] = true # or false
560
+ config[:use_actual_email_as_sanitized_user_name] = true # or false
561
+ end
562
+
563
+ # If your mail system is not one that sanitize_email automatically configures an interceptor for (ActionMailer, Mail)
564
+ # then you will need to do the equivalent for whatever Mail system you are using.
565
+
566
+ # You need to know what to do here... somehow get the methods into rhw scope of your tests.
567
+ # Something like this maybe?
568
+ include SanitizeEmail::TestHelpers
569
+ # Look here to see what it gives you:
570
+ # https://github.com/pboling/sanitize_email/blob/master/lib/sanitize_email/test_helpers.rb
608
571
 
609
572
  ## Deprecations
610
573
 
611
574
  Sometimes things get deprecated (meaning they still work, but are noisy about it). If this happens to you, and you like your head in the sand, call this number:
612
575
 
613
- ```ruby
614
- SanitizeEmail::Deprecation.deprecate_in_silence = true
615
- ```
576
+ SanitizeEmail::Deprecation.deprecate_in_silence = true
616
577
 
617
578
  ## Authors
618
579
 
619
580
  Peter Boling is the original author of the code, and current maintainer.
620
581
 
621
- Thanks to John Trupiano for turning Peter's original Rails plugin into this gem!
582
+ Thanks to John Trupiano for turning Peter's original Rails plugin into the initial cut of this gem!
622
583
 
623
584
  ## 🤝 Contributing
624
585
 
@@ -679,20 +640,22 @@ Learn more about, or become one of, our 🎖 contributors on:
679
640
  ## Running Specs
680
641
 
681
642
  The basic compatibility matrix:
682
- ```sh
683
- appraisal install
684
- appraisal rake test
685
- ```
686
643
 
687
- Sometimes also:
688
- ```sh
689
- BUNDLE_GEMFILE=gemfiles/vanilla.gemfile appraisal update
690
- ```
644
+ appraisal install
645
+ appraisal rake test
646
+
647
+ NOTE: `appraisal install` uses the standard Gemfile, and thus adds a bunch of gems
648
+ we do not need in each of our appraisal gemfiles.
649
+
650
+ Instead we can do one of:
651
+
652
+ BUNDLE_GEMFILE=gemfiles/vanilla.gemfile appraisal generate
653
+ BUNDLE_GEMFILE=gemfiles/vanilla.gemfile appraisal update
691
654
 
692
- NOTE: This results in bad paths to the gemspec.
655
+ NOTE: This results in bad paths to the gemspec from each of the appraisal `gemfiles/rails_*_*.gemfile` files.
693
656
  `gemspec path: "../../"` needs to be replaced with `gemspec path: "../"` in each Appraisal gemfile.
694
657
 
695
- Except, is unlikely to be possible to install all of the supported Rubies & Railsies in a single container...
658
+ It is unlikely to be possible to install all of the supported Rubies & Railsies in a single container...
696
659
  See the various github action workflows for more inspiration on running certain oldies.
697
660
 
698
661
  ### Code Coverage
@@ -726,9 +689,7 @@ the [Pessimistic Version Constraint][📌pvc] with two digits of precision.
726
689
 
727
690
  For example:
728
691
 
729
- ```ruby
730
- spec.add_dependency "sanitize_email", "~> 2.0"
731
- ```
692
+ spec.add_dependency("sanitize_email", "~> 2.0")
732
693
 
733
694
  [comment]: <> ( 📌 VERSIONING LINKS )
734
695
 
@@ -763,3 +724,17 @@ See [LICENSE.txt][📄license] for the official [Copyright Notice][📄copyright
763
724
 
764
725
  [railsbling]: http://www.railsbling.com
765
726
  [peterboling]: http://www.peterboling.com
727
+
728
+ ## 🤑 One more thing
729
+
730
+ You made it to the bottom of the page,
731
+ so perhaps you'll indulge me for another 20 seconds.
732
+ I maintain many dozens of gems, including this one,
733
+ because I want Ruby to be a great place for people to solve problems, big and small.
734
+ Please consider supporting my efforts via the giant yellow link below,
735
+ or one of the others at the head of this README.
736
+
737
+ [![Buy me a latte][🖇buyme-img]][🖇buyme]
738
+
739
+ [🖇buyme-img]: https://img.buymeacoffee.com/button-api/?text=Buy%20me%20a%20latte&emoji=&slug=pboling&button_colour=FFDD00&font_colour=000000&font_family=Cookie&outline_colour=000000&coffee_colour=ffffff
740
+ [🖇buyme]: https://www.buymeacoffee.com/pboling
@@ -5,6 +5,6 @@
5
5
 
6
6
  module SanitizeEmail
7
7
  module Version
8
- VERSION = "2.0.8"
8
+ VERSION = "2.0.9"
9
9
  end
10
10
  end
@@ -22,7 +22,7 @@ module SanitizeEmail
22
22
  # This gem must be loaded **after** Rails in order for the Engine/Railtie to register itself automatically.
23
23
  # Otherwise, you'd have to manually require what you need from below.
24
24
  # Allow non-rails implementations to use this gem
25
- if defined?(::Rails) && defined?(::Rails::VERSION)
25
+ if defined?(::Rails::VERSION)
26
26
  if defined?(::Rails::Engine)
27
27
  if ::Rails::VERSION::MAJOR >= 6
28
28
  # Rails 6.0+
@@ -95,7 +95,7 @@ module SanitizeEmail
95
95
  # You have access to all the same configuration options in the parameter hash
96
96
  # as you can set in the actual SanitizeEmail.configure block.
97
97
  #
98
- # SanitizeEmail.sanitary({:sanitized_to => "boo@example.com"}) do
98
+ # SanitizeEmail.sanitary(sanitized_to: "boo@example.com") do
99
99
  # Mail.deliver do
100
100
  # from "from@example.org"
101
101
  # # Will actually be sent to the override addresses, not this one:
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sanitize_email
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.8
4
+ version: 2.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Boling
@@ -14,31 +14,31 @@ cert_chain:
14
14
  -----BEGIN CERTIFICATE-----
15
15
  MIIEgDCCAuigAwIBAgIBATANBgkqhkiG9w0BAQsFADBDMRUwEwYDVQQDDAxwZXRl
16
16
  ci5ib2xpbmcxFTATBgoJkiaJk/IsZAEZFgVnbWFpbDETMBEGCgmSJomT8ixkARkW
17
- A2NvbTAeFw0yMzA5MjAxNzMwMjhaFw0yNDA5MTkxNzMwMjhaMEMxFTATBgNVBAMM
17
+ A2NvbTAeFw0yNDA5MjAwODU4NDJaFw0yNTA5MjAwODU4NDJaMEMxFTATBgNVBAMM
18
18
  DHBldGVyLmJvbGluZzEVMBMGCgmSJomT8ixkARkWBWdtYWlsMRMwEQYKCZImiZPy
19
- LGQBGRYDY29tMIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEA+a9UvHo3
20
- 84k96WgU5Kk5HB+cLZs/modjorsTfqY67MJF5nNvAoqcKTUBW4uG+Zpfnm3jaDO5
21
- GxhJEIZWfndYzycHT2KMVQ1uTP82ba8ZaKrPlPIafkbui3mdds47qsmqHiblKERg
22
- U532lkwfqHDlJwE7OBZQ59EwWWLynlT/yAUHpOBbqIuHKUxdpmBI+sIjrZcD1e05
23
- WmjkO6fwIdC5oM757aoPxIgXD587VOViH11Vkm2doskj4T8yONtwVHlcrrhJ9Bzd
24
- /zdp6vEn7GZQrABvpOlqwWxQ72ZnFhJe/RJZf6CXOPOh69Ai0QKYl2a1sYuCJKS3
25
- nsBnxXJINEEznjR7rZjNUmYD+CZqfjzgPqedRxTlASe7iA4w7xZOqMDzcuhNwcUQ
26
- tMEH6BTktxKP3jXZPXRfHCf6s+HRVb6vezAonTBVyydf5Xp5VwWkd6cwm+2BzHl5
27
- 7kc/3lLxKMcsyEUprAsk8LdHohwZdC267l+RS++AP6Cz6x+nB3oGob19AgMBAAGj
28
- fzB9MAkGA1UdEwQCMAAwCwYDVR0PBAQDAgSwMB0GA1UdDgQWBBQCSSas60GqqMjt
29
- xR7LoY1gucEvtzAhBgNVHREEGjAYgRZwZXRlci5ib2xpbmdAZ21haWwuY29tMCEG
19
+ LGQBGRYDY29tMIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEAjrxsKObI
20
+ rFQjBpzvVfqnT6JlF8/pkpgEEjFh7ex3zIerfuHzZvSrx+sRDGxQ8koWWG0Wjx8s
21
+ wkBZ5dIqvl0g3sWP5asa28u/09opxkQTC1Ao77iYxcBcwoCe/Dpf1m4Q/m6oH0kL
22
+ 2AZVNJQL3UkqAcLS0tsj/s/jAKnVlsaZZE5gQiIIi8HtkvSsajtx+Cq2AxDvcWvV
23
+ /CliD+pmzYkTjvjwGm8yeyFGGGgrisJMryiZdZlkTwrQSjCzudIKbLeuG8Se4JTD
24
+ TAcT+rPubr27v1jwmtIjtiot3rf4nof7LHLb122a/0VR7cC7xPLnXw0Cq1BShvoq
25
+ /GKRdSwMNinTOGkFTK1gKnjN+3iD4zyXU3XO3CXoTr+Ju8fXPN1x4tpOMgbv8dme
26
+ WbcQMOH9ZjmA5w0bSVRL1c3NhRRpUzrKTNXBEvqOyWjUnintxWKj+cRXx+z+dUgI
27
+ dL3kj68fcsiTgl75In3C485pnCMmq1eLuVoiy3jkLNOn2lHeLt9ZK63LAgMBAAGj
28
+ fzB9MAkGA1UdEwQCMAAwCwYDVR0PBAQDAgSwMB0GA1UdDgQWBBRhfc+2UaVYd74p
29
+ yJ1JclGiUYN8+jAhBgNVHREEGjAYgRZwZXRlci5ib2xpbmdAZ21haWwuY29tMCEG
30
30
  A1UdEgQaMBiBFnBldGVyLmJvbGluZ0BnbWFpbC5jb20wDQYJKoZIhvcNAQELBQAD
31
- ggGBAMl9ifcw5p+PdvB7dCPoNKoVdp/2LbC9ztETHuYL2gUMJB6UoS3o9c/piSuR
32
- V3ZMQaijmNu6ms1bWAtJ66LjmYrVflJtf9yp31Kierr9LpisMSUx2qbMOHGa8d2Z
33
- vCUWPF8E9Cg0mP3GAyZ6qql8jDh/anUKeksPXqJvNxNPDu2DVYsa/IWdl96whzS4
34
- Bl7SwB1E7agps40UcshCSKaVDOU0M+XN6SrnJMElnBic+KSAkBkVFbzS0BE4ODZM
35
- BgE6nYzQ05qhuvbE+oGdACTlemNtDDWCh0uw+7x0q2PocGIDU5zsPn/WNTkCXPmB
36
- CHGvqDNWq4M7ncTKAaS2XExgyb7uPdq9fKiOW8nmH+zCiGzJXzBWwZlKf7L4Ht9E
37
- a3f0e5C+zvee9Z5Ng9ciyfav9/fcXgYt5MjoBv27THr5XfBhgOCIHSYW2tqJmWKi
38
- KuxrfYrN+9HvMdm+nZ6TypmKftHY3Gj+/uu+g8Icm/zrvTWAEE0mcJOkfrIoNPJb
39
- pF8dMA==
31
+ ggGBAA4fLU2+mQ++jBhVM2IeyvQdw1nm+0thkH4Ldv8ZOBm5ZxCPGIMoYliDDzg4
32
+ 4JDFxZR1wR4sdrz/K5tWtEkN23SKzopwbNb1NIQRSLQ7nOoc+4bkuz9xwKinmIvF
33
+ D+5qsl2S27WLKFreMDtGoh0CREIMBUxU4rGTh0gtzmweGR+fnOShg4Jo0kxrjU5h
34
+ uYk/uVE+bn/jOEGs43GvKXZLyshpBrZjQ+ArbvxDht5t35zbSxerbUxUPZUbXUCW
35
+ tTyh38a9UYjAAHvnh6Y4Fi9wd4/pGNsektrzB3z/zlVj4YF2TMLX9XfNJWEGRGpO
36
+ sSkLYdtEX1WQAmuZtActVW2cL3HdQaRbiv7VbfpA0eSk0ZdZHvBCl516ZZu10uX6
37
+ 82W1mg6fuezdpeBOiXwrEbZSt/oGiF4V511F6nd55p0okwHc/6nS10F/3aKJ4gwC
38
+ I5o+DRfXQHqKucx1ldFHvI2rE/kSCWqGTHN2eyu1sqCPeOoIMxrltJhaejKPkxqj
39
+ zaF9Og==
40
40
  -----END CERTIFICATE-----
41
- date: 2024-07-10 00:00:00.000000000 Z
41
+ date: 2024-11-09 00:00:00.000000000 Z
42
42
  dependencies:
43
43
  - !ruby/object:Gem::Dependency
44
44
  name: mail
@@ -217,10 +217,10 @@ licenses:
217
217
  - MIT
218
218
  metadata:
219
219
  homepage_uri: https://github.com/pboling/sanitize_email
220
- source_code_uri: https://github.com/pboling/sanitize_email/tree/v2.0.8
221
- changelog_uri: https://github.com/pboling/sanitize_email/blob/v2.0.8/CHANGELOG.md
220
+ source_code_uri: https://github.com/pboling/sanitize_email/tree/v2.0.9
221
+ changelog_uri: https://github.com/pboling/sanitize_email/blob/v2.0.9/CHANGELOG.md
222
222
  bug_tracker_uri: https://github.com/pboling/sanitize_email/issues
223
- documentation_uri: https://www.rubydoc.info/gems/sanitize_email/2.0.8
223
+ documentation_uri: https://www.rubydoc.info/gems/sanitize_email/2.0.9
224
224
  wiki_uri: https://github.com/pboling/sanitize_email/wiki
225
225
  funding_uri: https://liberapay.com/pboling
226
226
  rubygems_mfa_required: 'true'
@@ -239,7 +239,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
239
239
  - !ruby/object:Gem::Version
240
240
  version: '0'
241
241
  requirements: []
242
- rubygems_version: 3.5.11
242
+ rubygems_version: 3.5.23
243
243
  signing_key:
244
244
  specification_version: 4
245
245
  summary: Email Condom for your Ruby Server
metadata.gz.sig CHANGED
Binary file