ruby3-backward-compatibility 0.1.1 → 0.1.2

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: 51d70008eea3cb48c1da8481927fe88adb2bd1db0baa52f3fe523fd907115fe0
4
- data.tar.gz: 6edbd2094831aa71c11ea4b383e8b091b7c72ac2298fe6ee120856739a736951
3
+ metadata.gz: 4551e0985507c3ab5633b97825f059f34962dcfea27dfdb5ad9a3fe7d15a19f6
4
+ data.tar.gz: c211c8d15240c592d3ab2fd355f76dfb58ed88b548129e951b23764c577a9d51
5
5
  SHA512:
6
- metadata.gz: da98f4615e945570a21273e18eca619c169899ee7c9c2c3163548c96ad99e592b3f872abb81427578ae5604f31cbb7fafce3893d608dba0ce73995f9f2f33146
7
- data.tar.gz: f6bc9922ae4b504b216c44dc38e01e19e2ea8b3b89e3fd171cee06fa7c887d8ad2b87e21d1ccfdaaf6a1661cbe5749b0349f5a21ef97630d66c6e517a9ef231d
6
+ metadata.gz: a79863218e982c240626e13c6276e0cf1afd5a5bbffc823e427f75e126534c211efa94c5947cc253bc9e4011fe2a2bf1729d7e0ed37b3ac244353c22bd1fa115
7
+ data.tar.gz: c9f29e66e4162bfc9a8b0afee0e162dacca15eb2158cd51ba5e92cf01c0ba7c33e27255c485ac88257afa715af16823279f078cbf96cca03e5ea17995ff434d5
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## [Unreleased]
2
2
 
3
- ## [0.1.0] - 2022-10-24
3
+ ## [0.1.2] - 2022-10-25
4
+
5
+ - `ruby3_keywords` does not change visibility of private or protected methods.
6
+
7
+ ## [0.1.1] - 2022-10-25
4
8
 
5
9
  - Initial release
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ruby3-backward-compatibility (0.1.0)
4
+ ruby3-backward-compatibility (0.1.2)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -2,12 +2,21 @@ module Ruby3BackwardCompatibility
2
2
  module Ruby3Keywords
3
3
  def ruby3_keywords(*methods)
4
4
  methods.each do |method|
5
+ method_is_private = private_instance_methods.include?(method)
6
+ method_is_protected = protected_instance_methods.include?(method)
7
+
5
8
  _ruby3_keywords_module.define_method(method) do |*args, **keyword_args|
6
9
  if args.last.is_a?(Hash)
7
10
  keyword_args.merge!(args.pop)
8
11
  end
9
12
  super(*args, **keyword_args)
10
13
  end
14
+
15
+ if method_is_private
16
+ _ruby3_keywords_module.send(:private, method)
17
+ elsif method_is_protected
18
+ _ruby3_keywords_module.send(:protected, method)
19
+ end
11
20
  end
12
21
  end
13
22
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Ruby3BackwardCompatibility
4
- VERSION = '0.1.1'
4
+ VERSION = '0.1.2'
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.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tobias Kraze