You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gentoo-overlay/dev-ruby/asciidoctor/files/asciidoctor-1.5.3-slim-opti...

32 lines
1.4 KiB

From 04b9d6153d1e289bd450a2f52bffde754ef4d1b0 Mon Sep 17 00:00:00 2001
From: Antonio Terceiro <terceiro@softwarelivre.org>
Date: Tue, 17 Nov 2015 11:17:16 -0200
Subject: [PATCH] Initialize slim-related attributes regardless of when slim
was loaded
Setting instance attributes of the Template class cannot depend on
whether slim has been loaded before or not.
---
lib/asciidoctor/converter/template.rb | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/lib/asciidoctor/converter/template.rb b/lib/asciidoctor/converter/template.rb
index 10eaa99..43be87b 100644
--- a/lib/asciidoctor/converter/template.rb
+++ b/lib/asciidoctor/converter/template.rb
@@ -253,10 +253,10 @@ def scan_dir template_dir, pattern, template_cache = nil
unless defined? ::Slim
# slim doesn't get loaded by Tilt, so we have to load it explicitly
Helpers.require_library 'slim'
- if @safe && ::Slim::VERSION >= '3.0'
- slim_asciidoc_opts = (@engine_options[:slim][:asciidoc] ||= {})
- slim_asciidoc_opts[:safe] ||= @safe
- end
+ end
+ if @safe && ::Slim::VERSION >= '3.0'
+ slim_asciidoc_opts = (@engine_options[:slim][:asciidoc] ||= {})
+ slim_asciidoc_opts[:safe] ||= @safe
end
# load include plugin when using Slim >= 2.1
require 'slim/include' unless (defined? ::Slim::Include) || ::Slim::VERSION < '2.1'