neo4j-asciidoctor-extensions 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: caa3438245e79418824486f4b9eafe839bc450db9f5982dd85d4891d2cf23a97
|
4
|
+
data.tar.gz: 65cb62e0c737990e153621812c282e114d18520b94745349f5b7e31625445bc7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4aa57024bb9de75ae6d5b8a4ddffe4eab1b127479555d5da916625a6bc240739bfe126faf3c273beb6ab815669b8a5a6bd0530be2da4a7ca272492360e45345c
|
7
|
+
data.tar.gz: ce4dd22de8ba94d0d2cf5297ef02b7402d1e0efcd1f64b24e077153989968eb5eedc51610fb5b646fe20a50305141c18de4fc858c3456925045b8fe354eaa32c
|
data/Gemfile.lock
CHANGED
@@ -118,7 +118,7 @@ module Neo4j
|
|
118
118
|
split_values(attr_name, document)
|
119
119
|
.map do |tuple|
|
120
120
|
key, value = tuple.split('=')
|
121
|
-
{ 'key' => key.strip, 'values' => value.strip.split(';').map(&:strip).reject(&:empty?) }
|
121
|
+
{ 'key' => key.strip, 'values' => (value && value.strip.split(';').map(&:strip).reject(&:empty?)) || [] }
|
122
122
|
end
|
123
123
|
else
|
124
124
|
document.attr attr_name
|
@@ -131,5 +131,23 @@ describe Neo4j::AsciidoctorExtensions::DocumentMetadataGeneratorPostProcessor do
|
|
131
131
|
expect(metadata['slug']).to eql('introduction-neo4j-4-0')
|
132
132
|
expect(metadata['parent_path']).to eql('/labs')
|
133
133
|
end
|
134
|
+
it 'should ignore empty value in taxonomies' do
|
135
|
+
input = <<~'ADOC'
|
136
|
+
= Introduction to Neo4j 4.0
|
137
|
+
:slug: introduction-neo4j-4-0
|
138
|
+
:taxonomies: neo4j_versions= , tags= intro ; neo4j;;
|
139
|
+
|
140
|
+
This is a paragraph.
|
141
|
+
ADOC
|
142
|
+
Asciidoctor.convert(input, safe: 'safe', to_file: 'spec/output/test.html', attributes: {
|
143
|
+
'document-metadata-attrs-include' => 'slug,taxonomies*<>'
|
144
|
+
})
|
145
|
+
metadata = YAML.load_file('spec/output/test.yml')
|
146
|
+
expect(metadata['title']).to eql('Introduction to Neo4j 4.0')
|
147
|
+
expect(metadata['slug']).to eql('introduction-neo4j-4-0')
|
148
|
+
taxonomies = metadata['taxonomies']
|
149
|
+
expect(taxonomies.detect { |taxonomy| taxonomy['key'] == 'neo4j_versions' }['values']).to eql([])
|
150
|
+
expect(taxonomies.detect { |taxonomy| taxonomy['key'] == 'tags' }['values']).to eql(%w[intro neo4j])
|
151
|
+
end
|
134
152
|
end
|
135
153
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: neo4j-asciidoctor-extensions
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Guillaume Grossetie
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-06-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: asciidoctor
|