Created
May 7, 2015 21:36
-
-
Save ralfebert/37ec9f065cf495e97c67 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From 5366b677f1f7a1053de5904f96ba5108ffaf8953 Mon Sep 17 00:00:00 2001 | |
From: Ralf Ebert <[email protected]> | |
Date: Thu, 7 May 2015 23:33:01 +0200 | |
Subject: [PATCH] Fix for #844: Incompatibility haml (4.0.6) -> sprockets | |
(3.0.3) causing error 'wrong number of arguments' for inline :sass filter in | |
haml template | |
--- | |
lib/haml/sass_rails_filter.rb | 2 +- | |
1 file changed, 1 insertion(+), 1 deletion(-) | |
diff --git a/lib/haml/sass_rails_filter.rb b/lib/haml/sass_rails_filter.rb | |
index 9d3ef29..4b488a0 100644 | |
--- a/lib/haml/sass_rails_filter.rb | |
+++ b/lib/haml/sass_rails_filter.rb | |
@@ -4,7 +4,7 @@ module Haml | |
# Rails's asset helpers to be used inside Haml Sass filter. | |
class SassRailsTemplate < ::Sass::Rails::SassTemplate | |
def render(scope=Object.new, locals={}, &block) | |
- scope = ::Rails.application.assets.context_class.new(::Rails.application.assets, "/", "/") | |
+ scope = ::Rails.application.assets.context_class.new({environment: ::Rails.application.assets, logical_path: "/", filename: "/", metadata: {}}) | |
super | |
end | |
-- | |
2.3.0 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Monkey Patch for | |
# https://github.com/haml/haml/issues/844 | |
# Incompatibility haml (4.0.6) -> sprockets (3.0.3) causing error 'wrong number of arguments' for inline :sass filter in haml template | |
module Haml | |
module Filters | |
# This is an extension of Sass::Rails's SassTemplate class that allows | |
# Rails's asset helpers to be used inside Haml Sass filter. | |
class SassRailsTemplate | |
def render(scope=Object.new, locals={}, &block) | |
binding.pry | |
scope = ::Rails.application.assets.context_class.new({environment: ::Rails.application.assets, logical_path: "/", filename: "/", metadata: {}}) | |
super | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment