backports 2.8.0 → 2.8.1
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.
- 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