epitools 0.5.65 → 0.5.66

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: 94166d901d6ab0595ed2a71eec10b24d91d52fec
4
- data.tar.gz: 1eecd4e24c563b3622a20f3da7606c2bd558ed60
3
+ metadata.gz: b21feb448e04c5e66454eb31818b0b78e9d7e36e
4
+ data.tar.gz: baa845fabc8a02be3239af3b21f8e1149796ccd3
5
5
  SHA512:
6
- metadata.gz: beea01a551fa4042079de50f34ad39e75d1b7d42a996350c4983febfa63cb0771e525f7eeb949907a9d27be3bbc27f53dd6774e0dfd847b21aa0986bec986328
7
- data.tar.gz: 65e93518be6608ee373e76ed7dddc9c1ef53b9fe1182f96409d9cad75b880e218ada0ff8d56c6e2cf8fac226c6a451e6c88914a9b2d48de817e508b7ec16a17f
6
+ metadata.gz: 2f3805e7813acd3582fd6db84925969711e3cda216adfb7f219e6ee2d89ab3a5574a12bb160c60fa2df4f4429d9b87ca6686b1f88baf54113a8caa5591557b95
7
+ data.tar.gz: c713ea6609db9fe3a257af5b01ea9fddb13f45d5e9ba2bd9f7bc48a3d955b6b141669e4eb23c1f48366216863a34c30dd1dc714b1f7d5c3660d074b2cab8f084
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.5.65
1
+ 0.5.66
@@ -51,8 +51,14 @@ class Array
51
51
  # => [ [:mins, 5], [:secs, 39] ]
52
52
  #
53
53
  def rzip(other)
54
- # That's a lotta reverses!
55
- reverse.zip(other.reverse).reverse
54
+ reverse.zip(other.reverse).reverse # That's a lotta reverses!
55
+ end
56
+
57
+ #
58
+ # See: Enumerable#split_at
59
+ #
60
+ def split_at(*args, &block)
61
+ super.to_a
56
62
  end
57
63
 
58
64
  #
@@ -470,9 +470,9 @@ describe Enumerable do
470
470
  end
471
471
 
472
472
  it "splits" do
473
- [1,2,3,4,5].split_at {|e| e == 3}.to_a.should == [ [1,2], [4,5] ]
474
- [1,2,3,4,5].split_after {|e| e == 3}.to_a.should == [ [1,2,3], [4,5] ]
475
- [1,2,3,4,5].split_before {|e| e == 3}.to_a.should == [ [1,2], [3,4,5] ]
473
+ [1,2,3,4,5].split_at {|e| e == 3}.should == [ [1,2], [4,5] ]
474
+ [1,2,3,4,5].split_after {|e| e == 3}.should == [ [1,2,3], [4,5] ]
475
+ [1,2,3,4,5].split_before {|e| e == 3}.should == [ [1,2], [3,4,5] ]
476
476
 
477
477
  result = "a\nb\n---\nc\nd\n".lines.split_at(/---/)
478
478
  result.map_recursively(&:strip).should == [ %w[a b], %w[c d] ]
@@ -485,17 +485,22 @@ describe Enumerable do
485
485
  array.split_at("a")
486
486
  }.should_not raise_error
487
487
 
488
- array.split_at("a").to_a.should == [ array[0..1], array[3..3] ]
489
- array.split_at([1,2,3]).to_a.should == [ array[0..2] ]
488
+ array.split_at("a").should == [ array[0..1], array[3..3] ]
489
+ array.split_at([1,2,3]).should == [ array[0..2] ]
490
490
  end
491
491
 
492
- it "handles arbitrary objects" do
492
+ it "splits with arbitrary objects" do
493
493
  arbitrary = Struct.new(:a, :b, :c)
494
494
 
495
495
  particular = arbitrary.new(1,2,3)
496
496
  array = [ arbitrary.new, arbitrary.new, particular, arbitrary.new]
497
497
 
498
- array.split_at(particular).to_a.should == [ array[0..1], array[3..3] ]
498
+ array.split_at(particular).should == [ array[0..1], array[3..3] ]
499
+ end
500
+
501
+ it "splits lazily" do
502
+ result = "a\nb\nc\nd".each_line.split_at("b")
503
+ result.is_an?(Enumerator).should == true
499
504
  end
500
505
 
501
506
  it "sums" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: epitools
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.65
4
+ version: 0.5.66
5
5
  platform: ruby
6
6
  authors:
7
7
  - epitron