asciidoctor-reducer 1.1.1 → 1.1.2
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/CHANGELOG.adoc +11 -0
- data/README.adoc +1 -1
- data/lib/asciidoctor/reducer/api.rb +1 -1
- data/lib/asciidoctor/reducer/header_attribute_tracker.rb +2 -1
- data/lib/asciidoctor/reducer/include_mapper/extension.rb +1 -1
- data/lib/asciidoctor/reducer/tree_processor.rb +24 -18
- data/lib/asciidoctor/reducer/version.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: d79dee7d3fe04a10fac4e4ea7ff50a564bc915cd20be9ccc9bfa21b41e2ab836
|
4
|
+
data.tar.gz: a830fd2dd521f0e2154a8d46917278254eec564d6ede76ba07d147581a2a7414
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 77dbc3cd2f39503f85093edce50bb32d9da44c700de3c61558ddfbd9c2d3b7bfc5e0cb4e05d9705e460d92d4da30555c1bbf9d90a54cb19176ffdceb2711cf8c
|
7
|
+
data.tar.gz: 3228ea887ee92bf585258dae1ec3dc120309f3d1274c8ddc90558a25473a72e1bfa2c20074fdb8b1033db90730f558c45967457279660d6782b6fa4567d7e1ee
|
data/CHANGELOG.adoc
CHANGED
@@ -4,6 +4,17 @@
|
|
4
4
|
This document provides a curated view of the changes to Asciidoctor Reducer in each release.
|
5
5
|
For a detailed view of what has changed, refer to the {url-repo}/commits/main[commit history] on GitHub.
|
6
6
|
|
7
|
+
== 1.1.2 (2025-05-09) - @mojavelinux
|
8
|
+
|
9
|
+
=== Fixed
|
10
|
+
|
11
|
+
* Don't define reader for source_header_attributes instance variable if already defined
|
12
|
+
* Only catch RangeError when flattening list when using Opal runtime
|
13
|
+
|
14
|
+
=== Details
|
15
|
+
|
16
|
+
{url-repo}/releases/tag/v1.1.2[git tag] | {url-repo}/compare/v1.1.1\...v1.1.2[full diff]
|
17
|
+
|
7
18
|
== 1.1.1 (2025-03-27) - @mojavelinux
|
8
19
|
|
9
20
|
=== Fixed
|
data/README.adoc
CHANGED
@@ -3,10 +3,11 @@
|
|
3
3
|
module Asciidoctor::Reducer
|
4
4
|
module HeaderAttributeTracker
|
5
5
|
def self.extended instance
|
6
|
+
return if instance.singleton_class.method_defined? :source_header_attributes
|
6
7
|
instance.singleton_class.send :attr_reader, :source_header_attributes
|
7
8
|
end
|
8
9
|
|
9
|
-
def finalize_header(*)
|
10
|
+
def finalize_header(*)
|
10
11
|
@source_header_attributes = @attributes_modified.each_with_object({}) do |name, accum|
|
11
12
|
accum[name] = @attributes[name]
|
12
13
|
end
|
@@ -5,7 +5,7 @@ module Asciidoctor::Reducer
|
|
5
5
|
def process doc
|
6
6
|
if doc.extensions.groups[:reducer]
|
7
7
|
unless (includes = doc.catalog[:includes].map {|name, val| val ? name : %(~#{name}) }).empty?
|
8
|
-
doc.source_lines.
|
8
|
+
doc.source_lines.push '', %(//# includes=#{includes.join ','})
|
9
9
|
end
|
10
10
|
elsif (last_line = doc.source_lines[-1])&.start_with? '//# includes='
|
11
11
|
doc.catalog[:includes].update ((last_line.slice 13, last_line.length).split ',')
|
@@ -49,28 +49,34 @@ module Asciidoctor::Reducer
|
|
49
49
|
|
50
50
|
private
|
51
51
|
|
52
|
-
|
53
|
-
input_list
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
if (
|
63
|
-
|
52
|
+
if RUBY_ENGINE == 'opal'
|
53
|
+
def flatten input_list
|
54
|
+
input_list.flatten
|
55
|
+
rescue ::Exception => e # rubocop:disable Lint/RescueException
|
56
|
+
raise unless e && %x(e.name) == 'RangeError'
|
57
|
+
result = []
|
58
|
+
stack = [[0, input_list, input_list.length]]
|
59
|
+
until stack.empty?
|
60
|
+
idx, list, len = stack.pop
|
61
|
+
while idx < len
|
62
|
+
if Array === (item = list[idx])
|
63
|
+
if (next_idx = idx + 1) < len
|
64
|
+
stack << [next_idx, list, len]
|
65
|
+
end
|
66
|
+
idx = 0
|
67
|
+
len = (list = item).length
|
68
|
+
else
|
69
|
+
result << item
|
70
|
+
idx += 1
|
64
71
|
end
|
65
|
-
idx = 0
|
66
|
-
len = (list = item).length
|
67
|
-
else
|
68
|
-
result << item
|
69
|
-
idx += 1
|
70
72
|
end
|
71
73
|
end
|
74
|
+
result
|
75
|
+
end
|
76
|
+
else
|
77
|
+
def flatten input_list
|
78
|
+
input_list.flatten
|
72
79
|
end
|
73
|
-
result
|
74
80
|
end
|
75
81
|
end
|
76
82
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: asciidoctor-reducer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dan Allen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-
|
11
|
+
date: 2025-05-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: asciidoctor
|