ddfreyne changed the topic of #nanoc to: 3.6.7 (dec 9th) | web http://nanoc.ws/ | repo http://bit.ly/XE6e3G | issues http://bit.ly/VfXaSV | forum http://ho.io/n-discuss | irclog http://irclog.whitequark.org/nanoc
alerante_ has joined #nanoc
alerante has quit [Ping timeout: 240 seconds]
dkm has quit [Ping timeout: 240 seconds]
dkm has joined #nanoc
dkm has quit [Ping timeout: 240 seconds]
dkm has joined #nanoc
jugglinmike has quit [Quit: Leaving.]
louquillio has quit [Remote host closed the connection]
dkm has quit [Ping timeout: 240 seconds]
dkm has joined #nanoc
dkm has quit [Ping timeout: 240 seconds]
dkm has joined #nanoc
dkm has quit [Ping timeout: 240 seconds]
dkm has joined #nanoc
louquillio_ has joined #nanoc
relix has joined #nanoc
VitamineD has quit [Quit: Leaving.]
VitamineD has joined #nanoc
<tom[]> why would compilation with guard fail when it does not with nanoc? LoadError: cannot load such file -- nanoc/toolbox
motley has quit [Quit: leaving]
motley has joined #nanoc
motley_ has joined #nanoc
motley_ has quit [Client Quit]
motley has quit [Client Quit]
motley has joined #nanoc
jugglinmike has joined #nanoc
<tom[]> i am really struggling. maybe ruby ignorance or nanoc. or both
<tom[]> i need to cache some metadata for each item. metadata that i can use in erb bits and pieces
<bobthecow> tom[]: please to be giving examples and not vague statements :)
<tom[]> for each item i need a few strings (or other values) that can be figured out from the item identifier, attributes, etc
<tom[]> i want to do all the figuring only once for each item and save the strings for use in views
<tom[]> for example
<tom[]> the name of my sidebar nav partial is either in a yaml heading or can be derived from item id
<bobthecow> do it in preprocessing and set it in the item's attributes.
<tom[]> i could write once method for each such metadatum but that is not at all dry
<bobthecow> so that you always grab it out of the attributes.
<tom[]> i would love to
<bobthecow> that way nanoc can track things properly.
<tom[]> got a pointer to a howto?
<tom[]> i think i found it
<bobthecow> yep, that's the one.
<bobthecow> i usually make a helper method in lib somewhere and call it in preprocess to keep things cleaner.
<bobthecow> you can just loop over items and do whatever you want to them.
<bobthecow> @items.each { |item| item[:someattr] ||= defaults[:someattr] }
<tom[]> thank you!
<tom[]> i still can't write that kind of ruby
<bobthecow> basically, you could do this lots of ways, but the dumbest way (actually pre-filling all the attributes you'll need on items) turns out to be the best way for nanoc.
<bobthecow> because it tracks dependencies.
<bobthecow> some people do crazy things with caching, or memoizing, or any number of things...
<tom[]> this is what i was trying to do but i got the Frozen error
VitamineD has quit [Quit: Leaving.]
<bobthecow> but just preprocessing everything and storing in the actual attributes is the way to go.
<bobthecow> yeah, you get frozen errors every time you do anything *after* preprocessing.
<bobthecow> if you try to change items while compiling, nanoc has no way of tracking dependencies.
<bobthecow> but during preprocessing is a free-for-all.
<bobthecow> change them however you want :)
<tom[]> the error message was remarkably comprehensive, explaining about the need for compiler optimization
VitamineD has joined #nanoc
<tom[]> thanks again, bobthecow. preprocess is the balls!
<bobthecow> no problem :)
<tom[]> any idea what using guard gives "LoadError: cannot load such file -- nanoc/toolbox" while running the nanoc command works normally?
<tom[]> s/what/why/
<bobthecow> nope, but ddfreyne might.
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
VitamineD has quit [Read error: Connection reset by peer]
dkm_ has joined #nanoc
dkm has quit [*.net *.split]
dkm_ is now known as dkm
louquillio has joined #nanoc
louquillio_ has quit [*.net *.split]
gregkare has quit [*.net *.split]