ruby3-backward-compatibility 0.1.2 → 0.1.3

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: 4551e0985507c3ab5633b97825f059f34962dcfea27dfdb5ad9a3fe7d15a19f6
4
- data.tar.gz: c211c8d15240c592d3ab2fd355f76dfb58ed88b548129e951b23764c577a9d51
3
+ metadata.gz: 9d573d3c08d404195e71dd9c7a1c4deee4de8c5277486c382f6be9fc633955a4
4
+ data.tar.gz: d854da5c1956e17bfb887a46f768828f96bd8dd8241568c4e1eaea768e2619dc
5
5
  SHA512:
6
- metadata.gz: a79863218e982c240626e13c6276e0cf1afd5a5bbffc823e427f75e126534c211efa94c5947cc253bc9e4011fe2a2bf1729d7e0ed37b3ac244353c22bd1fa115
7
- data.tar.gz: c9f29e66e4162bfc9a8b0afee0e162dacca15eb2158cd51ba5e92cf01c0ba7c33e27255c485ac88257afa715af16823279f078cbf96cca03e5ea17995ff434d5
6
+ metadata.gz: 35e33c63d438e5ea0d03ca0cdc5ca5f6938ab1b9cddcb02a2ea85a27580ee3cc5d83d11a721ada769abfefcdc30896e972dd07869639071bfc28bc4a98e374e4
7
+ data.tar.gz: 866e11431ce3380725f9d82a161729132359da6fff9587e2cd6db35d6ac43b187c3f62db42605a742194130db0a1bcf555c657934cc91c0efa0ae57dd8a4d4d9
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.1.3] - 2022-10-25
4
+
5
+ - Allow `ruby3_keywords` to work if method is also defined in a prepended module.
6
+
3
7
  ## [0.1.2] - 2022-10-25
4
8
 
5
9
  - `ruby3_keywords` does not change visibility of private or protected methods.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ruby3-backward-compatibility (0.1.2)
4
+ ruby3-backward-compatibility (0.1.3)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -67,6 +67,8 @@ Ruby3Class.new.some_method({ foo: 'bar' }) # now works as well
67
67
 
68
68
  This will wrap the given method and convert a hash given as the last argument into keywords, similar to how it worked in Ruby 2.
69
69
 
70
+ *Note:* In case the method is also defined in a prepended module, you need to put the `extend Ruby3BackwardCompatibility::Ruby3Keywords` above the `prepend`.
71
+
70
72
  ### ERB
71
73
 
72
74
  `ERB.new` used to have the signature
@@ -1,5 +1,11 @@
1
1
  module Ruby3BackwardCompatibility
2
2
  module Ruby3Keywords
3
+ def self.extended(by)
4
+ # prepend the anonymous module now, so the user has a chance to control where exactly we will end
5
+ # up in the prepend chain...
6
+ by.send(:_ruby3_keywords_module)
7
+ end
8
+
3
9
  def ruby3_keywords(*methods)
4
10
  methods.each do |method|
5
11
  method_is_private = private_instance_methods.include?(method)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Ruby3BackwardCompatibility
4
- VERSION = '0.1.2'
4
+ VERSION = '0.1.3'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby3-backward-compatibility
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tobias Kraze
@@ -59,7 +59,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
59
59
  - !ruby/object:Gem::Version
60
60
  version: '0'
61
61
  requirements: []
62
- rubygems_version: 3.3.7
62
+ rubygems_version: 3.2.3
63
63
  signing_key:
64
64
  specification_version: 4
65
65
  summary: Backward compatibility for Ruby 3 stdlib