redlics 0.1.4 → 0.1.5

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
  SHA1:
3
- metadata.gz: 03c354152044a62cf2a313e57b2abdd007ec99c8
4
- data.tar.gz: 6da2368b9fd7fa34c3269cc0fba59a3244b3014e
3
+ metadata.gz: e209a0d28a8c6801d74bebb90f5c312ffba4c0fa
4
+ data.tar.gz: 08731d68e6011753ec19e6b442c88817e396489d
5
5
  SHA512:
6
- metadata.gz: 07719d523d0675359e319e65bacaf189328c9f1bbbfc7a3da8bde6410aff6d357cdfecf6131da71a5a0748053f9e9787a9aed8026de035aa64cea79871562866
7
- data.tar.gz: cad96df38256ea283ccdc5ddf5fb6ff7e06ed4b8feddcd6fcaaec2a46c5e39c588b9a163c8f4ffb2c052ffb11bee0141cae964623b8f4003b05cdb6d87e0a792
6
+ metadata.gz: 5826f1386d60337a73e7ae43a4395be4e4d598936f8dfcd9f9215d63a1f288d67549d99e0861818c6cc0addce14877f28e9aeeb77a4f12a2a060b6660c5be2cb
7
+ data.tar.gz: 3ad74bb843d68743debd2052610c3bf9ed0b80af4789b5167ba5a17e1f7394f8d65673e413c77c10a3adac0213b7a4251532d22e902157d1f3398d31d8d4b742
@@ -37,10 +37,13 @@ module Redlics
37
37
  # @return [Array] includes all valid granularities
38
38
  def check(granularities)
39
39
  keys = Redlics.config.granularities.keys
40
- checked = if granularities.is_a?(Range)
40
+ checked = case granularities
41
+ when Range
41
42
  keys[keys.index(granularities.first.to_sym)..keys.index(granularities.last.to_sym)]
43
+ when Array
44
+ [granularities.map(&:to_sym)].flatten & keys
42
45
  else
43
- [granularities.to_sym].flatten & Redlics.config.granularities.keys
46
+ [granularities && granularities.to_sym].flatten & keys
44
47
  end
45
48
  checked.any? ? checked : nil
46
49
  end
@@ -1,4 +1,4 @@
1
1
  # Redlics version.
2
2
  module Redlics
3
- VERSION = '0.1.4'
3
+ VERSION = '0.1.5'
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redlics
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Egon Zemmer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-04-20 00:00:00.000000000 Z
11
+ date: 2016-04-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: connection_pool