asciidoctor-json-value-loader 0.1.1 → 0.2.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: e9989cd6deba395d1a2746a99f893dac635201b67fcfe3eefb7caeca589a967a
4
- data.tar.gz: 1c11227b05fc258975d4bf03ab1d6a6520c7cd40d74309f2130f732ec7d92ba6
3
+ metadata.gz: c1a49b45f4f5a1c0f95adb31f68d3869aced151c1f67be786cd0202384db8ae7
4
+ data.tar.gz: c4d25c91934d260e13e95d1db516128f27f6555fc203b8cee8f270b3eb0e8905
5
5
  SHA512:
6
- metadata.gz: c0189c1b8a2de4f04e7b298c2f99d3fa9de270047e4ba2233e51b582e96c0a44cb450d33888aa6a25913c5d1416294a65692f4eae11baf073afc1987b652d55d
7
- data.tar.gz: b9d72bfac00555b23dd3b0e74ccef7792fea1c9cd4fe3f52bf4ae839cbda44ec669d5a3b5bc60d4ff0f3529914a26f712a3a0e56fe6723c4a2345d87ae91a5bf
6
+ metadata.gz: 294a447855a7a7b5b2a0a8f418caf6263eccbe2fd394bc2cc24c3c2534ace4b193b6492b6691081c438362ee37a5e2df9e0c903c4eee9b9fd97ed8734fc2e40e
7
+ data.tar.gz: 243db55aada57b92ed394ef7db42161766a12ede32ce76bd305956ea5392956b2d0427552d45b0ae6acc89c5be8e0dd29f2d20bbd4290e79d2f26a9cd5030b24
@@ -8,13 +8,15 @@ class JsonValueLoadInlineMacro < Asciidoctor::Extensions::InlineMacroProcessor
8
8
  use_dsl
9
9
 
10
10
  named "json-value"
11
- name_positional_attributes 'volnum'
11
+ name_positional_attributes 'delimitter'
12
+ default_attrs 'delimiter' => '/'
12
13
 
13
14
  def process parent, target, attrs
14
15
 
15
- path, query = target.split(':')
16
+ path, query = target.split(':', 2)
17
+ delimiter = attrs['delimiter']
16
18
 
17
- query = query.split('.').map do |q|
19
+ query = query.split(delimiter).map do |q|
18
20
  decoded = URI.decode_www_form_component(q)
19
21
  if decoded.match(/^\d+$/) then
20
22
  decoded.to_i
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: asciidoctor-json-value-loader
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - msr1k
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-07-13 00:00:00.000000000 Z
11
+ date: 2024-07-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: asciidoctor
@@ -24,7 +24,10 @@ dependencies:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
- description: Adds asciidoctor a funcitons to load specific JSON value from JSON file
27
+ description: |
28
+ Adds asciidoctor a funciton to load specific JSON value from JSON file
29
+
30
+ (See: https://github.com/msr1k/asciidoctor-json-value-loader)
28
31
  email: msr0210@gmail.com
29
32
  executables: []
30
33
  extensions: []
@@ -53,5 +56,5 @@ requirements: []
53
56
  rubygems_version: 3.4.22
54
57
  signing_key:
55
58
  specification_version: 4
56
- summary: 'An asciidoctor extention to load specific JSON value. (See: https://github.com/msr1k/asciidoctor-json-value-loader)'
59
+ summary: An asciidoctor extention to load specific JSON value.
57
60
  test_files: []