sassc-ruby
sassc-ruby copied to clipboard
undefined method assert_type
assert_type (part of EvaluationContext) causes errors in ruby-extensions.
Test/example:
def test_function_that_asserts_a_type
engine = Engine.new("$value: attempt_assertion('abc');")
engine.render
end
private
module Script::Functions
def attempt_assertion str
assert_type str, :String
end
end
Output:
SassC::SyntaxError: Error: error in C function attempt_assertion: undefined method
assert_typefor SassC::FunctionsHandler::FunctionWrapper:Class
Do you have any pointers on how to make this work in sassc-ruby?
We don't support this yet. It shouldn't be too difficult, let me look into it.
Cool, that'd be great :)
I'm working on porting a gem to sassc. But I ran into this issue too.
It's been open since 2016... Has it been implemented in some other way?
No, it's not implemented yet, but PRs are welcome.