valid_email2 7.1.0 → 7.2.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4f811fbcff51eb1018fa359171958a2ca6f906dfedf42ba44b500501534ed864
4
- data.tar.gz: 68602394c96335f26e36321bf7886f51543d38582c28d414adee57d21bbd3e6e
3
+ metadata.gz: ab3ac120e88c1119add503d1e30e81cd1342ba6c7f47a9714565c12219fb5f75
4
+ data.tar.gz: 4564231489179e5a59c80a23b3ccf484e889630a4dd13190262c5022e3bd20fa
5
5
  SHA512:
6
- metadata.gz: f2980ded720b291bd15403fe49380829f97d651f75cfba0d8c016ba0c68a88f00c1a987549ba25d54b796fb41685a526241b141dd18b8a82263e3445b916d278
7
- data.tar.gz: eaf2cae38d2c895527825c228a6f221004c94175671cfb74dbd9100ad495f87883df1b80f9762c127d37ad6ea2a7e267ed49fc314abed148b9811218c9f4815f
6
+ metadata.gz: 092e92a411a333b7d8b5e0d0ed447a4e90040fe7a8bf289424a1feed390be6954330d9f3b0d4fc738f8045be922f1214dbaecc8c33475e0a39bfc8de7fafdb35
7
+ data.tar.gz: af1e6b96bf6c5d6d8bb8aa6d8f3e1d1017ef2ebb0ca7b9129468c12a5fc22809f6a8f885daa5c59bbce36d6e871c4777c341e960a0a7af02e196ae74e860496d
@@ -5,13 +5,8 @@ jobs:
5
5
  strategy:
6
6
  fail-fast: false
7
7
  matrix:
8
- gemfile: [activemodel6, activemodel7, activemodel8]
9
- ruby: [3.1, 3.2, 3.3, 3.4]
10
- exclude:
11
- - gemfile: activemodel6
12
- ruby: 3.4
13
- - gemfile: activemodel8
14
- ruby: 3.1
8
+ gemfile: [activemodel7, activemodel8]
9
+ ruby: [3.2, 3.3, 3.4, 4.0]
15
10
  runs-on: ubuntu-latest
16
11
  env:
17
12
  BUNDLE_GEMFILE: gemfiles/${{ matrix.gemfile }}.gemfile
data/.gitignore CHANGED
@@ -4,6 +4,7 @@
4
4
  .bundle
5
5
  .config
6
6
  .yardoc
7
+ .byebug_history
7
8
  Gemfile.lock
8
9
  gemfiles/*.gemfile.lock
9
10
  InstalledFiles
@@ -1 +1 @@
1
- {".":"7.1.0"}
1
+ {".":"7.2.0"}
data/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # Changelog
2
2
 
3
+ ## [7.2.0](https://github.com/micke/valid_email2/compare/v7.1.0...v7.2.0) (2026-11-11)
4
+
5
+
6
+ ### Features
7
+
8
+ * optionally look up disposable domains without building a Set of them ([#326](https://github.com/micke/valid_email2/issues/326)) ([edb46ea](https://github.com/micke/valid_email2/commit/edb46eae949fa25ad635697570968b4bc2550a07))
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * keep checking MX hosts after an unlisted host with one dot ([#330](https://github.com/micke/valid_email2/issues/330)) ([a90d66c](https://github.com/micke/valid_email2/commit/a90d66cb0adb693c08b8ba797a9725505904a4ec))
14
+ * make the DNS cache thread-safe with ActiveSupport::Cache::MemoryStore ([#335](https://github.com/micke/valid_email2/issues/335)) ([96ef31b](https://github.com/micke/valid_email2/commit/96ef31bc9e89737f43904f21e57399dad6a62ad1))
15
+
16
+
17
+ ### Performance Improvements
18
+
19
+ * check the allow list before disposable? in disposable_with_allow_list ([#331](https://github.com/micke/valid_email2/issues/331)) ([6f023d8](https://github.com/micke/valid_email2/commit/6f023d8644caaf2773fad511db439406776f3b4a))
20
+
3
21
  ## [7.1.0](https://github.com/micke/valid_email2/compare/v7.0.15...v7.1.0) (2026-08-23)
4
22
 
5
23
  ### Features
data/Gemfile CHANGED
@@ -3,6 +3,7 @@ source 'https://rubygems.org'
3
3
  # Specify your gem's dependencies in valid_email2.gemspec
4
4
  gemspec
5
5
 
6
- group :development do
6
+ group :development, :test do
7
+ gem "byebug", require: false
7
8
  gem "ruby-lsp-rspec", require: false
8
9
  end
data/README.md CHANGED
@@ -165,6 +165,32 @@ If you want to allow multibyte characters, set it explicitly.
165
165
  ValidEmail2::Address.permitted_multibyte_characters_regex = /[ÆæØøÅåÄäÖöÞþÐð]/
166
166
  ```
167
167
 
168
+ ### Memory usage of the disposable domains list
169
+
170
+ By default, the disposable domains are loaded into a `Set` (`ValidEmail2.disposable_emails`), which adds about 35 MB to the process for the fastest lookups.
171
+ To trade lookup speed for memory, look them up in the sorted list file instead: it takes about 3 MB, and a lookup takes a few microseconds.
172
+
173
+ ```ruby
174
+ # config/initializers/valid_email2.rb
175
+ ValidEmail2.disposable_domains_lookup = :sorted_list
176
+ ```
177
+
178
+ With this option, domains added to or removed from `ValidEmail2.disposable_emails` are ignored by the validations.
179
+
180
+ ### DNS cache
181
+
182
+ MX and A lookups are cached in memory for the TTL of their DNS records, and the cache is shared by all threads.
183
+ It is an `ActiveSupport::Cache::MemoryStore` capped at 1 MB by default, which holds roughly a thousand domains.
184
+ Once it is full, the least recently used lookups are evicted, and ActiveSupport instruments a `cache_prune.active_support` event.
185
+
186
+ To change the cap, set it in bytes, e.g. in an initializer:
187
+
188
+ ```ruby
189
+ ValidEmail2::Dns.cache_size = 8 * 1024 * 1024 # 8 MB
190
+ ```
191
+
192
+ To empty the cache, e.g. between tests, call `ValidEmail2::Dns.clear_cache`.
193
+
168
194
  ### Test environment
169
195
 
170
196
  If you are validating `mx` then your specs will fail without an internet connection.