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
pavelkunc has quit [Quit: Leaving.]
louquillio has joined #nanoc
<bobthecow> jugglinmike: what do you mean?
<jugglinmike> bobthecow: yup, but I think I figured it out. Thanks for getting back to me, though!
<bobthecow> just lazily does the `require 'foo'` rather than doing it when the class is defined.
<bobthecow> that way you don't have to install every dependency of every filter in order to run nanoc.
<bobthecow> that should be going away in 4.x, because all the filters will be shipped standalone.
<jugglinmike> bobthecow: This is just general Ruby (unrelated to nanoc), but do you know why two strings that appear identical would not be equal?
<jugglinmike> bobthecow: more specifically
<jugglinmike> I've iterated through each of their characters
<jugglinmike> and none of them match
<jugglinmike> but each appear to have the same string representation..
<jugglinmike> I've even tried comparing the result of passing each to String
<jugglinmike> i.e.
<bobthecow> a BOM?
<jugglinmike> String(a) == String(b)
<jugglinmike> bobthecow: I've heard that term before, but I don't understand it.
<bobthecow> it's a zero width magic "character" at the start of a string that tells the system what order the bytes come in (i.e. little- or big-endian)
<jugglinmike> hmmm.. does it effect the strings length?
<jugglinmike> string's*
VitamineD has quit [Quit: VitamineD]
<bobthecow> i don't know.
<bobthecow> you could try something like a.include?(b) || b.include?(a)
<jugglinmike> woa, this is a little funky
<bobthecow> "none of them match" would seem to indicate that it's something at the start of one of the strings.
<jugglinmike> I'm working with nanoc's Mustache filter, and it may be related to that
<bobthecow> because getting one string off by one would make the whole string not match.
<jugglinmike> yeah, except now I'm printing out each character from each string
<bobthecow> which is why i'd guess BOM.
<jugglinmike> here's the weird thing
<jugglinmike> One of the string is the block specified to a Mustache "lambda"
<jugglinmike> when I `puts value_passed_to_lambda`
<jugglinmike> I see, in this case, "community"
<jugglinmike> but when I iterate over it
<jugglinmike> as in
<jugglinmike> `value_passed_to_lambda.split('').each_with_index`
<jugglinmike> I see "{", "{", "i", "t", "e", "m", ".", "p", "a", "t", "h", "}", "}"
<bobthecow> are you sure it's a string?
<bobthecow> puts value_passed_to_lambda.class
<jugglinmike> oh I think I know what's going on
<jugglinmike> I'm debugging *through* the template
<jugglinmike> so when I "print" a value, it looks like the interpolated value
<jugglinmike> but that's only because the template gets rendered after this function executes
<jugglinmike> I've been unable to use puts directly because something about the Mustache rendering process sets the security level very high, and invoking `puts` raises a SecurityError
<jugglinmike> This means the function cannot operate on the actual value...
<jugglinmike> I may have to use Handlebars instead.. I think that has better support for helpers
<bobthecow> you should check out pry.
<bobthecow> you can stop and debug interactively while executing code.
<bobthecow> require 'pry'; binding.pry
<bobthecow> acts like `debugger;` in a browser.
<jugglinmike> ooh thanks bobthecow!
ldk has quit [Quit: WeeChat 0.4.2]
ldk has joined #nanoc
jugglinmike has quit [Quit: Leaving.]
ldk has left #nanoc ["WeeChat 0.4.2"]
relix has joined #nanoc
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
koan has quit [*.net *.split]
relix has joined #nanoc
pavelkunc has joined #nanoc
koan has joined #nanoc
VitamineD has joined #nanoc
Keltia_ is now known as Keltia
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
relix has joined #nanoc
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
relix has joined #nanoc
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jugglinmike has joined #nanoc
<jugglinmike> I'm trying to add a .yaml file to my content/ directory, but nanoc fails while loading the site data with "TypeError: can't convert Array into Hash". Is this unsupported, or should I be looking for a bug in my own code?
<jugglinmike> hmm, it looks like nanoc assumes the "meta" variable to be an object https://github.com/nanoc/nanoc/blob/aea190284718ffc7a5647bb9890c6c89c37edb2d/lib/nanoc/data_sources/filesystem.rb#L102
<jugglinmike> but it won't be if the yaml content defines an array
<jugglinmike> If I write the yaml to define an object with an array attribute, nanoc throws a different error: "NoMethodError: undefined method `[]' for nil:NilClass" from this line: https://github.com/nanoc/nanoc/blob/aea190284718ffc7a5647bb9890c6c89c37edb2d/lib/nanoc/base/compilation/compiler.rb#L198