lib/kvmultiplex/multiplexer.rb in kvmultiplex-0.1.7 vs lib/kvmultiplex/multiplexer.rb in kvmultiplex-0.1.8

- old
+ new

@@ -46,10 +46,13 @@ if providers.nil? || providers.empty? logger.warn "No providers for '#{full_key.inspect}'." nil else - ret = providers.find { |provider| provider.get(subkey, full_key) } + ret = + providers.lazy + .map { |provider| provider.get(subkey, full_key) } + .find { |v| !v.nil? } logger.warn "No values found for '#{full_key.inspect}'." if ret.nil? ret end end