zarchitect 1.6.0 → 1.7.0
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/zarchitect/config.rb +3 -0
- data/lib/zarchitect/file_manager.rb +24 -3
- data/lib/zarchitect.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 872696fbcc1fdcac5bbe6f4e797c66f1a11a40ef3a09156f2f95841224c11fc4
|
|
4
|
+
data.tar.gz: 556377e367f457acc7e9a6381e141a17f5bebf028c2f6bd9efafba149cef3e93
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 635a6add041ba9cf2e9ed5c862796e80eb107c66526f12aeeb75d026513f6b301b6c22716d7724703d2f36fb947a05cf565b7d1c12e4075619ed733b92a2b2e1
|
|
7
|
+
data.tar.gz: 55197b4d53a57c1003e177a5d33d0504f282d3fdd7adeaa2c1635caa3a898f65e59c2e6271bbc76457a9c7f28cc1b63592f9bc0375f416b0f87741349f33c6c4
|
data/lib/zarchitect/config.rb
CHANGED
|
@@ -205,6 +205,9 @@ class Config
|
|
|
205
205
|
|
|
206
206
|
def validate_zrconf
|
|
207
207
|
GPI.print "Validating #{@file}."
|
|
208
|
+
unless @hash.has_key?("symlink_assets")
|
|
209
|
+
@hash["symlink_assets"] = false
|
|
210
|
+
end
|
|
208
211
|
unless @hash.has_key?("url")
|
|
209
212
|
GPI.print "config key [url] missing in _config/_zarchitect.yaml."
|
|
210
213
|
GPI.quit
|
|
@@ -20,6 +20,7 @@ class FileManager < Zarchitect
|
|
|
20
20
|
Util.mkdir(realpath) if File.directory?(fullpath)
|
|
21
21
|
next if File.directory?(fullpath)
|
|
22
22
|
# file handling
|
|
23
|
+
rrealpath = File.join(Dir.getwd, fullpath)
|
|
23
24
|
# handle file types embedded in posts
|
|
24
25
|
if Image.is_valid?(fullpath)
|
|
25
26
|
GPI.print "processing #{fullpath} as image file",
|
|
@@ -40,9 +41,20 @@ class FileManager < Zarchitect
|
|
|
40
41
|
end
|
|
41
42
|
# create symlink in _html/files to physical files _files (if process did
|
|
42
43
|
# not abort)
|
|
43
|
-
unless File.
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
unless File.exist?(realpath)
|
|
45
|
+
if Zarchitect.conf.symlink_assets
|
|
46
|
+
symlink(rrealpath, realpath)
|
|
47
|
+
else
|
|
48
|
+
copy(rrealpath, realpath)
|
|
49
|
+
end
|
|
50
|
+
else
|
|
51
|
+
if File.stat(rrealpath).mtime > File.stat(realpath).mtime
|
|
52
|
+
if Zarchitect.conf.symlink_assets
|
|
53
|
+
symlink(rrealpath, realpath)
|
|
54
|
+
else
|
|
55
|
+
copy(rrealpath, realpath)
|
|
56
|
+
end
|
|
57
|
+
end
|
|
46
58
|
end
|
|
47
59
|
|
|
48
60
|
end
|
|
@@ -56,6 +68,15 @@ class FileManager < Zarchitect
|
|
|
56
68
|
GPI::CLU.check_option('v')
|
|
57
69
|
end
|
|
58
70
|
|
|
71
|
+
def copy(from, to)
|
|
72
|
+
cmd = "cp #{from} #{to}"
|
|
73
|
+
GPI.print cmd, GPI::CLU.check_option('v')
|
|
74
|
+
unless system(cmd)
|
|
75
|
+
GPI.print "failed to copy '#{from}' to '#{to}'"
|
|
76
|
+
GPI.quit
|
|
77
|
+
end
|
|
78
|
+
end
|
|
79
|
+
|
|
59
80
|
def clean
|
|
60
81
|
# remove all files in _html/files
|
|
61
82
|
%x{rm -r _html/files/*}
|
data/lib/zarchitect.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: zarchitect
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.7.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- ryu
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2023-
|
|
11
|
+
date: 2023-06-01 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description: Yet another static website generator
|
|
14
14
|
email: ryu@tohya.net
|