asciidoctor-git-include 1.1.1 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/asciidoctor-git-include.rb +5 -0
- 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: 33432a5c915af840e5c057ad582d1f54b3d726f1af3578166beb1f7302ae109b
|
4
|
+
data.tar.gz: 505f52a6111ab421f165eb62d1c62578b17e9ef6f56e2ba7aaa20cc1ef81c431
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 07eb32eb3c68749eb8ff1665ff613ca3b37d0d0df3d7c279087e1770d3089d87143af739ec59e25bf46704977285b1505aedcd22b9ce19889d6b7ed353c699ac
|
7
|
+
data.tar.gz: 2c78469dda664ed8d3a27fcbfe55dae1e99360f183c140f4a284fe54e6ef335e3fc5da29ea0b17fc666134985f985513d6055974d065521385a17cf46c8becc6
|
@@ -14,8 +14,13 @@ class GitIncludeMacro < Asciidoctor::Extensions::IncludeProcessor
|
|
14
14
|
repository = attributes.fetch('repository', '.')
|
15
15
|
revision = attributes.fetch('revision', 'HEAD')
|
16
16
|
lines = attributes.fetch('lines', '')
|
17
|
+
as_diff = attributes.value?('diff') || attributes.key?('diff')
|
18
|
+
diff_revision = attributes.fetch('diff', "#{revision}~1")
|
17
19
|
|
18
20
|
cmd = %(git -C #{repository} show #{revision}:#{target})
|
21
|
+
if (as_diff)
|
22
|
+
cmd = %(git -C #{repository} diff #{diff_revision}:#{target} #{revision}:#{target})
|
23
|
+
end
|
19
24
|
content = %x(#{cmd})
|
20
25
|
|
21
26
|
content = process_line_selection(content, lines) unless lines == ""
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: asciidoctor-git-include
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jakub Zalas
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-06-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: asciidoctor
|