Closed ryanong closed 9 years ago
Please, right now I don't really get what you mean.
Just out of curiosity, for what kind of project are you using Scribble?
schoolkeep.com we are creating a custom templating feature so educators can have custom websites.
Scribble::Template.new('{{ if true }}{{ no_to_string }}{{ end }}').render(variables: {no_to_string: Object.new})
will return
Class: <Scribble::Errors::Undefined>
Message: <"Undefined method 'if' at line 1 column 4">
Scribble::Template.new('{{ no_to_string }}').render(variables: {no_to_string: Object.new})
will return
Class: <Scribble::Support::Unmatched>
Message: <"Scribble::Support::Unmatched">
When it should return a different Error, like NoToString
or UnCoerceable
Fixed in bd889cff108c1785cd28150763abd9b31782b44f
This now causes an informative RuntimeError as a missing cast method should cause a 500 in your application whereas subclasses of Scribble::Errors::Error
are meant to be displayed to your users. You are supposed to only pass objects around Scribble that have both to_string and to_boolean and ideally also have a proper name. See lib/scribble/objects
, this should also be implemented on Enumerable
as we now support an each method.
I'll try to get a working example of this soon.