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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2b4db210e85b86a1cc9f78d42abc77fca5a34be25487ec5c2cee020fce7d7c6c
4
- data.tar.gz: 76cee357b557092ee070207346b7ef60c6450ab46e090635672080fab9f63a0c
3
+ metadata.gz: 801fc14409aeca41dc587db33c5365aee5becef29a674878781863774662b9ee
4
+ data.tar.gz: 19e038bfdcf0566fb1340cbbec469d072ca9924ed59390aa234f95ceae784fe8
5
5
  SHA512:
6
- metadata.gz: 66c636e241ac329d61d22a45e3ccd035d5d5f966772816cbadf115219d5c8ebf94585f8ff1bbf051a58c9f43885025e6ef74e6ef57f681bf7bb5129fb2a7944d
7
- data.tar.gz: f107567d3b6af5a79603b4360e6e43528cf0a6a38b4c979e054b059a173907b466f0d6aae2be0fc6a1e618a0f9ee09482f5961a96202e83c044da5747ad42c88
6
+ metadata.gz: 1a932b1ac53e8c255537c311417afa01d25f9acab66803c1f54cb771bb0b285da5064ce5cfd7df65c53d459f8042fd0e37b34201e63eea54605f0f818cb1cd27
7
+ data.tar.gz: ff813f373d979bb7782af9782f875dde8bfb22436bb9b5ba697baf2b3ad2364f61285e67f4398829f62dc897ab6251be51c32a53d93a2f13707bacc37b76f0ca
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- muflax (0.5.2)
4
+ muflax (0.5.3)
5
5
  awesome_print (~> 1)
6
6
  debug_inspector (~> 0.0)
7
7
  fast_blank (~> 1)
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, as: :text, &blk
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 as
16
- when :anki
17
- f = CSV.open(name, "w", :col_sep => "\t", &blk)
18
- when :text
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
- f
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
- Zlib::GzipReader.open(name)
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
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "muflax"
3
- s.version = "0.5.2"
3
+ s.version = "0.5.3"
4
4
 
5
5
  s.authors = ["muflax"]
6
6
  s.summary = "muflax standard library"
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.2
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 00:00:00.000000000 Z
11
+ date: 2019-11-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: awesome_print