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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2bb8bf4e21a7c0da30e0862a44aa6d44bb7b848454e7709586e1d500849de30e
4
- data.tar.gz: 1793750752bdcfb66b5193de00e0a51d962c941b41b642c17f8c3129fab0b4d9
3
+ metadata.gz: 913e5200ec486ba047e69d3a006730d8a9fe8d4a9a46736a7cdd9d423008f1eb
4
+ data.tar.gz: 61c40984ac58a623d558b2044dae503c5dddc678843156c35450cfa8fc5a1bb8
5
5
  SHA512:
6
- metadata.gz: 958552ef2e142a7792272b4713997129946bc39325c7325f7cf5e49e37d9d98f211f27efe3e453a2de443a24965d1da4d1de3f0e7b279e0495bd4668d02c8a78
7
- data.tar.gz: 237265848e2094213d2387cd8c4e2f23d6296409199e8b9223949c9493a23ff81de74625f1db396bdc8bc8d4ffdb5e7bef036cc01d66ddb8f9cc4b5f444d2a8f
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-2018 Jakub Jirutka <jakub@jirutka.cz>.
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
@@ -2,7 +2,7 @@
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.6.0
6
6
  :gh-name: jirutka/{gem-name}
7
7
  :gh-branch: master
8
8
  :codacy-id: b23b8c6503474ea5b13537eaef0c73d5
@@ -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', '< 4.0'
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
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Asciidoctor
4
4
  module TemplatesCompiler
5
- VERSION = '0.5.0'
5
+ VERSION = '0.6.0'
6
6
  end
7
7
  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.5.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: 2018-11-29 00:00:00.000000000 Z
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: '4.0'
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: '4.0'
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.8
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