[DRE-commits] [asciidoctor] 05/10: fix code logic to not depend on when the slim library has been loaded.

Antonio Terceiro terceiro at moszumanska.debian.org
Tue Nov 17 16:38:34 UTC 2015


This is an automated email from the git hooks/post-receive script.

terceiro pushed a commit to branch master
in repository asciidoctor.

commit 1bff04a7c695dba9bd8e95e5d47cd9499c5fdbb9
Author: Antonio Terceiro <terceiro at debian.org>
Date:   Tue Nov 17 11:42:45 2015 -0200

    fix code logic to not depend on when the slim library has been loaded.
---
 debian/changelog               |  2 ++
 debian/patches/series          |  1 +
 debian/patches/slim-test.patch | 25 +++++++++++++++++++++++++
 3 files changed, 28 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 6e81ada..a642414 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -10,6 +10,8 @@ asciidoctor (1.5.3-1) UNRELEASED; urgency=medium
   * Patches added:
     - skip-asciimath-test.patch: skip test that depends on a library not yet
       in Debian
+    - slim-test.patch: fix code logic to not depend on when the slim library
+      has been loaded.
 
  -- Antonio Terceiro <terceiro at debian.org>  Mon, 16 Nov 2015 17:30:21 -0200
 
diff --git a/debian/patches/series b/debian/patches/series
index 01c152d..4b577c1 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,4 @@
 data_path.patch
 lib_directory_in_tests.patch
 skip-asciimath-test.patch
+slim-test.patch
diff --git a/debian/patches/slim-test.patch b/debian/patches/slim-test.patch
new file mode 100644
index 0000000..4f598eb
--- /dev/null
+++ b/debian/patches/slim-test.patch
@@ -0,0 +1,25 @@
+Description: Fix slim template loading wrt load order
+ If Slim has been loaded before that point, an instance variable won't be set.
+Author: Antonio Terceiro <terceiro at debian.org>
+Origin: vendor
+Forwarded: https://github.com/asciidoctor/asciidoctor/pull/1576
+Last-Update: 2015-11-17
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+--- a/lib/asciidoctor/converter/template.rb
++++ b/lib/asciidoctor/converter/template.rb
+@@ -253,10 +253,10 @@ module Asciidoctor
+           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'

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/asciidoctor.git



More information about the Pkg-ruby-extras-commits mailing list