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: b42a3be5a38b009c3e709bac862ecd1823a858f3070c1cbbe74f56b2024ebb5f
4
- data.tar.gz: 12bf0d58e1bcc0431c1ad80c6171be11ae50f092659cb4ba0d4bfc28763b37b2
3
+ metadata.gz: caa3438245e79418824486f4b9eafe839bc450db9f5982dd85d4891d2cf23a97
4
+ data.tar.gz: 65cb62e0c737990e153621812c282e114d18520b94745349f5b7e31625445bc7
5
5
  SHA512:
6
- metadata.gz: 1cb5a08954c0e42523f0bbe47d69e9071e480b54513b5de2e9c9903532f2c09642875f85a8199723027f31f260bcd53d6b236edc4c70e13339a667296c62ee41
7
- data.tar.gz: 8fe53eefe0a3ad9cb16e6b9acfb363c3131e445cdeb0ae32ca00efb360246d91d6350f159c7123d6e485fe68f570f23912253d847eba1467b83c3733733bd7b3
6
+ metadata.gz: 4aa57024bb9de75ae6d5b8a4ddffe4eab1b127479555d5da916625a6bc240739bfe126faf3c273beb6ab815669b8a5a6bd0530be2da4a7ca272492360e45345c
7
+ data.tar.gz: ce4dd22de8ba94d0d2cf5297ef02b7402d1e0efcd1f64b24e077153989968eb5eedc51610fb5b646fe20a50305141c18de4fc858c3456925045b8fe354eaa32c
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- neo4j-asciidoctor-extensions (0.1.1)
4
+ neo4j-asciidoctor-extensions (0.1.2)
5
5
  asciidoctor (~> 2.0.0)
6
6
  asciidoctor-pdf (= 1.5.3)
7
7
  rouge (~> 3.18.0)
@@ -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
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = 'neo4j-asciidoctor-extensions'
5
- s.version = '0.1.1'
5
+ s.version = '0.1.2'
6
6
  s.summary = 'Asciidoctor extensions by Neo4j.'
7
7
  s.description = 'Asciidoctor extensions by Neo4j.'
8
8
 
@@ -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.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-05-22 00:00:00.000000000 Z
11
+ date: 2020-06-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: asciidoctor