nanoc-core 4.11.20 → 4.11.21

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: ac94fc2464196846d4d6b38fb9a3ee02d0566aaa16f4f192e63f7989af937dc0
4
- data.tar.gz: 0ba05d8ccb6d2cb10a8ec2909bb9bd99dee5203272c24cd02fdc6c6d4041dd17
3
+ metadata.gz: a9f63cf9ed0953520b811eb964d1b71cad082bc07f945c5b9c838a3730dc9cc2
4
+ data.tar.gz: 58e44db73eb2a9fdd8959964802b78570e15ddc2e4ae8afd2a5da9161da06c61
5
5
  SHA512:
6
- metadata.gz: b76254a60ba5cc2d94f0dc6a01498b51fa22c068ba6ee93c6434cee1105a29922f664c08090b155b18a9016b065fb854f60dc38a57f2effa6b1a6a1c1d94aeee
7
- data.tar.gz: 314da571f7e0b49544152e66dc1bc9b30ae49911b0f8aeaf863d23731294ffe33e7b21977a2238f619396119ab6b7a635453e80544ccaf0193e7a94495d34313
6
+ metadata.gz: b4d4b9458fc23a57bb961c0ed9ff31dd82b43f243cf92d2c45424efda54d3ccacab16be0fd36805f606958eb9167b6537c178ff23c15947f2a2f667bd9901f40
7
+ data.tar.gz: 4668c6c8188d5c885829421d4d4e3564146f9f935576be13daed38410ca7537781545d2f44f4c3a44fdb1c145d1331baf84526b37732f85cdfb9e1e77ce3ccdd
@@ -9,7 +9,6 @@ require 'tmpdir'
9
9
  require 'yaml'
10
10
 
11
11
  # External gems
12
- require 'clonefile'
13
12
  require 'concurrent-ruby'
14
13
  require 'json_schema'
15
14
  require 'ddmemoize'
@@ -21,6 +20,13 @@ require 'tomlrb'
21
20
  require 'tty-platform'
22
21
  require 'zeitwerk'
23
22
 
23
+ # External gems (optional)
24
+ begin
25
+ require 'clonefile'
26
+ rescue LoadError
27
+ # ignore
28
+ end
29
+
24
30
  module Nanoc
25
31
  module Core
26
32
  # Similar to `nil` except that it can only be compared against using
@@ -79,11 +79,13 @@ module Nanoc
79
79
 
80
80
  def smart_cp(from, to)
81
81
  # Try clonefile
82
- FileUtils.rm_f(to)
83
- begin
84
- res = Clonefile.always(from, to)
85
- return if res
86
- rescue Clonefile::UnsupportedPlatform, Errno::ENOTSUP, Errno::EXDEV, Errno::EINVAL
82
+ if defined?(Clonefile)
83
+ FileUtils.rm_f(to)
84
+ begin
85
+ res = Clonefile.always(from, to)
86
+ return if res
87
+ rescue Clonefile::UnsupportedPlatform, Errno::ENOTSUP, Errno::EXDEV, Errno::EINVAL
88
+ end
87
89
  end
88
90
 
89
91
  # Try with hardlink
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Nanoc
4
4
  module Core
5
- VERSION = '4.11.20'
5
+ VERSION = '4.11.21'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nanoc-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.11.20
4
+ version: 4.11.21
5
5
  platform: ruby
6
6
  authors:
7
7
  - Denis Defreyne
@@ -10,20 +10,6 @@ bindir: bin
10
10
  cert_chain: []
11
11
  date: 2020-12-18 00:00:00.000000000 Z
12
12
  dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: clonefile
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - "~>"
18
- - !ruby/object:Gem::Version
19
- version: 0.5.2
20
- type: :runtime
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - "~>"
25
- - !ruby/object:Gem::Version
26
- version: 0.5.2
27
13
  - !ruby/object:Gem::Dependency
28
14
  name: concurrent-ruby
29
15
  requirement: !ruby/object:Gem::Requirement