How does include_taglib decide where to look for taglib?

16 views
Skip to first unread message

Joachim

unread,
Jun 14, 2010, 12:32:07 PM6/14/10
to hobo...@googlegroups.com
I' like to ship a small taglib with a gem I'm making but I have a
problem. If I do

include_taglib "rapid_openid_user_pages", :plugin => "hobo"

Hobo looks for


/usr/lib64/ruby/gems/1.8/gems/hobo-1.0.1/taglibs/rapid_openid_user_pages.dryml

And if I do

include_taglib "rapid_openid_user_pages", :plugin => "hobo_openid"

Hobo looks for

/app/dir/vendor/plugins/hobo_openid/taglibs/rapid_openid_user_pages.dryml


So if I do :plugin => "hobo" it'll look for my taglib in hobo gem
directory but if I do :plugin => "hobo_openid" it'll not look in
hobo_openid gem directory but in vendor/plugins/hobo_openid.

Do you know how can I tell Hobo to look for taglib in hobo_openid gem
directory?

kevinpfromnm

unread,
Jun 14, 2010, 3:41:27 PM6/14/10
to Hobo Users
hobo/hobo/lib/hobo/dryml/dryml_builder.rb around line 114
seems to be where it's pulling in the imported taglibs. there's a
stub for module importing but maybe with a little more digging in that
area you might be able to do it without changing anything in hobo.

Tom Locke

unread,
Jun 16, 2010, 12:31:46 PM6/16/10
to hobo...@googlegroups.com
> Do you know how can I tell Hobo to look for taglib in hobo_openid gem
> directory?

IIRC we handled :plugin => "hobo as a special case. Loading other taglibs from gems is not supported yet.

However you can give template-dir="..." and provide the absolute path.

Tom

Joachim

unread,
Jun 18, 2010, 6:37:11 AM6/18/10
to hobo...@googlegroups.com
W dniu 16.06.2010 18:31, Tom Locke pisze:


Thank you Tom I'll try that.

Joachim

unread,
Jun 18, 2010, 2:29:58 PM6/18/10
to hobo...@googlegroups.com
W dniu 18.06.2010 12:37, Joachim pisze:

I tried


include_taglib "rapid_openid_user_pages", :template_dir =>
"#{File.expand_path(File.dirname(__FILE__))}/../taglibs"

I checked that

"#{File.expand_path(File.dirname(__FILE__))}/../taglibs"

returns proper path and file

rapid_openid_user_pages.dryml

exists in that directory. But I still get error

No such taglib: /path/to/application/users {:template_dir=>"users",
:src=>"rapid_openid_user_pages"}
/path/to/application/users/rapid_openid_user_pages.dryml

what am I doing wrong?

Joachim

unread,
Jun 18, 2010, 2:38:30 PM6/18/10
to hobo...@googlegroups.com
W dniu 18.06.2010 20:29, Joachim pisze:

I found taglib_filename in hobo-1.0.1/lib/hobo/dryml/taglib.rb and it
looks like it expects

template_dir =~ /^#{HOBO_ROOT}/

so I'll need to do something ugly (like path
"#{HOBO_ROOT}/../all/../the/../way/../to/../root/my/path" ) and it won't
work if gems are on fiffent drives on OS that uses letters to mark drives.

Shall I file a bug/ did I miss something/ any ideas for workaround?

Tom Locke

unread,
Jun 18, 2010, 4:59:07 PM6/18/10
to hobo...@googlegroups.com
> Shall I file a bug/ did I miss something/ any ideas for workaround?

Yeah sounds like a bug

Tom

Reply all
Reply to author
Forward
0 new messages