totally_lazy 0.1.50 → 0.1.51

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MTliMjJhMjVlMDc0ZWY2MTA2MTQwMzY1NjhhNzkzMzQyZjg3MDFlZg==
4
+ MTA2MGMwNjNjMzQyNmIyZjAzZmYxY2NhZTBjNzMyMWZlOTdjOTVjYQ==
5
5
  data.tar.gz: !binary |-
6
- MzUzYmM0MDE0MWJiNjRmN2E4NTlhMzMwYmViZjk1NTEyMjk5ODcwOA==
6
+ NGM4MDZkNDVhNDU5OGRlYzI5NDFlMWIyYWY4NjkxMmFlZTEzMzdiZQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MDkyYjIzZTlhYjYxMTAwN2M1NWU1NWVjMTFkYWQ4MTM0ZWQ4N2NhYWU0Mzdm
10
- ZGE3YWMyYWY5YTk4ZmIyY2I3MjU2ZThhOWE2N2JjZjU5OTZmNjVlMjMzZGVh
11
- NzE3MWVlZmMyNzBlMjgxMjFjOTU5Mjc3ODgxYzJiZDYyMTQyMGQ=
9
+ ZmRhNjQyZGVhMjU1OGE4OGQ5MzNlMzQyYmY0NjM2MWI3YTI0YTI5YWIwYmY4
10
+ ZDUyMGU2MmI5OWYwYjkyNzczNTczYTA3MTI3ODg2YmYwMzE1MzEzNDZjZjc0
11
+ NmQ1YWJkNzYxYjAyOWE3MjE4ZjlhMTY3OTJjNjU0ZWJmYmZlYzU=
12
12
  data.tar.gz: !binary |-
13
- ZmQxZTVlNzA2MWY5OTgyYThmYWQwYmIwZGJlNmM0YTg0MDhjNzEyMDJjNWY3
14
- ODI1MWJhNDcxYjBlZDJiYmRkMzJkNjdhOWFlZmNmY2M5NTZjN2FiMzc3NGM2
15
- OGNlNTUwNmE1MTM1Y2RjNmU1MmZmMWRjOThiNzFiYzIwMDZkZTk=
13
+ OGM3MzBlYjZiZTY0ZTA2YTY1NTEyYjE2OTU2M2JmMjlmMmYwNWU2Mjk0YjI2
14
+ ZGU0MzhmY2FjMTE4NGM2MWNjMWYxNTFjYjMzZGI2NTM1ZDllOTEzZTg3OTVk
15
+ ODVmZmYzYzAyN2I2Mjk5NzM3NzlkOTFkMTk3NDU3MzVkMDlmN2I=
@@ -48,6 +48,7 @@ module Enumerators
48
48
  end
49
49
 
50
50
  def flatten_enumerator(enumerator)
51
+ enumerator.rewind
51
52
  Enumerator.new do |y|
52
53
  current_enumerator = empty_enumerator
53
54
 
@@ -55,6 +56,7 @@ module Enumerators
55
56
  until has_next(current_enumerator)
56
57
  return empty_enumerator unless has_next(enumerator)
57
58
  current_enumerator = enumerator.next.enumerator
59
+ current_enumerator.rewind
58
60
  end
59
61
  current_enumerator
60
62
  }
@@ -211,6 +211,12 @@ describe 'Sequence' do
211
211
  expect(sequence(sequence(1)).flatten).to eq(sequence(1))
212
212
  end
213
213
 
214
+ it 'should allow flattening multiple times' do
215
+ sequence = sequence(sequence('1', '2'), empty, sequence('4', '5'))
216
+ expect(sequence.flatten).to eq(sequence('1', '2', '4', '5'))
217
+ expect(sequence.flatten).to eq(sequence('1', '2', '4', '5'))
218
+ end
219
+
214
220
  it 'should support drop' do
215
221
  expect(sequence(1, 2, 3).drop(2)).to eq(sequence(3))
216
222
  expect(sequence(1).drop(2)).to eq(empty)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: totally_lazy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.50
4
+ version: 0.1.51
5
5
  platform: ruby
6
6
  authors:
7
7
  - Raymond Barlow