ruby3-backward-compatibility 0.1.3 → 0.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: 9d573d3c08d404195e71dd9c7a1c4deee4de8c5277486c382f6be9fc633955a4
4
- data.tar.gz: d854da5c1956e17bfb887a46f768828f96bd8dd8241568c4e1eaea768e2619dc
3
+ metadata.gz: b71b8fde08a5679223c87ba0b616e5dee7b2cce0ffac9f5e53baaa635b561764
4
+ data.tar.gz: 2ca101eaa3eea34e3f8095300c2f7a2e19220f3c96c16f192d5aa30399044159
5
5
  SHA512:
6
- metadata.gz: 35e33c63d438e5ea0d03ca0cdc5ca5f6938ab1b9cddcb02a2ea85a27580ee3cc5d83d11a721ada769abfefcdc30896e972dd07869639071bfc28bc4a98e374e4
7
- data.tar.gz: 866e11431ce3380725f9d82a161729132359da6fff9587e2cd6db35d6ac43b187c3f62db42605a742194130db0a1bcf555c657934cc91c0efa0ae57dd8a4d4d9
6
+ metadata.gz: 0d8dc055e1f103f718bcb1674b408499bed79063dccde3aba4b919ec2c3cabd775d53a2b3434194b994c35a01ce7e2ec0cc0f0e97c70d8be1a0b5be368ca4ca4
7
+ data.tar.gz: c56faddac8e64cb4603ddce56ad102727335e2e80370decca5808c6fad71bdb99a38b64da2d728af2b09713fcfd3ce4cb5dcdb7432b531963091127401cf875e
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.2.0] - 2022-10-26
4
+
5
+ - Add `ruby3_backward_compatibility/compatibility/i18n`.
6
+
3
7
  ## [0.1.3] - 2022-10-25
4
8
 
5
9
  - Allow `ruby3_keywords` to work if method is also defined in a prepended module.
data/Gemfile CHANGED
@@ -8,3 +8,5 @@ gemspec
8
8
  gem 'rake', '~> 13.0'
9
9
 
10
10
  gem 'rspec', '~> 3.0'
11
+
12
+ gem 'i18n'
data/Gemfile.lock CHANGED
@@ -1,12 +1,15 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ruby3-backward-compatibility (0.1.3)
4
+ ruby3-backward-compatibility (0.2.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
8
8
  specs:
9
+ concurrent-ruby (1.1.10)
9
10
  diff-lcs (1.5.0)
11
+ i18n (1.12.0)
12
+ concurrent-ruby (~> 1.0)
10
13
  rake (13.0.6)
11
14
  rspec (3.11.0)
12
15
  rspec-core (~> 3.11.0)
@@ -26,6 +29,7 @@ PLATFORMS
26
29
  x86_64-linux
27
30
 
28
31
  DEPENDENCIES
32
+ i18n
29
33
  rake (~> 13.0)
30
34
  rspec (~> 3.0)
31
35
  ruby3-backward-compatibility!
data/README.md CHANGED
@@ -30,6 +30,8 @@ You can also require all included backports using
30
30
  require 'ruby3-backward-compatibility/compatibility/all'
31
31
  ```
32
32
 
33
+ Note however that this will not patch anything that has not been required yet. You can always require single patches as shown below.
34
+
33
35
 
34
36
  ## List of backports
35
37
 
@@ -90,6 +92,17 @@ require 'ruby3_backward_compatibility/compatibility/erb'
90
92
  ```
91
93
 
92
94
 
95
+ ### I18n
96
+
97
+ `I18n` has a few methods (`translate`, `localize`, etc.) that requires to be called with keywords.
98
+
99
+ To allow calling it with option hashes, too, use
100
+
101
+ ```
102
+ require 'ruby3_backward_compatibility/compatibility/i18n'
103
+ ```
104
+
105
+
93
106
  ### Object
94
107
 
95
108
  The methods `Object#taint` and `Object#untaint` were no-ops for a while but started to raise deprecation warnings.
@@ -1,7 +1,8 @@
1
1
  require 'ruby3_backward_compatibility'
2
2
 
3
- require 'ruby3_backward_compatibility/compatibility/erb'
3
+ require 'ruby3_backward_compatibility/compatibility/erb' if defined?(ERB)
4
+ require 'ruby3_backward_compatibility/compatibility/i18n' if defined?(I18n)
4
5
  require 'ruby3_backward_compatibility/compatibility/object'
5
- require 'ruby3_backward_compatibility/compatibility/psych'
6
+ require 'ruby3_backward_compatibility/compatibility/psych' if defined?(Psych)
6
7
  require 'ruby3_backward_compatibility/compatibility/string'
7
- require 'ruby3_backward_compatibility/compatibility/uri'
8
+ require 'ruby3_backward_compatibility/compatibility/uri' if defined?(URI)
@@ -0,0 +1,9 @@
1
+ require 'i18n'
2
+
3
+ module I18n
4
+ class << self
5
+ extend Ruby3BackwardCompatibility::Ruby3Keywords
6
+
7
+ ruby3_keywords :translate, :translate!, :localize, :t, :l, :transliterate
8
+ end
9
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Ruby3BackwardCompatibility
4
- VERSION = '0.1.3'
4
+ VERSION = '0.2.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: 0.1.3
4
+ version: 0.2.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: 2022-10-25 00:00:00.000000000 Z
11
+ date: 2022-10-26 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email:
@@ -30,6 +30,7 @@ files:
30
30
  - lib/ruby3_backward_compatibility.rb
31
31
  - lib/ruby3_backward_compatibility/compatibility/all.rb
32
32
  - lib/ruby3_backward_compatibility/compatibility/erb.rb
33
+ - lib/ruby3_backward_compatibility/compatibility/i18n.rb
33
34
  - lib/ruby3_backward_compatibility/compatibility/object.rb
34
35
  - lib/ruby3_backward_compatibility/compatibility/psych.rb
35
36
  - lib/ruby3_backward_compatibility/compatibility/string.rb
@@ -59,7 +60,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
59
60
  - !ruby/object:Gem::Version
60
61
  version: '0'
61
62
  requirements: []
62
- rubygems_version: 3.2.3
63
+ rubygems_version: 3.3.7
63
64
  signing_key:
64
65
  specification_version: 4
65
66
  summary: Backward compatibility for Ruby 3 stdlib