i18n_alchemy 0.5.0 → 0.6.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 +4 -4
- data/CHANGELOG.md +7 -0
- data/README.md +0 -2
- data/lib/i18n_alchemy/proxy.rb +8 -3
- data/lib/i18n_alchemy/version.rb +1 -1
- data/test/i18n_alchemy/proxy_test.rb +16 -0
- data/test/models/product.rb +4 -0
- metadata +16 -19
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a41c87eb8b32e441521a7c95b2f1615953de0bf6577dce86f242bb23a2e19cfe
|
4
|
+
data.tar.gz: ff8d7d3523c198fd9eee7943ef3d7511a521d9e67920bbe27fc5b77740384ff5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c5f565332b41135058232b9c6f2209a1f0fb82bd712263eced148a881c8f3adc1c88d13815e79f67178df1ac0104e3f70e4798aa3ff1b0ec09b4566ce38e2ac2
|
7
|
+
data.tar.gz: 57e56f3320677ac9f67c8ed6852e11d923c903d4dd38598c8a4b4d6afffc4d6e1a85b1f13eaf4557cdd03dade7c09a2a37d0ee17fbdeca7a085f1e54f79c89dd
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
## v0.6.0 - 2025-10-17
|
2
|
+
|
3
|
+
* Drop support for Ruby < 2.7
|
4
|
+
* Drop support for Rails < 7.0
|
5
|
+
* Rails 8+ support: inherit from `BasicObject` when available, `ActiveSupport::ProxyObject` was deprecated / removed ([#64](https://github.com/carlosantoniodasilva/i18n_alchemy/pull/64))
|
6
|
+
* Remove `ruby2_keywords` warning ([#64](https://github.com/carlosantoniodasilva/i18n_alchemy/pull/64))
|
7
|
+
|
1
8
|
## v0.5.0 - 2022-01-15
|
2
9
|
|
3
10
|
* Drop support for Ruby < 2.5
|
data/README.md
CHANGED
@@ -1,8 +1,6 @@
|
|
1
1
|
## I18nAlchemy
|
2
2
|
|
3
3
|
[](http://badge.fury.io/rb/i18n_alchemy)
|
4
|
-
[](http://travis-ci.org/carlosantoniodasilva/i18n_alchemy)
|
5
|
-
[](https://codeclimate.com/github/carlosantoniodasilva/i18n_alchemy)
|
6
4
|
|
7
5
|
I18n date/number parsing/localization
|
8
6
|
|
data/lib/i18n_alchemy/proxy.rb
CHANGED
@@ -1,8 +1,14 @@
|
|
1
1
|
module I18n
|
2
2
|
module Alchemy
|
3
3
|
# Depend on AS::Basic/ProxyObject which has a "blank slate" - no methods.
|
4
|
-
base_proxy =
|
5
|
-
|
4
|
+
base_proxy =
|
5
|
+
if defined?(BasicObject)
|
6
|
+
BasicObject
|
7
|
+
elsif defined?(ActiveSupport::ProxyObject)
|
8
|
+
ActiveSupport::ProxyObject
|
9
|
+
else
|
10
|
+
ActiveSupport::BasicObject
|
11
|
+
end
|
6
12
|
|
7
13
|
class Proxy < base_proxy
|
8
14
|
include AttributesParsing
|
@@ -61,7 +67,6 @@ module I18n
|
|
61
67
|
def method_missing(*args, **kwargs, &block)
|
62
68
|
@target.send(*args, **kwargs, &block)
|
63
69
|
end
|
64
|
-
ruby2_keywords :method_missing
|
65
70
|
else
|
66
71
|
def method_missing(*args, &block)
|
67
72
|
@target.send(*args, &block)
|
data/lib/i18n_alchemy/version.rb
CHANGED
@@ -13,6 +13,22 @@ class ProxyTest < I18n::Alchemy::ProxyTestCase
|
|
13
13
|
end
|
14
14
|
end
|
15
15
|
|
16
|
+
def test_delegates_method_with_options_to_target_object
|
17
|
+
@localized.method_with_options(:argument, option: :option) do |argument, option:|
|
18
|
+
assert_equal :argument, argument
|
19
|
+
assert_equal :option, option
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
if ::RUBY_VERSION < "3.0"
|
24
|
+
def test_delegates_method_with_ruby_pre3_options_to_target_object
|
25
|
+
@localized.method_with_options(:argument, { option: :option }) do |argument, option:|
|
26
|
+
assert_equal :argument, argument
|
27
|
+
assert_equal :option, option
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
16
32
|
def test_respond_to
|
17
33
|
assert_respond_to @localized, :price
|
18
34
|
assert_respond_to @localized, :price=
|
data/test/models/product.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: i18n_alchemy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Carlos Antonio da Silva
|
8
|
-
autorequire:
|
9
8
|
bindir: bin
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
13
12
|
- !ruby/object:Gem::Dependency
|
14
13
|
name: activesupport
|
@@ -16,20 +15,20 @@ dependencies:
|
|
16
15
|
requirements:
|
17
16
|
- - ">="
|
18
17
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
18
|
+
version: 7.0.0
|
20
19
|
- - "<"
|
21
20
|
- !ruby/object:Gem::Version
|
22
|
-
version: '
|
21
|
+
version: '9.0'
|
23
22
|
type: :runtime
|
24
23
|
prerelease: false
|
25
24
|
version_requirements: !ruby/object:Gem::Requirement
|
26
25
|
requirements:
|
27
26
|
- - ">="
|
28
27
|
- !ruby/object:Gem::Version
|
29
|
-
version:
|
28
|
+
version: 7.0.0
|
30
29
|
- - "<"
|
31
30
|
- !ruby/object:Gem::Version
|
32
|
-
version: '
|
31
|
+
version: '9.0'
|
33
32
|
- !ruby/object:Gem::Dependency
|
34
33
|
name: i18n
|
35
34
|
requirement: !ruby/object:Gem::Requirement
|
@@ -50,40 +49,40 @@ dependencies:
|
|
50
49
|
requirements:
|
51
50
|
- - ">="
|
52
51
|
- !ruby/object:Gem::Version
|
53
|
-
version:
|
52
|
+
version: 7.0.0
|
54
53
|
- - "<"
|
55
54
|
- !ruby/object:Gem::Version
|
56
|
-
version: '
|
55
|
+
version: '9.0'
|
57
56
|
type: :development
|
58
57
|
prerelease: false
|
59
58
|
version_requirements: !ruby/object:Gem::Requirement
|
60
59
|
requirements:
|
61
60
|
- - ">="
|
62
61
|
- !ruby/object:Gem::Version
|
63
|
-
version:
|
62
|
+
version: 7.0.0
|
64
63
|
- - "<"
|
65
64
|
- !ruby/object:Gem::Version
|
66
|
-
version: '
|
65
|
+
version: '9.0'
|
67
66
|
- !ruby/object:Gem::Dependency
|
68
67
|
name: activerecord
|
69
68
|
requirement: !ruby/object:Gem::Requirement
|
70
69
|
requirements:
|
71
70
|
- - ">="
|
72
71
|
- !ruby/object:Gem::Version
|
73
|
-
version:
|
72
|
+
version: 7.0.0
|
74
73
|
- - "<"
|
75
74
|
- !ruby/object:Gem::Version
|
76
|
-
version: '
|
75
|
+
version: '9.0'
|
77
76
|
type: :development
|
78
77
|
prerelease: false
|
79
78
|
version_requirements: !ruby/object:Gem::Requirement
|
80
79
|
requirements:
|
81
80
|
- - ">="
|
82
81
|
- !ruby/object:Gem::Version
|
83
|
-
version:
|
82
|
+
version: 7.0.0
|
84
83
|
- - "<"
|
85
84
|
- !ruby/object:Gem::Version
|
86
|
-
version: '
|
85
|
+
version: '9.0'
|
87
86
|
- !ruby/object:Gem::Dependency
|
88
87
|
name: minitest
|
89
88
|
requirement: !ruby/object:Gem::Requirement
|
@@ -153,7 +152,6 @@ homepage: ''
|
|
153
152
|
licenses:
|
154
153
|
- MIT
|
155
154
|
metadata: {}
|
156
|
-
post_install_message:
|
157
155
|
rdoc_options: []
|
158
156
|
require_paths:
|
159
157
|
- lib
|
@@ -161,15 +159,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
161
159
|
requirements:
|
162
160
|
- - ">="
|
163
161
|
- !ruby/object:Gem::Version
|
164
|
-
version: 2.
|
162
|
+
version: 2.7.0
|
165
163
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
166
164
|
requirements:
|
167
165
|
- - ">="
|
168
166
|
- !ruby/object:Gem::Version
|
169
167
|
version: '0'
|
170
168
|
requirements: []
|
171
|
-
rubygems_version: 3.
|
172
|
-
signing_key:
|
169
|
+
rubygems_version: 3.6.9
|
173
170
|
specification_version: 4
|
174
171
|
summary: I18n date/number parsing/localization
|
175
172
|
test_files:
|