scbi_multi_gz_reader 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bff6f483b2c9eb929aecd04e2054cadbfcd38407
4
- data.tar.gz: f4822e17db2570421cabd7a1859eb28c8d9217cd
3
+ metadata.gz: 80f067ad37acb4b7f35f7baf68194b9a4788df57
4
+ data.tar.gz: eb30a354277f9fad2e98769787ddd37089914acb
5
5
  SHA512:
6
- metadata.gz: 8b64117d3461220161b04fb5fbfbccaafeb24719fa7861753447992eff3c077f6a390b55406f89dbed13dfe856cbbaf2167eb74969dec12732fe680ed444969a
7
- data.tar.gz: 2b4b01f1d4bda02b04bc943aa84668d79217fb7b7a88372b53bf4c9cbbccf21d24546bc6e844b890c39c0614c6e333b56d9991f424f191bdd5fd59a158956054
6
+ metadata.gz: 41359ba15d1cc47c057bf2f9dbefbfd91f09df189ccc36d88ce0018c5e46f2c931298dd6ee7f01ff3b1920c61cd746b8ba3e301d1c35cc05fe74a6d130696670
7
+ data.tar.gz: c5e69a0305c4e8839919c3dc7a40043321fb9aa4b0ed13faa9f97e663160e2937014ac2ec16e3e6fa24bf713096374e632bf3a6313410a0ae7f6225719576604
data/README.md CHANGED
@@ -27,7 +27,7 @@ Or install it yourself as:
27
27
 
28
28
  # read checking for eof
29
29
 
30
- file=MultiGzReader.new('file.gz'))
30
+ file=MultiGzReader.new('file.gz')
31
31
 
32
32
  while !file.eof? do
33
33
  puts file.readline
@@ -38,7 +38,7 @@ Or install it yourself as:
38
38
  ------
39
39
 
40
40
  # read checking for res.nil?
41
- file=MultiGzReader.new('file.gz'))
41
+ file=MultiGzReader.new('file.gz')
42
42
 
43
43
  loop do
44
44
  res=file.readline
@@ -3,7 +3,9 @@ require 'zlib'
3
3
  class MultiGzReader
4
4
 
5
5
  def initialize(file_name)
6
- @file = File.open(file_name)
6
+ @file_name=file_name
7
+
8
+ @file = File.open(@file_name)
7
9
  @io = Zlib::GzipReader.new @file
8
10
  end
9
11
 
@@ -43,9 +45,19 @@ class MultiGzReader
43
45
  @io.unused.nil? && (@io.closed? || @io.eof?) && (@file.closed? || @file.eof?)
44
46
  end
45
47
 
48
+ def eof
49
+ eof?
50
+ end
51
+
46
52
  def close
47
53
  #@io.finish
48
54
  @file.close
49
55
  end
50
56
 
57
+ def rewind
58
+ close
59
+ @file = File.open(@file_name)
60
+ @io = Zlib::GzipReader.new @file
61
+ end
62
+
51
63
  end
@@ -1,3 +1,3 @@
1
1
  module ScbiMultiGzReader
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scbi_multi_gz_reader
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - dariogf
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-14 00:00:00.000000000 Z
11
+ date: 2015-07-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -84,7 +84,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
84
84
  version: '0'
85
85
  requirements: []
86
86
  rubyforge_project:
87
- rubygems_version: 2.2.2
87
+ rubygems_version: 2.4.4
88
88
  signing_key:
89
89
  specification_version: 4
90
90
  summary: Reads gz/gzip files with multiple streams in ruby