gi / tilt-handlebars

A Tilt interface to the official JavaScript version of Handlebars.
MIT License
17 stars 5 forks source link

fix uninitialized constant Tilt::HandlebarsTemplate::Pathname #1

Closed defeated closed 10 years ago

defeated commented 10 years ago

using a partial that has not already been registered raising the "uninitialized constant Tilt::HandlebarsTemplate::Pathname" error.

require 'tilt/handlebars'
tmpl = Tilt.new 'hello.hbs'
puts tmpl.render name: 'railsconf'

templates:

hello.hbs template:

{{> header}}

hello {{name}}!

header.hbs partial:

<h1>HEADING</h1>
jimothyGator commented 10 years ago

Thanks for the patch. I'll merge it in this weekend. Would it be possible for you to add a test case (ideally using Minitest::Spec or simply Minitest)? If not, I'll work on that.

defeated commented 10 years ago

I tried, but it looks like this existing test already covers my use case, but something else must be requiring pathname from the std lib, masking the issue from my minimal case (above)?

https://github.com/jimothyGator/tilt-handlebars/blob/develop/test/tilt_handlebarstemplate_test.rb#L232-L235

defeated commented 10 years ago

For posterity, I'm on OS X Mavericks using Ruby 2.1.1 -

★ ruby -v
ruby 2.1.1p76 (2014-02-24 revision 45161) [x86_64-darwin13.0]
jimothyGator commented 10 years ago

Version 1.3.1 is now available on Rubygems.org.