asciidoctor-templates-compiler 0.5.0 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE +1 -1
- data/README.adoc +1 -1
- data/asciidoctor-templates-compiler.gemspec +1 -1
- data/lib/asciidoctor/templates_compiler/converter_generator.rb +11 -0
- data/lib/asciidoctor/templates_compiler/ruby_beautify.rb +0 -12
- data/lib/asciidoctor/templates_compiler/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 913e5200ec486ba047e69d3a006730d8a9fe8d4a9a46736a7cdd9d423008f1eb
|
4
|
+
data.tar.gz: 61c40984ac58a623d558b2044dae503c5dddc678843156c35450cfa8fc5a1bb8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f8e4ebe8025e444cba2ae8bf869b14aed70d14c84e5e4605138730028c46a54324ffcf7ed48a9eba2d507cf8f44e3b2c5953bb0f2db5d42f9f2ce7466651dcf1
|
7
|
+
data.tar.gz: d177efad4369890eaaca0902f2e4ff3cdeff8e5963fdac60c2cdd00cde66eb3ce82b7d3d80f06aa30c500b40b36002ffd8a4409cc8c43f502c9f212cb2cd66fd
|
data/LICENSE
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
The MIT License
|
2
2
|
|
3
|
-
Copyright 2017-
|
3
|
+
Copyright 2017-2020 Jakub Jirutka <jakub@jirutka.cz>.
|
4
4
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
data/README.adoc
CHANGED
@@ -18,7 +18,7 @@ Gem::Specification.new do |s|
|
|
18
18
|
s.add_runtime_dependency 'asciidoctor', '>= 1.5.0', '< 2.1'
|
19
19
|
s.add_runtime_dependency 'corefines', '~> 1.2'
|
20
20
|
s.add_runtime_dependency 'docopt', '~> 0.6'
|
21
|
-
s.add_runtime_dependency 'slim', '>= 2.1', '<
|
21
|
+
s.add_runtime_dependency 'slim', '>= 2.1', '< 5.0'
|
22
22
|
s.add_runtime_dependency 'ruby-beautify2', '~> 0.98'
|
23
23
|
|
24
24
|
s.add_development_dependency 'rake', '~> 12.0'
|
@@ -72,6 +72,7 @@ module Asciidoctor::TemplatesCompiler
|
|
72
72
|
out << helpers_code << "\n" unless @helpers_code.blank?
|
73
73
|
out << initialization_code << "\n"
|
74
74
|
out << convert_method_code << "\n"
|
75
|
+
out << handles_method_code << "\n"
|
75
76
|
transform_methods_code(out)
|
76
77
|
out << support_methods_code << "\n"
|
77
78
|
out << tail_code
|
@@ -158,6 +159,7 @@ module Asciidoctor::TemplatesCompiler
|
|
158
159
|
<<-EOF.reindent(2)
|
159
160
|
def convert(node, transform = nil, opts = {})
|
160
161
|
transform ||= node.node_name
|
162
|
+
opts ||= {}
|
161
163
|
converter = #{converter}
|
162
164
|
|
163
165
|
if opts.empty?
|
@@ -169,6 +171,15 @@ module Asciidoctor::TemplatesCompiler
|
|
169
171
|
EOF
|
170
172
|
end
|
171
173
|
|
174
|
+
# This is for compatibility with Asciidoctor >=2.0.0 (see #5).
|
175
|
+
def handles_method_code
|
176
|
+
<<-EOF.reindent(2)
|
177
|
+
def handles?(transform)
|
178
|
+
respond_to?("convert_\#{transform}") || respond_to?(transform)
|
179
|
+
end
|
180
|
+
EOF
|
181
|
+
end
|
182
|
+
|
172
183
|
def support_methods_code
|
173
184
|
return '' if @ignore_convert_opts
|
174
185
|
|
@@ -29,17 +29,5 @@ module Asciidoctor::TemplatesCompiler
|
|
29
29
|
end
|
30
30
|
|
31
31
|
alias call pretty_string
|
32
|
-
|
33
|
-
# XXX: Remove after https://github.com/erniebrodeur/ruby-beautify/pull/43 is merged.
|
34
|
-
# Overwrite this method from ::RubyBeautify with implementation that does
|
35
|
-
# not execute ruby subprocess.
|
36
|
-
def syntax_ok?(string)
|
37
|
-
catch :good do
|
38
|
-
eval "BEGIN { throw :good }; #{string}" # rubocop:disable Security/Eval
|
39
|
-
end
|
40
|
-
true
|
41
|
-
rescue SyntaxError
|
42
|
-
false
|
43
|
-
end
|
44
32
|
end
|
45
33
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: asciidoctor-templates-compiler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jakub Jirutka
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-01-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: asciidoctor
|
@@ -67,7 +67,7 @@ dependencies:
|
|
67
67
|
version: '2.1'
|
68
68
|
- - "<"
|
69
69
|
- !ruby/object:Gem::Version
|
70
|
-
version: '
|
70
|
+
version: '5.0'
|
71
71
|
type: :runtime
|
72
72
|
prerelease: false
|
73
73
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -77,7 +77,7 @@ dependencies:
|
|
77
77
|
version: '2.1'
|
78
78
|
- - "<"
|
79
79
|
- !ruby/object:Gem::Version
|
80
|
-
version: '
|
80
|
+
version: '5.0'
|
81
81
|
- !ruby/object:Gem::Dependency
|
82
82
|
name: ruby-beautify2
|
83
83
|
requirement: !ruby/object:Gem::Requirement
|
@@ -188,7 +188,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
188
188
|
version: '0'
|
189
189
|
requirements: []
|
190
190
|
rubyforge_project:
|
191
|
-
rubygems_version: 2.7.
|
191
|
+
rubygems_version: 2.7.7
|
192
192
|
signing_key:
|
193
193
|
specification_version: 4
|
194
194
|
summary: Compile templates-based Asciidoctor converter (backend) into a single Ruby
|