scbi_multi_gz_reader 0.0.1 → 0.0.2
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 +4 -4
- data/README.md +2 -2
- data/lib/scbi_multi_gz_reader/multi_gz_reader.rb +13 -1
- data/lib/scbi_multi_gz_reader/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 80f067ad37acb4b7f35f7baf68194b9a4788df57
|
4
|
+
data.tar.gz: eb30a354277f9fad2e98769787ddd37089914acb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
@
|
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
|
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.
|
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:
|
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.
|
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
|