jekyll-write-and-commit-changes 0.1.2 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -0
- data/lib/jekyll/document_writer.rb +18 -4
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9584f3c27924752c92b9fa988e06b107050b4cf23db2a518c619e414c1801d92
|
4
|
+
data.tar.gz: 324e71a46203e346d4c15470b09a6a13f9b5202dbcc0790111cbd683dc500634
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f91a9807a710ad4f2c1db811c880c55a6c60b95c18b67d557b57302a2954de63efdae2f38caaf13d0f5ba6977a23d5e821c1eb778efd37ebd7016342f0f1cca9
|
7
|
+
data.tar.gz: d5e0f93391e23cc5e4e437484e8b41a133c2ae9856c99e06f34a8fc5dba639ae217718eda486851a684807639e4955803b58752d152afb30441819abf03c381d
|
data/README.md
CHANGED
@@ -8,7 +8,9 @@ module Jekyll
|
|
8
8
|
base.class_eval do
|
9
9
|
# Writes changes to the file and adds it to git staged changes
|
10
10
|
def save
|
11
|
-
|
11
|
+
return unless data.fetch('save', true)
|
12
|
+
|
13
|
+
Jekyll.logger.debug "Writing #{real_path}"
|
12
14
|
|
13
15
|
file = File.open(path, File::RDWR | File::CREAT, 0o640) do |f|
|
14
16
|
f.flock(File::LOCK_EX)
|
@@ -22,11 +24,17 @@ module Jekyll
|
|
22
24
|
f.truncate(f.pos)
|
23
25
|
end
|
24
26
|
|
25
|
-
site.staged_files <<
|
27
|
+
site.staged_files << real_path if file.zero?
|
26
28
|
|
27
29
|
file.zero?
|
28
30
|
end
|
29
31
|
|
32
|
+
# Resolves the real path for the document
|
33
|
+
# @return [String]
|
34
|
+
def real_path
|
35
|
+
@real_path ||= Pathname.new(relative_path).realpath.relative_path_from(site.source).to_s
|
36
|
+
end
|
37
|
+
|
30
38
|
# Prepares the data for dumping, by excluding some keys and
|
31
39
|
# transforming other Documents replaced by jekyll-linked-posts.
|
32
40
|
#
|
@@ -38,13 +46,19 @@ module Jekyll
|
|
38
46
|
case value
|
39
47
|
when Jekyll::Document
|
40
48
|
value.data['uuid']
|
49
|
+
when Jekyll::Convertible
|
50
|
+
value.data['uuid']
|
51
|
+
when Set
|
52
|
+
value.map do |v|
|
53
|
+
v.respond_to?(:data) ? v.data['uuid'] : v
|
54
|
+
end
|
41
55
|
when Array
|
42
56
|
value.map do |v|
|
43
|
-
v.
|
57
|
+
v.respond_to?(:data) ? v.data['uuid'] : v
|
44
58
|
end
|
45
59
|
when Hash
|
46
60
|
value.transform_values do |v|
|
47
|
-
v.
|
61
|
+
v.respond_to?(:data) ? v.data['uuid'] : v
|
48
62
|
end
|
49
63
|
else
|
50
64
|
value
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-write-and-commit-changes
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- f
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-03-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|
@@ -84,7 +84,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
84
84
|
- !ruby/object:Gem::Version
|
85
85
|
version: '0'
|
86
86
|
requirements: []
|
87
|
-
rubygems_version: 3.
|
87
|
+
rubygems_version: 3.3.8
|
88
88
|
signing_key:
|
89
89
|
specification_version: 4
|
90
90
|
summary: Write changes to the repository
|