backports 2.8.0 → 2.8.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/backports/2.0.0/enumerator/lazy.rb +3 -2
- data/lib/backports/version.rb +1 -1
- metadata +1 -1
@@ -115,8 +115,9 @@ class Enumerator
|
|
115
115
|
raise ArgumentError, "tried to call lazy flat_map without a block" unless block_given?
|
116
116
|
Lazy.new(self) do |yielder, *values|
|
117
117
|
result = yield(*values)
|
118
|
-
|
119
|
-
|
118
|
+
ary = Backports.is_array?(result)
|
119
|
+
if ary || (result.respond_to?(:each) && result.respond_to?(:force))
|
120
|
+
(ary || result).each{|x| yielder << x }
|
120
121
|
else
|
121
122
|
yielder << result
|
122
123
|
end
|
data/lib/backports/version.rb
CHANGED