clonefile 0.5.1 → 0.5.2
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/lib/clonefile.rb +6 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 74154844480c4ed6edd03c45edaeb62ce07f02b91d2c71f3b6b9c0decf40f5b7
|
4
|
+
data.tar.gz: b819240d3729bcf476e1e6edb8f631ec5ee64bf497979d251a717a5ac9a28d86
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 27f37f98b4f068aeda64fa65f4a6a7404fb283f515f4938e06992a1137926ce1e05a4b88b61a0147a5e090948d33c7c935143068ceb93c209c94be8d43f518d5
|
7
|
+
data.tar.gz: f37e5a127e00366b9f38d3ee0aeb2d0c7fe29d8ca99b53a835fb4c8304597e9fa17d7d5f3bb0bd20cf4f5572b275258c32a1a29332fbb780e93ba3c51cd594b2
|
data/lib/clonefile.rb
CHANGED
@@ -5,6 +5,9 @@
|
|
5
5
|
|
6
6
|
# Clones files on copy-on-write file systems.
|
7
7
|
module Clonefile
|
8
|
+
class UnsupportedPlatform < RuntimeError
|
9
|
+
end
|
10
|
+
|
8
11
|
# Clones src to dest path. Returns boolean. Raises exception if unsupported.
|
9
12
|
def self.always(src, dest)
|
10
13
|
if RUBY_PLATFORM =~ /darwin/
|
@@ -20,13 +23,15 @@ module Clonefile
|
|
20
23
|
end
|
21
24
|
|
22
25
|
res
|
26
|
+
else
|
27
|
+
raise UnsupportedPlatform
|
23
28
|
end
|
24
29
|
end
|
25
30
|
|
26
31
|
# Clones src to dest path. Falls back to a regular copy if unsupported.
|
27
32
|
def self.auto(src, dest)
|
28
33
|
always(src, dest)
|
29
|
-
rescue Errno::ENOTSUP, Errno::EXDEV
|
34
|
+
rescue UnsupportedPlatform, Errno::ENOTSUP, Errno::EXDEV
|
30
35
|
FileUtils.cp(src, dest)
|
31
36
|
end
|
32
37
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: clonefile
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Aleksandersen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-10-25 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Copy files using reflink/cloned extents on supported file systems. Supports
|
14
14
|
Linux and macOS.
|
@@ -46,7 +46,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
46
46
|
requirements:
|
47
47
|
- Linux 4.9.1+ or macOS 10.12.1+.
|
48
48
|
- " A copy-on-write file system."
|
49
|
-
rubygems_version: 3.1.
|
49
|
+
rubygems_version: 3.1.4
|
50
50
|
signing_key:
|
51
51
|
specification_version: 4
|
52
52
|
summary: Clone files on copy-on-write file systems.
|