neo4j-asciidoctor-extensions 0.1.0 → 0.1.1

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: dcbc65f6a14ef93402a8961fb7bac6edfcbf20a62c456bde6bf8bf925afdd7a6
4
- data.tar.gz: 3f3144432df9404adfa853e72fe45f6a333240e270f5d81f6f022776144d95e7
3
+ metadata.gz: b42a3be5a38b009c3e709bac862ecd1823a858f3070c1cbbe74f56b2024ebb5f
4
+ data.tar.gz: 12bf0d58e1bcc0431c1ad80c6171be11ae50f092659cb4ba0d4bfc28763b37b2
5
5
  SHA512:
6
- metadata.gz: 63cf0561afd28054eddca4cf0139d2c75dd26afa056dea387e00237f03e82bfdc2ab99e7c0efe9d5ecf2dabf78c1138a8c5703f6fe82733aca59762df472c29d
7
- data.tar.gz: 995c16ae55d5c2a9636781298bd241f2db04b8040549ee36d83015955b36b6badd21ff59e13da39e2a0af7ada70961538f5f53a780cdd92d3c4238010e4fc698
6
+ metadata.gz: 1cb5a08954c0e42523f0bbe47d69e9071e480b54513b5de2e9c9903532f2c09642875f85a8199723027f31f260bcd53d6b236edc4c70e13339a667296c62ee41
7
+ data.tar.gz: 8fe53eefe0a3ad9cb16e6b9acfb363c3131e445cdeb0ae32ca00efb360246d91d6350f159c7123d6e485fe68f570f23912253d847eba1467b83c3733733bd7b3
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- neo4j-asciidoctor-extensions (0.1.0)
4
+ neo4j-asciidoctor-extensions (0.1.1)
5
5
  asciidoctor (~> 2.0.0)
6
6
  asciidoctor-pdf (= 1.5.3)
7
7
  rouge (~> 3.18.0)
@@ -69,7 +69,7 @@ module Neo4j
69
69
  attr_name = resolve_attr_name(attr_include)
70
70
  if document.attr? attr_name
71
71
  attr_value = resolve_attribute_value(attr_name, document, value_type)
72
- metadata[attr_name] = attr_value
72
+ metadata[attr_name.gsub('-', '_')] = attr_value
73
73
  end
74
74
  end
75
75
  metadata['title'] = document.doctitle
@@ -96,7 +96,6 @@ module Neo4j
96
96
  .gsub(/\*$/, '')
97
97
  .gsub(/\*<>$/, '')
98
98
  .gsub(/\*<>$/, '')
99
- .gsub('-', '_')
100
99
  end
101
100
 
102
101
  def write(metadata, outfile)
@@ -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.0'
5
+ s.version = '0.1.1'
6
6
  s.summary = 'Asciidoctor extensions by Neo4j.'
7
7
  s.description = 'Asciidoctor extensions by Neo4j.'
8
8
 
@@ -115,5 +115,21 @@ describe Neo4j::AsciidoctorExtensions::DocumentMetadataGeneratorPostProcessor do
115
115
  expect(taxonomies.detect { |taxonomy| taxonomy['key'] == 'programming_language' }['values']).to eql(%w[java])
116
116
  expect(taxonomies.detect { |taxonomy| taxonomy['key'] == 'neo4j_version' }['values']).to eql(%w[3-5 3-6])
117
117
  end
118
+ it 'should replace - by _ in the attribute name' do
119
+ input = <<~'ADOC'
120
+ = Introduction to Neo4j 4.0
121
+ :slug: introduction-neo4j-4-0
122
+ :parent-path: /labs
123
+
124
+ This is a paragraph.
125
+ ADOC
126
+ Asciidoctor.convert(input, safe: 'safe', to_file: 'spec/output/test.html', attributes: {
127
+ 'document-metadata-attrs-include' => 'slug,parent-path'
128
+ })
129
+ metadata = YAML.load_file('spec/output/test.yml')
130
+ expect(metadata['title']).to eql('Introduction to Neo4j 4.0')
131
+ expect(metadata['slug']).to eql('introduction-neo4j-4-0')
132
+ expect(metadata['parent_path']).to eql('/labs')
133
+ end
118
134
  end
119
135
  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.0
4
+ version: 0.1.1
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-04 00:00:00.000000000 Z
11
+ date: 2020-05-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: asciidoctor