epitools 0.5.55 → 0.5.56
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/.gemspec +1 -1
- data/VERSION +1 -1
- data/lib/epitools/path.rb +32 -6
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e99c4c632bed20d594d0be23de1a3e4acc1614b9
|
4
|
+
data.tar.gz: 5b57af34cea2a3525ca2e517b5a5713599a56439
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2c7774db6661a079c9b1b8fff5c15359f824547c1f1c0700c202dc33a95e15b590ec64f5c62e4cde257254e7cedf6b51299f1446cb157bd423f35a05012890a6
|
7
|
+
data.tar.gz: 0173053ec0038c3066fe04cc5c5bc0ce9120172269c5559fc084c7b7ee7263f43dad514aee643bc8e28db8e2f9d5bac75a119684ee87f76853b0d9975a13c4a2
|
data/.gemspec
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.5.
|
1
|
+
0.5.56
|
data/lib/epitools/path.rb
CHANGED
@@ -366,9 +366,10 @@ class Path
|
|
366
366
|
end
|
367
367
|
|
368
368
|
def symlink_target
|
369
|
-
Path
|
369
|
+
Path[dir] / File.readlink(path.gsub(/\/$/, ''))
|
370
370
|
end
|
371
371
|
alias_method :readlink, :symlink_target
|
372
|
+
alias_method :target, :symlink_target
|
372
373
|
|
373
374
|
def uri?
|
374
375
|
false
|
@@ -920,36 +921,61 @@ class Path
|
|
920
921
|
alias_method :md5sum, :md5
|
921
922
|
|
922
923
|
|
923
|
-
|
924
|
+
## http://ruby-doc.org/stdlib/libdoc/zlib/rdoc/index.html
|
924
925
|
|
926
|
+
#
|
927
|
+
# gzip the file, returning the result as a string
|
928
|
+
#
|
929
|
+
def gzip(level=nil)
|
930
|
+
Zlib.deflate(read, level)
|
931
|
+
end
|
932
|
+
|
933
|
+
#
|
934
|
+
# gunzip the file, returning the result as a string
|
935
|
+
#
|
936
|
+
def gunzip(level=nil)
|
937
|
+
Zlib.inflate(read, level)
|
938
|
+
end
|
939
|
+
|
940
|
+
#
|
941
|
+
# Quickly gzip a file, creating a new .gz file, without removing the original,
|
942
|
+
# and returning a Path to that new file.
|
943
|
+
#
|
925
944
|
def gzip!(level=nil)
|
926
945
|
gz_file = self.with(:filename=>filename+".gz")
|
927
946
|
|
928
947
|
raise "#{gz_file} already exists" if gz_file.exists?
|
929
948
|
|
930
949
|
open("rb") do |input|
|
931
|
-
Zlib::GzipWriter.open(gz_file) do |
|
932
|
-
IO.copy_stream(input,
|
950
|
+
Zlib::GzipWriter.open(gz_file) do |gzwriter|
|
951
|
+
IO.copy_stream(input, gzwriter)
|
933
952
|
end
|
934
953
|
end
|
935
954
|
|
936
955
|
update(gz_file)
|
937
956
|
end
|
938
957
|
|
958
|
+
#
|
959
|
+
# Quickly gunzip a file, creating a new file, without removing the original,
|
960
|
+
# and returning a Path to that new file.
|
961
|
+
#
|
939
962
|
def gunzip!
|
940
963
|
raise "Not a .gz file" unless ext == "gz"
|
941
964
|
|
942
965
|
regular_file = self.with(:ext=>nil)
|
943
966
|
|
944
967
|
regular_file.open("wb") do |output|
|
945
|
-
Zlib::GzipReader.open(self) do |
|
946
|
-
IO.copy_stream(
|
968
|
+
Zlib::GzipReader.open(self) do |gzreader|
|
969
|
+
IO.copy_stream(gzreader, output)
|
947
970
|
end
|
948
971
|
end
|
949
972
|
|
950
973
|
update(regular_file)
|
951
974
|
end
|
952
975
|
|
976
|
+
#
|
977
|
+
# Match the full path against a regular expression
|
978
|
+
#
|
953
979
|
def =~(pattern)
|
954
980
|
to_s =~ pattern
|
955
981
|
end
|
metadata
CHANGED
@@ -1,29 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: epitools
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.56
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- epitron
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-09-
|
11
|
+
date: 2014-09-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '2'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '2'
|
27
27
|
description: Miscellaneous utility libraries to make my life easier.
|
28
28
|
email: chris@ill-logic.com
|
29
29
|
executables: []
|