neo4j-asciidoctor-extensions 0.0.5 → 0.1.0

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: b9aa5c3d1385aa9d4dd4ac11820ffb24ab9dca9fd02b99bcffe6979031469adc
4
- data.tar.gz: 129476850c9147c0fbc8accaf0309f59c787f2e4defb8a3c5ecd444a28060086
3
+ metadata.gz: dcbc65f6a14ef93402a8961fb7bac6edfcbf20a62c456bde6bf8bf925afdd7a6
4
+ data.tar.gz: 3f3144432df9404adfa853e72fe45f6a333240e270f5d81f6f022776144d95e7
5
5
  SHA512:
6
- metadata.gz: 6f0c5596adbf742abb16103642445284bb0be42720e1ed57fdc1f9cfa7322c0191261af133f2ae0c9a556696e0af2406e11157d935e5667c52793194101afe45
7
- data.tar.gz: c0640a5f5a47220d006bcc2d84aca356dfdcadfb17554b1f121df9cb0aa2c81085566d0a946a8eab1842a36eda39a63b594802ce125522ad45a16062fe8f3986
6
+ metadata.gz: 63cf0561afd28054eddca4cf0139d2c75dd26afa056dea387e00237f03e82bfdc2ab99e7c0efe9d5ecf2dabf78c1138a8c5703f6fe82733aca59762df472c29d
7
+ data.tar.gz: 995c16ae55d5c2a9636781298bd241f2db04b8040549ee36d83015955b36b6badd21ff59e13da39e2a0af7ada70961538f5f53a780cdd92d3c4238010e4fc698
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- neo4j-asciidoctor-extensions (0.0.5)
4
+ neo4j-asciidoctor-extensions (0.1.0)
5
5
  asciidoctor (~> 2.0.0)
6
6
  asciidoctor-pdf (= 1.5.3)
7
7
  rouge (~> 3.18.0)
data/README.adoc CHANGED
@@ -216,7 +216,7 @@ end
216
216
  == Release
217
217
 
218
218
  The release process is automated and relies on GitHub Actions.
219
- We are using the :robot: `neo4j-oss-build` account to published on https://rubygems.org/gems/neo4j-asciidoctor-extensions.
219
+ We are using the :robot: `neo4j-oss-build` account to publish on https://rubygems.org/gems/neo4j-asciidoctor-extensions.
220
220
 
221
221
  The `RUBYGEMS_API_KEY` secret is configured on GitHub.
222
222
  See the `.github/workflows/release.yml` file for details.
@@ -84,7 +84,7 @@ module Neo4j
84
84
  def resolve_value_type(attr_include)
85
85
  if attr_include.end_with? '*'
86
86
  ValueType::LIST_STRING
87
- elsif attr_include.end_with? '*<>'
87
+ elsif (attr_include.end_with? '*&lt;&gt;') || (attr_include.end_with? '*<>')
88
88
  ValueType::LIST_TUPLES
89
89
  else
90
90
  ValueType::STRING
@@ -95,6 +95,7 @@ module Neo4j
95
95
  attr_include
96
96
  .gsub(/\*$/, '')
97
97
  .gsub(/\*&lt;&gt;$/, '')
98
+ .gsub(/\*<>$/, '')
98
99
  .gsub('-', '_')
99
100
  end
100
101
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = 'neo4j-asciidoctor-extensions'
5
- s.version = '0.0.5'
5
+ s.version = '0.1.0'
6
6
  s.summary = 'Asciidoctor extensions by Neo4j.'
7
7
  s.description = 'Asciidoctor extensions by Neo4j.'
8
8
 
@@ -54,7 +54,7 @@ describe Neo4j::AsciidoctorExtensions::DocumentMetadataGeneratorPostProcessor do
54
54
  expect(metadata['slug']).to eql('introduction-neo4j-4-0')
55
55
  expect(metadata['tags']).to eql(%w[intro neo4j])
56
56
  end
57
- it 'should generate metadata with taxonomies (list of tuples)' do
57
+ it 'should generate metadata with taxonomies (list of tuples) using document attribute' do
58
58
  input = <<~'ADOC'
59
59
  = Introduction to Neo4j 4.0
60
60
  :document-metadata-attrs-include: slug,tags*,taxonomies*<>
@@ -74,5 +74,46 @@ describe Neo4j::AsciidoctorExtensions::DocumentMetadataGeneratorPostProcessor do
74
74
  expect(taxonomies.detect { |taxonomy| taxonomy['key'] == 'programming_language' }['values']).to eql(%w[java])
75
75
  expect(taxonomies.detect { |taxonomy| taxonomy['key'] == 'neo4j_version' }['values']).to eql(%w[3-5 3-6])
76
76
  end
77
+ it 'should generate metadata with taxonomies (list of tuples) using document attribute with pass' do
78
+ input = <<~'ADOC'
79
+ = Introduction to Neo4j 4.0
80
+ :document-metadata-attrs-include: pass:[slug,tags*,taxonomies*<>]
81
+ :slug: introduction-neo4j-4-0
82
+ :tags: intro , neo4j,,
83
+ :taxonomies: os= linux,,programming_language =java, neo4j_version=3-5; 3-6;
84
+
85
+ This is a paragraph.
86
+ ADOC
87
+ Asciidoctor.convert(input, safe: 'safe', to_file: 'spec/output/test.html')
88
+ metadata = YAML.load_file('spec/output/test.yml')
89
+ expect(metadata['title']).to eql('Introduction to Neo4j 4.0')
90
+ expect(metadata['slug']).to eql('introduction-neo4j-4-0')
91
+ expect(metadata['tags']).to eql(%w[intro neo4j])
92
+ taxonomies = metadata['taxonomies']
93
+ expect(taxonomies.detect { |taxonomy| taxonomy['key'] == 'os' }['values']).to eql(%w[linux])
94
+ expect(taxonomies.detect { |taxonomy| taxonomy['key'] == 'programming_language' }['values']).to eql(%w[java])
95
+ expect(taxonomies.detect { |taxonomy| taxonomy['key'] == 'neo4j_version' }['values']).to eql(%w[3-5 3-6])
96
+ end
97
+ it 'should generate metadata with taxonomies (list of tuples) using CLI attribute' do
98
+ input = <<~'ADOC'
99
+ = Introduction to Neo4j 4.0
100
+ :slug: introduction-neo4j-4-0
101
+ :tags: intro , neo4j,,
102
+ :taxonomies: os= linux,,programming_language =java, neo4j_version=3-5; 3-6;
103
+
104
+ This is a paragraph.
105
+ ADOC
106
+ Asciidoctor.convert(input, safe: 'safe', to_file: 'spec/output/test.html', attributes: {
107
+ 'document-metadata-attrs-include' => 'slug,tags*,taxonomies*<>'
108
+ })
109
+ metadata = YAML.load_file('spec/output/test.yml')
110
+ expect(metadata['title']).to eql('Introduction to Neo4j 4.0')
111
+ expect(metadata['slug']).to eql('introduction-neo4j-4-0')
112
+ expect(metadata['tags']).to eql(%w[intro neo4j])
113
+ taxonomies = metadata['taxonomies']
114
+ expect(taxonomies.detect { |taxonomy| taxonomy['key'] == 'os' }['values']).to eql(%w[linux])
115
+ expect(taxonomies.detect { |taxonomy| taxonomy['key'] == 'programming_language' }['values']).to eql(%w[java])
116
+ expect(taxonomies.detect { |taxonomy| taxonomy['key'] == 'neo4j_version' }['values']).to eql(%w[3-5 3-6])
117
+ end
77
118
  end
78
119
  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.0.5
4
+ version: 0.1.0
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-04-27 00:00:00.000000000 Z
11
+ date: 2020-05-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: asciidoctor