zopen 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/zopen.rb +12 -12
  3. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d6abbc44cb791a3f2d59b637c8a6ab32f38ddc62
4
- data.tar.gz: 09c8b9647f0c3c7b7e6456a8f980508a2f795a59
3
+ metadata.gz: b97ac6a008c95a2bf01bc09976919d43ca557922
4
+ data.tar.gz: d883f2917c04e223ad8ba5b45264cede4f004d4d
5
5
  SHA512:
6
- metadata.gz: b78872f6515e92e4fefd6ac368792bdf42185bf891b4113fb754c01dbece7cb735b174ad4938a8f506e25762a06a42df3fa8562f153e72c75bcdf81684e8b5b2
7
- data.tar.gz: a0d4143893223baeaaab789947a5d75695c5702db4da538442f33005b3bc32dbbec78d6000a2c3e2a8e168d9fa4c9e724709b954bd4207caf4de1eceadee4418
6
+ metadata.gz: 353cb39f04c2980897093b1ac8fb4fa81ccc899474893cb0373d1f10252d4885bc263c78dc19f259f845331b0cfde2ffe6342599b1e31f9215cb79de161c20aa
7
+ data.tar.gz: ac690a82001bfedfdd17d7c3444c1019fd0a93a27e3bb4fa6eeb155d416a40d635d874303e23cc215a0978a7b0d28d43ff64017c73730036f8eaf59b6a3b4645
@@ -33,14 +33,14 @@ module ZOpen
33
33
  begin
34
34
  require 'zlib'
35
35
  case mode
36
- when 'r', nil then Zlib::GzipReader.open(filename)
37
- when 'w' then Zlib::GzipWriter.open(filename)
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 'r', nil then IO.popen("gzip -d -c '#{filename}'", 'r')
43
- when 'w' then IO.popen("gzip -c - > '#{filename}'", 'w')
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 'r', nil then Bzip2::Reader.open(filename)
58
- when 'w' then Bzip2::Writer.open(filename)
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 'r', nil then IO.popen("bzip2 -d -c '#{filename}'", 'r')
64
- when 'w' then IO.popen("bzip2 -c - > '#{filename}'", 'w')
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 'r', nil then ::XZ::StreamReader.open(filename)
79
- when 'w' then ::XZ::StreamWriter.open(filename)
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 'r', nil then IO.popen("xz -d -c '#{filename}'", 'r')
85
- when 'w' then IO.popen("xz -c - > '#{filename}'", 'w')
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.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: 2014-03-15 00:00:00.000000000 Z
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.2.2
59
+ rubygems_version: 2.4.3
60
60
  signing_key:
61
61
  specification_version: 4
62
62
  summary: Automatically open compressed files