nanoc-core 4.13.4 → 4.13.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0d269d49a75092d2131bb9862da8891db100ba3706aae5a6e7cb1948e4b6ff08
4
- data.tar.gz: 9834b81f364302d18b02d541f600a61b14e6cb54cf3e6ae04b083d0301446fcb
3
+ metadata.gz: 9a6e74deb4968f4bad8e83ccbd91797be60fac35b5ad4b08687b24751bd880fb
4
+ data.tar.gz: fd3feca15b92a45617b0dc989f56965822081d83af94cb1d168912c29fd84135
5
5
  SHA512:
6
- metadata.gz: 3254f48b180e12a753793abde204b252fdb1166cf654692df6f48ea815d0c0e3fdef07af398b1905236cec9c8872e94f9c49ef49c797693dfcdf131ef12b7702
7
- data.tar.gz: d35cb237c18e1b1349d46623c7790493ec689c1437ddfb86992559b32ff8f5f9ec2a5316acbd46dfc7267bb1d0b6ea4abebef64e9f5fbc73675704fee308640a
6
+ metadata.gz: c97de8904374f0620b01848e71e3de9fd753d507aa1ccf1804e94e9eafdcbe2459f318a6646e41a3b18ca6146c78b84271785de65534ca8e729fead59294afcf
7
+ data.tar.gz: d43e488b4139003a08cfe726e4a8c3ef2a588d63b031be816a924623a68f3b37b083ad5e28f5bffeb2bc23bd713d6f4194fe74d72fd534268ccf57b541dc723e
@@ -92,6 +92,10 @@ module Nanoc
92
92
  end
93
93
  end
94
94
 
95
+ def use_clonefile?
96
+ defined?(Clonefile)
97
+ end
98
+
95
99
  private
96
100
 
97
101
  def dirname
@@ -132,11 +136,13 @@ module Nanoc
132
136
  # changed outside of Nanoc.
133
137
 
134
138
  # Try clonefile
135
- FileUtils.rm_f(to)
136
- begin
137
- res = Clonefile.always(from, to)
138
- return if res
139
- rescue Clonefile::UnsupportedPlatform, Errno::ENOTSUP, Errno::EXDEV, Errno::EINVAL
139
+ if use_clonefile?
140
+ FileUtils.rm_f(to)
141
+ begin
142
+ res = Clonefile.always(from, to)
143
+ return if res
144
+ rescue Clonefile::UnsupportedPlatform, Errno::ENOTSUP, Errno::EXDEV, Errno::EINVAL
145
+ end
140
146
  end
141
147
 
142
148
  # Fall back to old-school copy
@@ -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.13.4'
5
+ VERSION = '4.13.5'
6
6
  end
7
7
  end
data/lib/nanoc/core.rb CHANGED
@@ -10,7 +10,6 @@ require 'yaml'
10
10
  require 'zlib'
11
11
 
12
12
  # External gems
13
- require 'clonefile'
14
13
  require 'concurrent-ruby'
15
14
  require 'json_schema'
16
15
  require 'ddmetrics'
@@ -21,6 +20,13 @@ require 'slow_enumerator_tools'
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
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.13.4
4
+ version: 4.13.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Denis Defreyne
@@ -23,20 +23,6 @@ dependencies:
23
23
  - - "~>"
24
24
  - !ruby/object:Gem::Version
25
25
  version: '0.2'
26
- - !ruby/object:Gem::Dependency
27
- name: clonefile
28
- requirement: !ruby/object:Gem::Requirement
29
- requirements:
30
- - - "~>"
31
- - !ruby/object:Gem::Version
32
- version: 0.5.3
33
- type: :runtime
34
- prerelease: false
35
- version_requirements: !ruby/object:Gem::Requirement
36
- requirements:
37
- - - "~>"
38
- - !ruby/object:Gem::Version
39
- version: 0.5.3
40
26
  - !ruby/object:Gem::Dependency
41
27
  name: concurrent-ruby
42
28
  requirement: !ruby/object:Gem::Requirement
@@ -316,7 +302,7 @@ licenses:
316
302
  - MIT
317
303
  metadata:
318
304
  rubygems_mfa_required: 'true'
319
- source_code_uri: https://github.com/nanoc/nanoc/tree/nanoc-core-v4.13.4/nanoc-core
305
+ source_code_uri: https://github.com/nanoc/nanoc/tree/nanoc-core-v4.13.5/nanoc-core
320
306
  rdoc_options: []
321
307
  require_paths:
322
308
  - lib