muflax 0.5.2 → 0.5.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/muflax/file.rb +8 -14
- data/muflax.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 801fc14409aeca41dc587db33c5365aee5becef29a674878781863774662b9ee
|
4
|
+
data.tar.gz: 19e038bfdcf0566fb1340cbbec469d072ca9924ed59390aa234f95ceae784fe8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1a932b1ac53e8c255537c311417afa01d25f9acab66803c1f54cb771bb0b285da5064ce5cfd7df65c53d459f8042fd0e37b34201e63eea54605f0f818cb1cd27
|
7
|
+
data.tar.gz: ff813f373d979bb7782af9782f875dde8bfb22436bb9b5ba697baf2b3ad2364f61285e67f4398829f62dc897ab6251be51c32a53d93a2f13707bacc37b76f0ca
|
data/Gemfile.lock
CHANGED
data/lib/muflax/file.rb
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
# License: GNU GPL 3 <http://www.gnu.org/copyleft/gpl.html>
|
5
5
|
|
6
6
|
class File
|
7
|
-
def self.save name,
|
7
|
+
def self.save name, &blk
|
8
8
|
name = File.expand_path(name)
|
9
9
|
|
10
10
|
# make sure directory exists
|
@@ -12,26 +12,20 @@ class File
|
|
12
12
|
FileUtils.mkdir_p dir if not Dir.exists? dir
|
13
13
|
|
14
14
|
# now open it
|
15
|
-
case
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
f = File.open(name, "w", &blk)
|
20
|
-
else
|
21
|
-
raise "unsupported file format: #{as}"
|
22
|
-
end
|
15
|
+
file = case name
|
16
|
+
when /\.gz$/ ; Zlib::GzipWriter.open(name, &blk)
|
17
|
+
else ; File.open(name, "w", &blk)
|
18
|
+
end
|
23
19
|
|
24
|
-
|
20
|
+
file
|
25
21
|
end
|
26
22
|
|
27
23
|
def self.load name
|
28
24
|
name = File.expand_path(name)
|
29
25
|
|
30
26
|
file = case name
|
31
|
-
when /\.gz$/
|
32
|
-
|
33
|
-
else
|
34
|
-
File.open(name)
|
27
|
+
when /\.gz$/ ; Zlib::GzipReader.open(name)
|
28
|
+
else ; File.open(name)
|
35
29
|
end
|
36
30
|
|
37
31
|
file
|
data/muflax.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: muflax
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- muflax
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-09
|
11
|
+
date: 2019-11-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: awesome_print
|