tater 1.3.0 → 1.3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/tater.rb +5 -7
  3. data/test/fixtures/ruby.rb +4 -3
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6fe610aeeb910795f9f07f52bdbfa529a6f10ac5b807a8252a0d0f50e24ca6a6
4
- data.tar.gz: a4154b7803f31babbb012f2f65f36b16f4ea929a43f30a9388b0be10d717f1d7
3
+ metadata.gz: fcee8d4b1aa16306c1ca8b0ce013e2210a317a05b4c3b466a37203600fb90237
4
+ data.tar.gz: a00686eebe67c2c0e8cb92c6d0c82c45664cacddc17111f6f4fcb6f539439841
5
5
  SHA512:
6
- metadata.gz: e478a0bb35614afcf58b79f4d2511f02a25772decbf5e1ea5f4ccbb574ea1699fb7f13bc7174aca5ee12cb6fe0130f7a5466a069cc1fca0435569a6e5db2c58d
7
- data.tar.gz: f7f31381024e298d33cdf53ae6609218ab671d27c2fd3c0f1e4f8595a28d87f2f46b6f9d03b27e2c186aec6fc4c4a707850287ca98420ff2ef7a2444d8c7fef9
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 do
258
+ while path.length >= 2
259
259
  attempt = @messages.dig(*path)
260
260
 
261
- if attempt
262
- break attempt
263
- else
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)
@@ -1,10 +1,11 @@
1
+ # frozen_string_literal: true
1
2
  {
2
3
  en: {
3
- ruby: proc do |key, options = {}|
4
+ ruby: proc do |key, _options = {}|
4
5
  "Hey #{ key }!"
5
6
  end,
6
- options: proc do |_key, options = {}|
7
- "Hey %{options}!"
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.0
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-07-19 00:00:00.000000000 Z
11
+ date: 2019-08-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest