asciidoctor-templates-compiler 0.5.0 → 0.7.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: 2bb8bf4e21a7c0da30e0862a44aa6d44bb7b848454e7709586e1d500849de30e
4
- data.tar.gz: 1793750752bdcfb66b5193de00e0a51d962c941b41b642c17f8c3129fab0b4d9
3
+ metadata.gz: 864030a8f7ec20d74c097fd05117aeba9bf59b85a6b827a709396ff1d9c633ed
4
+ data.tar.gz: 6d10be25f6334171a7ecfca4ca2a643760a4985ae0a0eb72725e3b0c0de21d60
5
5
  SHA512:
6
- metadata.gz: 958552ef2e142a7792272b4713997129946bc39325c7325f7cf5e49e37d9d98f211f27efe3e453a2de443a24965d1da4d1de3f0e7b279e0495bd4668d02c8a78
7
- data.tar.gz: 237265848e2094213d2387cd8c4e2f23d6296409199e8b9223949c9493a23ff81de74625f1db396bdc8bc8d4ffdb5e7bef036cc01d66ddb8f9cc4b5f444d2a8f
6
+ metadata.gz: 2fc7113d301ff525f06cf23d6f4ecba39e860b66dd9c4e9b2622da3522adfe7dd4d46ad730a68e90a4845b9cb46d95c4a5045bd9a336881ff7f6f1d67d840aee
7
+ data.tar.gz: 9768e3952ff6f54a52bc4a19eadefc8c5cf8d8e4ce3f25631b3cf6d90b98203a9c5e0d6ebbc697c08afa2e53afd5908bb37aba32e552fff0bb2428462d40a726
data/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License
2
2
 
3
- Copyright 2017-2018 Jakub Jirutka <jakub@jirutka.cz>.
3
+ Copyright 2017-present 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
@@ -2,13 +2,13 @@
2
2
  :source-language: ruby
3
3
  // custom
4
4
  :gem-name: asciidoctor-templates-compiler
5
- :gem-version: 0.5.0
5
+ :gem-version: 0.7.0
6
6
  :gh-name: jirutka/{gem-name}
7
7
  :gh-branch: master
8
8
  :codacy-id: b23b8c6503474ea5b13537eaef0c73d5
9
9
 
10
10
  ifdef::env-github[]
11
- image:https://travis-ci.org/{gh-name}.svg?branch={gh-branch}[Build Status, link="https://travis-ci.org/{gh-name}"]
11
+ image:https://github.com/{gh-name}/workflows/CI/badge.svg[CI Status, link=https://github.com/{gh-name}/actions?query=workflow%3A%22CI%22]
12
12
  image:https://api.codacy.com/project/badge/Coverage/{codacy-id}["Test Coverage", link="https://www.codacy.com/app/{gh-name}"]
13
13
  image:https://api.codacy.com/project/badge/Grade/{codacy-id}["Codacy Code quality", link="https://www.codacy.com/app/{gh-name}"]
14
14
  image:https://img.shields.io/gem/v/{gem-name}.svg?style=flat[Gem Version, link="https://rubygems.org/gems/{gem-name}"]
@@ -16,8 +16,6 @@ endif::env-github[]
16
16
 
17
17
  This tool allows to precompile Slim templates into Ruby code and assemble them into a single-file pure Ruby converter (backend).
18
18
 
19
- TODO
20
-
21
19
 
22
20
  == Installation
23
21
 
@@ -44,7 +42,7 @@ $ bundle install
44
42
  The main entry point is method `Asciidoctor::TemplatesCompiler::Slim#compile_converter` (for Slim) that accepts the following keyword arguments.
45
43
 
46
44
  backend_info::
47
- A hash of keys for `backend_info`: `basebackend`, `outfilesuffix`, `filetype`, `htmlsyntax`, `supports_templates` (supported since Asciidoctor ≥ 1.5.7).
45
+ A hash of keys for `backend_info`: `basebackend`, `outfilesuffix`, `filetype`, `htmlsyntax`, `supports_templates`.
48
46
 
49
47
  class_name::
50
48
  Full name of the converter class to generate (e.g. `My::HTML::Converter`).
@@ -15,13 +15,13 @@ Gem::Specification.new do |s|
15
15
 
16
16
  s.required_ruby_version = '>= 2.1'
17
17
 
18
- s.add_runtime_dependency 'asciidoctor', '>= 1.5.0', '< 2.1'
18
+ s.add_runtime_dependency 'asciidoctor', '~> 2.0'
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', '< 4.0'
21
+ s.add_runtime_dependency 'slim', '>= 2.1', '< 6.0'
22
22
  s.add_runtime_dependency 'ruby-beautify2', '~> 0.98'
23
23
 
24
- s.add_development_dependency 'rake', '~> 12.0'
24
+ s.add_development_dependency 'rake', '~> 13.0'
25
25
  s.add_development_dependency 'rspec', '~> 3.6'
26
26
  s.add_development_dependency 'rubocop', '~> 0.49.0'
27
27
  s.add_development_dependency 'simplecov', '~> 0.14'
@@ -22,8 +22,7 @@ HELP_MSG = <<-EOF.unindent
22
22
 
23
23
  Options:
24
24
  -b --backend-info KEY=VAL[,...] Parameters for backend_info: basebackend, outfilesuffix,
25
- filetype, htmlsyntax, and supports_templates (requires
26
- Asciidoctor >= 1.5.7).
25
+ filetype, htmlsyntax, and supports_templates.
27
26
 
28
27
  -n --class-name NAME Full name of the converter class to generate (e.g.
29
28
  My::HTML::Converter) [default: Converter].
@@ -150,20 +150,21 @@ module Asciidoctor::TemplatesCompiler
150
150
 
151
151
  def convert_method_code
152
152
  converter = if @delegate_backend
153
- 'respond_to?(transform) ? self : @delegate_converter'
153
+ 'respond_to?(meth_name) ? self : @delegate_converter'
154
154
  else
155
155
  'self'
156
156
  end
157
157
 
158
158
  <<-EOF.reindent(2)
159
159
  def convert(node, transform = nil, opts = {})
160
- transform ||= node.node_name
160
+ meth_name = "convert_\#{transform || node.node_name}"
161
+ opts ||= {}
161
162
  converter = #{converter}
162
163
 
163
164
  if opts.empty?
164
- converter.send(transform, node)
165
+ converter.send(meth_name, node)
165
166
  else
166
- converter.send(transform, node, opts)
167
+ converter.send(meth_name, node, opts)
167
168
  end
168
169
  end
169
170
  EOF
@@ -186,7 +187,7 @@ module Asciidoctor::TemplatesCompiler
186
187
 
187
188
  @transforms_code.each do |name, code|
188
189
  out << "\n"
189
- out << " def #{name}(node, opts = {})\n"
190
+ out << " def convert_#{name}(node, opts = {})\n"
190
191
  out << " node.extend(Helpers)\n" unless @helpers_code.blank?
191
192
  out << " node.instance_eval do\n"
192
193
  out << " converter.set_local_variables(binding, opts) unless opts.empty?\n" unless @ignore_convert_opts # rubocop:disable LineLength
@@ -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
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Asciidoctor
4
4
  module TemplatesCompiler
5
- VERSION = '0.5.0'
5
+ VERSION = '0.7.0'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,35 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: asciidoctor-templates-compiler
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.7.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: 2018-11-29 00:00:00.000000000 Z
11
+ date: 2023-07-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: asciidoctor
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
18
- - !ruby/object:Gem::Version
19
- version: 1.5.0
20
- - - "<"
17
+ - - "~>"
21
18
  - !ruby/object:Gem::Version
22
- version: '2.1'
19
+ version: '2.0'
23
20
  type: :runtime
24
21
  prerelease: false
25
22
  version_requirements: !ruby/object:Gem::Requirement
26
23
  requirements:
27
- - - ">="
28
- - !ruby/object:Gem::Version
29
- version: 1.5.0
30
- - - "<"
24
+ - - "~>"
31
25
  - !ruby/object:Gem::Version
32
- version: '2.1'
26
+ version: '2.0'
33
27
  - !ruby/object:Gem::Dependency
34
28
  name: corefines
35
29
  requirement: !ruby/object:Gem::Requirement
@@ -67,7 +61,7 @@ dependencies:
67
61
  version: '2.1'
68
62
  - - "<"
69
63
  - !ruby/object:Gem::Version
70
- version: '4.0'
64
+ version: '6.0'
71
65
  type: :runtime
72
66
  prerelease: false
73
67
  version_requirements: !ruby/object:Gem::Requirement
@@ -77,7 +71,7 @@ dependencies:
77
71
  version: '2.1'
78
72
  - - "<"
79
73
  - !ruby/object:Gem::Version
80
- version: '4.0'
74
+ version: '6.0'
81
75
  - !ruby/object:Gem::Dependency
82
76
  name: ruby-beautify2
83
77
  requirement: !ruby/object:Gem::Requirement
@@ -98,14 +92,14 @@ dependencies:
98
92
  requirements:
99
93
  - - "~>"
100
94
  - !ruby/object:Gem::Version
101
- version: '12.0'
95
+ version: '13.0'
102
96
  type: :development
103
97
  prerelease: false
104
98
  version_requirements: !ruby/object:Gem::Requirement
105
99
  requirements:
106
100
  - - "~>"
107
101
  - !ruby/object:Gem::Version
108
- version: '12.0'
102
+ version: '13.0'
109
103
  - !ruby/object:Gem::Dependency
110
104
  name: rspec
111
105
  requirement: !ruby/object:Gem::Requirement
@@ -187,8 +181,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
187
181
  - !ruby/object:Gem::Version
188
182
  version: '0'
189
183
  requirements: []
190
- rubyforge_project:
191
- rubygems_version: 2.7.8
184
+ rubygems_version: 3.4.10
192
185
  signing_key:
193
186
  specification_version: 4
194
187
  summary: Compile templates-based Asciidoctor converter (backend) into a single Ruby