ruby3-backward-compatibility 1.3.0 → 1.4.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: d727adf8f484386c84adf5f03c83b8b8e237d072e9755e34770f4c37c87c3f27
4
- data.tar.gz: ccb5329f49247817fbc12f9b72d1a893a57ed53f2c71b7c769d7c397d2e074ec
3
+ metadata.gz: '09b06d532203cd4e5f4f81dbf7b664fafc62b02700594adc99f6dce8d4fe9449'
4
+ data.tar.gz: f691d1e175588417c95978937bf16d7f8bd2ab42ddfa7b9a14ed5b7ad270e1e9
5
5
  SHA512:
6
- metadata.gz: c92cb15cc48cf8c4c78c73ebad18e980a73cdd889993d68de2a4873666a1f81a6a2715140bddb8a14f8e8b6cfd3270eb7481d9bb33c74c702495606d623ca300
7
- data.tar.gz: b8c56baf3948241066277afc1289d9421df3cb8854a11b38f35b5cd18155a51180f1935418e8ed294b82900e14a8e9d33d48452fe226c3eea8be0d6afc237470
6
+ metadata.gz: d8863c4305734ac08069902668e536cf165e2e2bbd9dad261ebbc3cdad46d1d73cb366d1e8452578efd82b32efd6e645d5f46dff5f466500f9ac58747cbeaa7f
7
+ data.tar.gz: 614dbb8dedf50e9999e930576c2874bf11d5691bab6ca50fa63bbf83843f6ca11609b646dd34190242a52294bf4b59b2807faf2e4c378d6fc3729a4f46229cea
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [1.4.0] - 2024-05-02
4
+
5
+ - Ruby 3.2+: Add back `Object#=~`
6
+
3
7
  ## [1.3.0] - 2024-04-16
4
8
 
5
9
  - Ruby 3.2+: Add back third argument to Regexp.new, to allow passing "n" to set `Regexp::NOENCODING`.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ruby3-backward-compatibility (1.3.0)
4
+ ruby3-backward-compatibility (1.4.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -136,7 +136,9 @@ require 'ruby3_backward_compatibility/compatibility/i18n'
136
136
 
137
137
  The methods `Object#taint` and `Object#untaint` were no-ops for a while but started to raise deprecation warnings.
138
138
 
139
- To add them back as no-ops, use
139
+ The method `Object#=~` always returned `nil` if called on anything else than a String. It was removed in Ruby 3.2.
140
+
141
+ To add back `Object#taint` and `Object#untaint` as no-ops and `Object#=~` on arbitrary receivers, use
140
142
 
141
143
  ```
142
144
  require 'ruby3_backward_compatibility/compatibility/object'
@@ -8,6 +8,14 @@ module Ruby3BackwardCompatibility
8
8
  def untaint
9
9
  self
10
10
  end
11
+
12
+ # Make the match operator work on arbitrary receivers again.
13
+ def =~(regexp)
14
+ if Warning[:deprecated]
15
+ Warning.warn("deprecated Object#=~ is called on #{self.class}; it always returns nil")
16
+ end
17
+ nil
18
+ end
11
19
  end
12
20
  end
13
21
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Ruby3BackwardCompatibility
4
- VERSION = '1.3.0'
4
+ VERSION = '1.4.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby3-backward-compatibility
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tobias Kraze
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-04-16 00:00:00.000000000 Z
11
+ date: 2024-05-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: byebug