tater 3.0.3 → 3.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/tater.rb +14 -10
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7176a93dd72c2135f8114c2baed2d4fdda8ffcb7c02312517810d94f9e275dce
4
- data.tar.gz: 5dea4c80c2a894063790d2cd4ed2232e8566b3cae4a3ab9a73a2be3c45ffd4f5
3
+ metadata.gz: 1913c7bc9ecb58cbb7ff7c4239978c8401116a954f967e1fd1e557ad30b0e7bd
4
+ data.tar.gz: cd65a35921e999375affaf4a38717fc14c6938285f3ad1d4258727494a212d40
5
5
  SHA512:
6
- metadata.gz: b32716e497cc9a2e81eded3bc277450d143ffec829b4accf3b3396b2c1afb28b4c66bab044695cf13bd6b64ff830d4168b181435565864e977f59ce9fcf6df1e
7
- data.tar.gz: bd697439d8db3cd1607762bd92adb13e066fb40e16c7db6469a8e2a226774480a4cd1ba19651d45673c6ce819e9f7913af82c0b779c37c5f803e0c72ce3d42ff
6
+ metadata.gz: 8744cffa6df1821728ee83f221899d7b5dae739c9420f0ce40bbd02f9b7a7d1388aeed8f54a3d029663a2843b0fca915cd277dc688b044a559c994630695bfc1
7
+ data.tar.gz: 4e0cfde2f00feaf6e3ce76aec920b0f56a208dfc59e18f0af0c679fe1f8d733ce6c5343bdafc36df33bb2170b6ac660e36d906161273ddf7a3c9fc0a96cf78aa
data/lib/tater.rb CHANGED
@@ -210,20 +210,24 @@ class Tater
210
210
  #
211
211
  # @return [Boolean]
212
212
  def includes?(key, options = HASH)
213
- message =
214
- if options.key?(:locales)
215
- options[:locales].append(@locale) if @locale && !options[:locales].include?(@locale)
213
+ if options.empty?
214
+ !lookup(key).nil?
215
+ else
216
+ message =
217
+ if options.key?(:locales)
218
+ options[:locales].append(@locale) if @locale && !options[:locales].include?(@locale)
216
219
 
217
- options[:locales].find do |accept|
218
- found = lookup(key, locale: accept, cascade: options[:cascade])
220
+ options[:locales].find do |accept|
221
+ found = lookup(key, locale: accept, cascade: options[:cascade])
219
222
 
220
- break found unless found.nil?
223
+ break found unless found.nil?
224
+ end
225
+ else
226
+ lookup(key, locale: options[:locale], cascade: options[:cascade])
221
227
  end
222
- else
223
- lookup(key, locale: options[:locale], cascade: options[:cascade])
224
- end
225
228
 
226
- !message.nil?
229
+ !message.nil?
230
+ end
227
231
  end
228
232
 
229
233
  # Translate a key path and optional interpolation arguments into a string.
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: 3.0.3
4
+ version: 3.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Evan Lecklider
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-12-19 00:00:00.000000000 Z
11
+ date: 2021-12-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler