zopen 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/zopen.rb +12 -12
- 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: b97ac6a008c95a2bf01bc09976919d43ca557922
|
4
|
+
data.tar.gz: d883f2917c04e223ad8ba5b45264cede4f004d4d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 353cb39f04c2980897093b1ac8fb4fa81ccc899474893cb0373d1f10252d4885bc263c78dc19f259f845331b0cfde2ffe6342599b1e31f9215cb79de161c20aa
|
7
|
+
data.tar.gz: ac690a82001bfedfdd17d7c3444c1019fd0a93a27e3bb4fa6eeb155d416a40d635d874303e23cc215a0978a7b0d28d43ff64017c73730036f8eaf59b6a3b4645
|
data/lib/zopen.rb
CHANGED
@@ -33,14 +33,14 @@ module ZOpen
|
|
33
33
|
begin
|
34
34
|
require 'zlib'
|
35
35
|
case mode
|
36
|
-
when
|
37
|
-
when
|
36
|
+
when /r/, nil then Zlib::GzipReader.open(filename)
|
37
|
+
when /w/ then Zlib::GzipWriter.open(filename)
|
38
38
|
else fail "Unsupported open mode: #{mode}"
|
39
39
|
end
|
40
40
|
rescue LoadError
|
41
41
|
case mode
|
42
|
-
when
|
43
|
-
when
|
42
|
+
when /r/, nil then IO.popen("gzip -d -c '#{filename}'", mode)
|
43
|
+
when /w/ then IO.popen("gzip -c - > '#{filename}'", mode)
|
44
44
|
else fail "Unsupported open mode: #{mode}"
|
45
45
|
end
|
46
46
|
end
|
@@ -54,14 +54,14 @@ module ZOpen
|
|
54
54
|
begin
|
55
55
|
require 'bzip2'
|
56
56
|
case mode
|
57
|
-
when
|
58
|
-
when
|
57
|
+
when /r/, nil then Bzip2::Reader.open(filename)
|
58
|
+
when /w/ then Bzip2::Writer.open(filename)
|
59
59
|
else fail "Unsupported open mode: #{mode}"
|
60
60
|
end
|
61
61
|
rescue LoadError
|
62
62
|
case mode
|
63
|
-
when
|
64
|
-
when
|
63
|
+
when /r/, nil then IO.popen("bzip2 -d -c '#{filename}'", mode)
|
64
|
+
when /w/ then IO.popen("bzip2 -c - > '#{filename}'", mode)
|
65
65
|
else fail "Unsupported open mode: #{mode}"
|
66
66
|
end
|
67
67
|
end
|
@@ -75,14 +75,14 @@ module ZOpen
|
|
75
75
|
begin
|
76
76
|
require 'xz'
|
77
77
|
case mode
|
78
|
-
when
|
79
|
-
when
|
78
|
+
when /r/, nil then ::XZ::StreamReader.open(filename)
|
79
|
+
when /w/ then ::XZ::StreamWriter.open(filename)
|
80
80
|
else fail "Unsupported open mode: #{mode}"
|
81
81
|
end
|
82
82
|
rescue LoadError
|
83
83
|
case mode
|
84
|
-
when
|
85
|
-
when
|
84
|
+
when /r/, nil then IO.popen("xz -d -c '#{filename}'", mode)
|
85
|
+
when /w/ then IO.popen("xz -c - > '#{filename}'", mode)
|
86
86
|
else fail "Unsupported open mode: #{mode}"
|
87
87
|
end
|
88
88
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zopen
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Frank Fischer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-02-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: yard
|
@@ -56,7 +56,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
56
56
|
version: '0'
|
57
57
|
requirements: []
|
58
58
|
rubyforge_project:
|
59
|
-
rubygems_version: 2.
|
59
|
+
rubygems_version: 2.4.3
|
60
60
|
signing_key:
|
61
61
|
specification_version: 4
|
62
62
|
summary: Automatically open compressed files
|