Closed andrewfader closed 6 years ago
It's not reproductive:
$ ruby -v
ruby 2.4.2p198 (2017-09-14 revision 59899) [x86_64-darwin16]
$ hamlit version
2.8.4
$ cat in.haml
- song = Object.new
- def song.up_or_down?; true; end
%div.price{class: song.up_or_down?}
$ hamlit in.haml
<div class='price true'></div>
Could you see https://github.com/k0kubun/hamlit#reporting-an-issue and provide mode details?
Make your file return a string and it produces this
$ ruby -v
ruby 2.5.0preview1 (2017-10-10 trunk 60153) [x86_64-linux]
$ hamlit version
2.8.4
$ cat test.haml
- song = Object.new
- def song.up_or_down?; "hello"; end
%div.price{class: song.up_or_down?}
$ hamlit test.haml
<div class='20641625616 price'></div>
Thanks for details.
As it's fixed on master branch (but not released because there are still other problems with 2.5), I'll release next version for you.
Done.
$ ruby -v
ruby 2.5.0preview1 (2017-10-10 trunk 60153) [x86_64-darwin16]
$ hamlit version
2.8.5
$ cat test.haml
- song = Object.new
- def song.up_or_down?; "hello"; end
%div.price{class: song.up_or_down?}
$ hamlit test.haml
<div class='hello price'></div>
Thanks! 👍
I'm doing something like this
%div.price{class: song.up_or_down?}
It works fine in vanilla haml, but in hamlit it instead returns some number for the method (should return a string)