tater 1.3.0 → 1.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/tater.rb +5 -7
- data/test/fixtures/ruby.rb +4 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fcee8d4b1aa16306c1ca8b0ce013e2210a317a05b4c3b466a37203600fb90237
|
4
|
+
data.tar.gz: a00686eebe67c2c0e8cb92c6d0c82c45664cacddc17111f6f4fcb6f539439841
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4157223bbd415daaf23d494aea0c16a42708d92629119b8c1f3071bf424dfa29775aac52b136af669fe5b24b17c4f521271f76921f3c7d04da8c15921227ee7d
|
7
|
+
data.tar.gz: 29ab82f420856629db3c559594fa0bf8a6abb8b5bc24295913528945cfb823f80eb3646b616ae749ad88d4b457229fd5b6005d50bc9b6aece52617152313c457
|
data/lib/tater.rb
CHANGED
@@ -126,7 +126,7 @@ class Tater
|
|
126
126
|
end
|
127
127
|
|
128
128
|
Dir.glob(File.join(path, '**', '*.rb')).each do |file|
|
129
|
-
Utils.deep_merge!(@messages, Utils.deep_stringify_keys!(eval(IO.read(file), binding, file)))
|
129
|
+
Utils.deep_merge!(@messages, Utils.deep_stringify_keys!(eval(IO.read(file), binding, file))) # rubocop:disable Security/Eval
|
130
130
|
end
|
131
131
|
end
|
132
132
|
|
@@ -255,14 +255,12 @@ class Tater
|
|
255
255
|
path = key.split(SEPARATOR).prepend(locale_override || locale).map(&:to_s)
|
256
256
|
|
257
257
|
if cascade_override.nil? ? @cascade : cascade_override
|
258
|
-
while path.length >= 2
|
258
|
+
while path.length >= 2
|
259
259
|
attempt = @messages.dig(*path)
|
260
260
|
|
261
|
-
if attempt
|
262
|
-
|
263
|
-
|
264
|
-
path.delete_at(path.length - 2)
|
265
|
-
end
|
261
|
+
break attempt if attempt
|
262
|
+
|
263
|
+
path.delete_at(path.length - 2)
|
266
264
|
end
|
267
265
|
else
|
268
266
|
@messages.dig(*path)
|
data/test/fixtures/ruby.rb
CHANGED
@@ -1,10 +1,11 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
{
|
2
3
|
en: {
|
3
|
-
ruby: proc do |key,
|
4
|
+
ruby: proc do |key, _options = {}|
|
4
5
|
"Hey #{ key }!"
|
5
6
|
end,
|
6
|
-
options: proc do |_key,
|
7
|
-
|
7
|
+
options: proc do |_key, _options = {}|
|
8
|
+
'Hey %{options}!'
|
8
9
|
end
|
9
10
|
}
|
10
11
|
}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tater
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Evan Lecklider
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-08-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: minitest
|