nanoc-core 4.11.19 → 4.11.20
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/nanoc/core.rb +1 -0
- data/lib/nanoc/core/item_rep_writer.rb +21 -5
- data/lib/nanoc/core/version.rb +1 -1
- metadata +17 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ac94fc2464196846d4d6b38fb9a3ee02d0566aaa16f4f192e63f7989af937dc0
|
4
|
+
data.tar.gz: 0ba05d8ccb6d2cb10a8ec2909bb9bd99dee5203272c24cd02fdc6c6d4041dd17
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b76254a60ba5cc2d94f0dc6a01498b51fa22c068ba6ee93c6434cee1105a29922f664c08090b155b18a9016b065fb854f60dc38a57f2effa6b1a6a1c1d94aeee
|
7
|
+
data.tar.gz: 314da571f7e0b49544152e66dc1bc9b30ae49911b0f8aeaf863d23731294ffe33e7b21977a2238f619396119ab6b7a635453e80544ccaf0193e7a94495d34313
|
data/lib/nanoc/core.rb
CHANGED
@@ -62,11 +62,7 @@ module Nanoc
|
|
62
62
|
|
63
63
|
# Write
|
64
64
|
if is_modified
|
65
|
-
|
66
|
-
FileUtils.ln(temp_path, raw_path, force: true)
|
67
|
-
rescue Errno::EXDEV, Errno::EACCES
|
68
|
-
FileUtils.cp(temp_path, raw_path)
|
69
|
-
end
|
65
|
+
smart_cp(temp_path, raw_path)
|
70
66
|
end
|
71
67
|
|
72
68
|
item_rep.modified = is_modified
|
@@ -80,6 +76,26 @@ module Nanoc
|
|
80
76
|
def temp_filename
|
81
77
|
Nanoc::Core::TempFilenameFactory.instance.create(TMP_TEXT_ITEMS_DIR)
|
82
78
|
end
|
79
|
+
|
80
|
+
def smart_cp(from, to)
|
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
|
87
|
+
end
|
88
|
+
|
89
|
+
# Try with hardlink
|
90
|
+
begin
|
91
|
+
FileUtils.ln(from, to, force: true)
|
92
|
+
return
|
93
|
+
rescue Errno::EXDEV, Errno::EACCES
|
94
|
+
end
|
95
|
+
|
96
|
+
# Fall back to old-school copy
|
97
|
+
FileUtils.cp(from, to)
|
98
|
+
end
|
83
99
|
end
|
84
100
|
end
|
85
101
|
end
|
data/lib/nanoc/core/version.rb
CHANGED
metadata
CHANGED
@@ -1,15 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nanoc-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.11.
|
4
|
+
version: 4.11.20
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Denis Defreyne
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
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
|
13
27
|
- !ruby/object:Gem::Dependency
|
14
28
|
name: concurrent-ruby
|
15
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -314,7 +328,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
314
328
|
- !ruby/object:Gem::Version
|
315
329
|
version: '0'
|
316
330
|
requirements: []
|
317
|
-
rubygems_version: 3.
|
331
|
+
rubygems_version: 3.2.2
|
318
332
|
signing_key:
|
319
333
|
specification_version: 4
|
320
334
|
summary: Core of Nanoc
|