i18nliner 0.2.2 → 0.2.3

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: f9f3816293c70dfd95ca1cd66cb80d611f283c416e2dc0bd9eec08723d33f32e
4
- data.tar.gz: e41ce0ba376064862cc64d063b2ac2cdf48002136446079f403255e9cb6a69b9
3
+ metadata.gz: bbb90fe50e15cd800c8fe6266435e6ad65da7f403939cbf619c866b843b6792e
4
+ data.tar.gz: cf1778863ed5faf6346c491162c90acd52c0e51e4efda4a114bbd13e99f04ed7
5
5
  SHA512:
6
- metadata.gz: b31d8fdd70c548e770d92584e9c35f6ce15ca60a6bc8a1d835cb2b90653b6de63029d35fcd2465245d473f1cab5914634a290faa344c8a5ec0e115dfcb4947b1
7
- data.tar.gz: 90a338c6438b59dfa6b0f51af4f4c97b747b068390e975f68e8a6af9ba5ddf3b0c735ffc2e46ca7fe63effc8c5ce2f037e6a808b6a50ae197a9d5110a5088895
6
+ metadata.gz: 74400054da78cccfd58e5a54eb452bf46b79464ea2d398536acb62ff37cbba84b044c757cbf45c0950ab22f493dd3d0ac018613a6bcc66e2d40bcca34b36e507
7
+ data.tar.gz: 05fddfa85858798700910737ba60e57e0e8da23605792fa6e822ce6ef524f5a98e41fb22face1ad9aed57f4ef9da7d1f0db797898273ffdf4ac71ac33de03dd5
@@ -13,7 +13,7 @@ module I18nliner
13
13
  key, options = CallHelpers.infer_arguments(args)
14
14
  options = inferpolate(options) if I18nliner.infer_interpolation_values
15
15
  options[:i18nliner_scope] = i18nliner_scope
16
- super(key, options)
16
+ super(key, **options)
17
17
  end
18
18
  alias :t :translate
19
19
  alias :t! :translate
@@ -17,7 +17,7 @@ module I18nliner
17
17
  end
18
18
 
19
19
  wrappers = options.delete(:wrappers) || options.delete(:wrapper)
20
- result = super(key, options)
20
+ result = super(key, **options)
21
21
 
22
22
  # Exit now unless we have a string or a thing that delegates to a string
23
23
  return result unless result.respond_to?(:gsub)
@@ -13,7 +13,7 @@ module I18nliner
13
13
  key, options = CallHelpers.infer_arguments(args)
14
14
  options = inferpolate(options) if I18nliner.infer_interpolation_values
15
15
  options[:i18nliner_scope] = i18nliner_scope
16
- I18n.translate(key, options)
16
+ I18n.translate(key, **options)
17
17
  end
18
18
  alias :t :translate
19
19
  alias :t! :translate
@@ -17,7 +17,7 @@ module I18nliner
17
17
  key, options = CallHelpers.infer_arguments(args)
18
18
  options = inferpolate(options) if I18nliner.infer_interpolation_values
19
19
  options[:i18nliner_scope] = i18nliner_scope
20
- super(key, options)
20
+ super(key, **options)
21
21
  rescue ArgumentError
22
22
  raise
23
23
  end
@@ -8,7 +8,7 @@ describe I18nliner::Extensions::Controller do
8
8
  extend(Module.new do
9
9
  def translate(key, options)
10
10
  options.delete(:i18nliner_inferred_key)
11
- I18n.translate(key, options)
11
+ I18n.translate(key, **options)
12
12
  end
13
13
 
14
14
  def controller_name
@@ -5,11 +5,15 @@ describe I18nliner::Extensions::Core do
5
5
  let(:i18n) do
6
6
  Module.new do
7
7
  extend(Module.new do
8
- def translate(*args)
9
- simple_translate(args[0], args[1])
8
+ def translate(key, **options)
9
+ if RUBY_VERSION >= '3.0'
10
+ simple_translate(key, **options)
11
+ else
12
+ simple_translate(key, options)
13
+ end
10
14
  end
11
15
 
12
- def simple_translate(key, options)
16
+ def simple_translate(key, **options)
13
17
  string = options.delete(:default)
14
18
  interpolate_hash(string, options)
15
19
  end
@@ -48,7 +52,11 @@ describe I18nliner::Extensions::Core do
48
52
  end
49
53
 
50
54
  it "should stringify array keys, but not the array itself" do
51
- expect(i18n).to receive(:simple_translate).with(["bar", "baz"], {})
55
+ if RUBY_VERSION >= '3.0'
56
+ expect(i18n).to receive(:simple_translate).with(["bar", "baz"])
57
+ else
58
+ expect(i18n).to receive(:simple_translate).with(["bar", "baz"], {})
59
+ end
52
60
  i18n.translate([:bar, :baz])
53
61
  end
54
62
 
@@ -6,9 +6,9 @@ describe I18nliner::Extensions::View do
6
6
  let(:i18n) do
7
7
  Module.new do
8
8
  extend(Module.new do
9
- def translate(key, options)
9
+ def translate(key, **options)
10
10
  options.delete(:i18nliner_inferred_key)
11
- I18n.translate(key, options)
11
+ I18n.translate(key, **options)
12
12
  end
13
13
  end)
14
14
  extend I18nliner::Extensions::View
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: i18nliner
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jon Jensen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-08-10 00:00:00.000000000 Z
11
+ date: 2023-03-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -24,6 +24,20 @@ dependencies:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '6.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: i18n
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: 1.8.6
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: 1.8.6
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: ruby_parser
29
43
  requirement: !ruby/object:Gem::Requirement