clonefile 0.5.1 → 0.5.2

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/clonefile.rb +6 -1
  3. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 701af6bc1b8fa5263ae5080c8663cbdc58958b657da304ef97d08adfc212d2c7
4
- data.tar.gz: 2a75a943a4fb26fd8b825dbac4a47869735d45de439f491ffdffc5d04b3a9701
3
+ metadata.gz: 74154844480c4ed6edd03c45edaeb62ce07f02b91d2c71f3b6b9c0decf40f5b7
4
+ data.tar.gz: b819240d3729bcf476e1e6edb8f631ec5ee64bf497979d251a717a5ac9a28d86
5
5
  SHA512:
6
- metadata.gz: 13bac251475f1f4f99fa51249c4e434b860ab75c9e5bde02be404cadfd45fa4b5217013336df45eec5246a1470c92ad132898da5565511a43bb7d5c1025646d0
7
- data.tar.gz: f67ea20ad3a7548faae3db15a8a15d5eff770974aa6a45592369823ce83b9536a855b97f432d11461e26e40939581b5e852fc5c96ae353bd6a8f869eaf6792c8
6
+ metadata.gz: 27f37f98b4f068aeda64fa65f4a6a7404fb283f515f4938e06992a1137926ce1e05a4b88b61a0147a5e090948d33c7c935143068ceb93c209c94be8d43f518d5
7
+ data.tar.gz: f37e5a127e00366b9f38d3ee0aeb2d0c7fe29d8ca99b53a835fb4c8304597e9fa17d7d5f3bb0bd20cf4f5572b275258c32a1a29332fbb780e93ba3c51cd594b2
@@ -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.1
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-09-26 00:00:00.000000000 Z
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.2
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.