epitools 0.5.68 → 0.5.69

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: cf33dd375363508818c6ac7d6c1e68fce555e684
4
- data.tar.gz: fe79ff4bb2eba59fb018c39f3b0e85ccfbb204bf
3
+ metadata.gz: cbd16b1a9e260dacf57c14aa797c3e62f3494147
4
+ data.tar.gz: a4430c1b4e353d00499212393b38fd034592639f
5
5
  SHA512:
6
- metadata.gz: 4fa7a7517870a0e5db81be2f9a24996ee09519d97b72b12c041a899cd4ea35beeb3344afcc9ccd7793df3db85a49ccbb5704d6ec29b3b8d23dd65beea9074d06
7
- data.tar.gz: e893e9ec0cd8a8fafd8918929d56f8ab61a47f818d851504d8e5f4a90aeb517f9a4a59547bd14b76e6b8645773ad0eed955d3983b2efb8580247fcbc3a892066
6
+ metadata.gz: 0386c8c0bcb04edecaa233f9660bdf349854467c39b7881d4a7226027f47de824c58858998469bab1ff6d1a836aa7d5ea6b237d07a40b4e4738211afa7e44189
7
+ data.tar.gz: 570fb038069057774db9d1ceedb44bcdc2302e604569b51b3d51a775262ef55a2af22e465ba2cbfaf1b44bfb83997be729c212483402cb4d62054587c2600917
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.5.68
1
+ 0.5.69
@@ -603,6 +603,16 @@ class Path
603
603
  File.read(path, length, offset)
604
604
  end
605
605
 
606
+ #
607
+ # Read the contents of the file, yielding it in 16k chunks. (default chunk size is 16k)
608
+ #
609
+ def each_chunk(chunk_size=2**14)
610
+ open do |f|
611
+ yield f.read(chunk_size) until f.eof?
612
+ end
613
+ end
614
+
615
+
606
616
  #
607
617
  # All the lines in this file, chomped.
608
618
  #
@@ -566,4 +566,9 @@ describe Path do
566
566
  file.atime.should == beforebefore
567
567
  end
568
568
 
569
+ it "each_chunks" do
570
+ path = Path["/etc/passwd"]
571
+ path.each_chunk(20) { |chunk| chunk.size.should == 20; break }
572
+ end
573
+
569
574
  end
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.68
4
+ version: 0.5.69
5
5
  platform: ruby
6
6
  authors:
7
7
  - epitron