Skip to content
Snippets Groups Projects
Verified Commit 4a863d6c authored by Daniel Leidert's avatar Daniel Leidert :point_right:
Browse files

Fix tests with Ruby HAML 6

  * debian/patches/0005-Fix-syntax-for-ruby-haml-6.patch: Add patch.
    - Fix syntax for Ruby HAML 6 (closes: #1005631).
parent 75753986
No related branches found
No related tags found
No related merge requests found
......@@ -7,6 +7,8 @@ ruby-handlebars-assets (2:0.23.9+dfsg-1~1.gbpd6eb8d) UNRELEASED; urgency=medium
* Bump Standards-Version to 4.6.2 (no changes needed)
[ Daniel Leidert ]
* debian/patches/0005-Fix-syntax-for-ruby-haml-6.patch: Add patch.
- Fix syntax for Ruby HAML 6 (closes: #1005631).
* UNRELEASED
-- Daniel Leidert <dleidert@debian.org> Wed, 25 Jan 2023 23:16:30 +0100
......
......@@ -6,7 +6,7 @@ Uploaders: Pirate Praveen <praveen@debian.org>
Build-Depends: debhelper-compat (= 13),
gem2deb,
ruby-execjs,
ruby-haml,
ruby-haml (>= 6.0~),
ruby-multi-json,
ruby-slim,
ruby-sprockets,
......
From: Daniel Leidert <dleidert@debian.org>
Date: Wed, 25 Jan 2023 23:50:08 +0100
Subject: Fix syntax for ruby-haml 6
The interface of 'Haml::Engine' is changed in version 6:
* before: 'Haml::Engine.new("%p Haml code!").render'
* after: 'Haml::Template.new { "%p Haml code!" }.render'
https://github.com/haml/haml/blob/v6.1.1/CHANGELOG.md?plain=1#L90-L92
Bug-Debian: https://bugs.debian.org/1005631
Forwarded: no
---
handlebars_assets.gemspec | 2 +-
lib/handlebars_assets/handlebars_template.rb | 2 +-
test/handlebars_assets/hamlbars_test.rb | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/handlebars_assets.gemspec b/handlebars_assets.gemspec
index 2b51658..1038d9c 100644
--- a/handlebars_assets.gemspec
+++ b/handlebars_assets.gemspec
@@ -24,7 +24,7 @@ Gem::Specification.new do |s|
s.add_runtime_dependency "sprockets", ">= 2.0.0"
s.add_development_dependency "minitest", '~> 5.5'
- s.add_development_dependency "haml", '~> 4.0'
+ s.add_development_dependency "haml", '~> 6.0'
s.add_development_dependency "rake", '~> 10.0'
s.add_development_dependency "slim", '~> 3.0'
s.add_development_dependency "appraisal"
diff --git a/lib/handlebars_assets/handlebars_template.rb b/lib/handlebars_assets/handlebars_template.rb
index 17f2e83..d55a5b1 100644
--- a/lib/handlebars_assets/handlebars_template.rb
+++ b/lib/handlebars_assets/handlebars_template.rb
@@ -103,7 +103,7 @@ module HandlebarsAssets
def choose_engine(data)
if @template_path.is_haml?
- Haml::Engine.new(data, HandlebarsAssets::Config.haml_options)
+ Haml::Template.new(HandlebarsAssets::Config.haml_options) { data }
elsif @template_path.is_slim?
Slim::Template.new(HandlebarsAssets::Config.slim_options) { data }
else
diff --git a/test/handlebars_assets/hamlbars_test.rb b/test/handlebars_assets/hamlbars_test.rb
index 74a9560..757ceb3 100644
--- a/test/handlebars_assets/hamlbars_test.rb
+++ b/test/handlebars_assets/hamlbars_test.rb
@@ -6,7 +6,7 @@ module HandlebarsAssets
include CompilerSupport
def compile_haml(source)
- (Haml::Engine.new(source, HandlebarsAssets::Config.haml_options).render).chomp
+ (Haml::Template.new(HandlebarsAssets::Config.haml_options) { source }.render).chomp
end
def setup
0002-Fix-slimbars-test.patch
0003-Reset-path-before-each-test-to-fix-the-first-one.patch
0004-require-slim-haml.patch
0005-Fix-syntax-for-ruby-haml-6.patch
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment