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
VitamineD has joined #nanoc
<bobthecow> tom[]: hmm. that's interesting. i'd ask ddfreyne :)
<tom[]> bobthecow: i think you effectively already did ask ddfreyne
jugglinmike has quit [Quit: Leaving.]
Jutah has quit [Quit: Connection closed for inactivity]
relix has joined #nanoc
<ddfreyne> tom[]: Oh, weird.
<ddfreyne> tom[]: I think that message is not supposed to be there at all...
<ddfreyne> tom[]: Yeah, this check https://github.com/nanoc/nanoc/blob/release-3.6.x/lib/nanoc/cli/error_handler.rb#L302-L304 should not be there. Oops :)
<ddfreyne> Not sure why it says 42 though.
<ddfreyne> I’d imagine it should say 40, because the backtrace size is 39 and the calculation is 39 - (-1) = 40
<ddfreyne> tom[]: Anyway, the trace you see in crash.log is the full one, even if it says some lines are omitted ;)
VitamineD has quit [Quit: Leaving.]
<tom[]> ddfreyne: i had been hoping there was more with maybe a clue to the problem
<tom[]> anyway, i got it sorted
FunkyPenguin has joined #nanoc
forcev has quit [Ping timeout: 240 seconds]
<ddfreyne> tom[]: What more did you expect to find?
<ddfreyne> (or want to)
<tom[]> ddfreyne: hmm. now that i review the stack trace, item 0. does point to the line of my content that had the error. i'm not sure i noticed that yesterday
<tom[]> that, together with the error message, should have been sufficient.
<tom[]> for a competent programmer, it would have been
<ddfreyne> tom[]: The first few lines of the stack trace are enough in 99% of the cases, in my experience. That's why the CLI cuts off after 10 lines
<ddfreyne> The competent bit is something you said yourself 0:)
jugglinmike has joined #nanoc
relix has quit [Quit: Textual IRC Client: www.textualapp.com]
Jutah has joined #nanoc
boutil has joined #nanoc
jd_ has joined #nanoc
<jd_> hi
<ddfreyne> Hi
<jd_> I'd like to edit my articles (I guess during preprocess time). I use slim (template engine) and like to automagically add markdown: chunks in between my p tags, so that I can write markdownified paragraphs without ever typing the markdown: prefix
<jd_> I matched lines correctly, but the preprocessor seems to go in an infinite loop because I File.open and save the articles
<jd_> is there a good way to do this with nanoc?
<ddfreyne> jd_: Ahh, the preprocessor is not intended to modify the files on disk, but rather just in memory
<jd_> yep, I figured it out :p
<jd_> Am I heading to a pre-preprocessor solution? (grunt/guard/anything)
<jd_> (on peut parler en français si jamais ^^)
number-six has quit [Remote host closed the connection]
<ddfreyne> jd_: You can either modify the files in a separate script, or modify the item contents in-memory during preprocess
<jd_> in memory could be fine actually
<jd_> a gsub would do then?
<ddfreyne> jd_: Yup (gsub! probably)
<ddfreyne> jd_: I don't speak French very well (and this is an English-speaking channel anyway)
<jd_> (all right, I always assumed you were French)
<ddfreyne> I am Belgian but speak mostly Dutch (Flemish) and now I live in Berlin and speak English and German most of th etime :P
number-six has joined #nanoc
<jd_> ok, what would be the best way to access the in memory representation of an article then? I remembered seeing a deprecation message yesterday about the :file attribute
<ddfreyne> jd_: a Nanoc::Item has .content, .attributes and .identifier that you can change
<jd_> excellent
<ddfreyne> .raw_content, rather
<ddfreyne> (a String)
<ddfreyne> @items['/moo/'].raw_content = 'ohai'
alerante has quit []
<jd_> it seems to work pretty well :) just have to figure how to inject \n and \s chars in ruby
<ddfreyne> jd_: Literal \n or do you mean a newline?
<jd_> a newline
<ddfreyne> Not sure what \s is...
<jd_> no literals
<ddfreyne> jd_: a double-quoted string that contains \n will have a newline
<ddfreyne> "foo\nbar" <- foo newline bar
<ddfreyne> 'foo\nbar' <- literal \n
<jd_> a space (I said \s because that's how I matched them to begin with, but actually, I want to gsub some chunk with another containing both a newline and some spaces)
<jd_> thank you very much
<ddfreyne> you're welcome
<jd_> that's very excellent: Slim markup with markdown paragraphs :)
<jd_> I like it, thank you ddfreyne and nanoc
alerante has joined #nanoc
VitamineD has joined #nanoc
<ddfreyne> :)
<bobthecow> ddfreyne: have you played with Objective-Smalltalk at all?
<ddfreyne> bobthecow: Nope
<ddfreyne> I haven't used Cocoa in many years and I'm done with Smalltalk for the time being :P
<bobthecow> looks interesting.
<bobthecow> ^ that, specifically, is interesting.
<ddfreyne> Nice :)
<ddfreyne> At SoundCloud we're identifying almost everything with URIs. It is so much nicer.
<bobthecow> i like the idea of a language that reasons about things internally as URIs as well.
<bobthecow> a local variable is just a scheme relative uri :)
<ddfreyne> Yup
VitamineD has quit [Ping timeout: 240 seconds]
relix has joined #nanoc
VitamineD has joined #nanoc
VitamineD has quit [Quit: Leaving.]
VitamineD has joined #nanoc
<jd_> ddfreyne, if you ever get the time to check this out, I wonder about https://github.com/slim-template/slim/issues/391#issuecomment-17386654
<jd_> the guy, momolog, talks about a "filter" keyword in nanoc, but my nanoc (last version) does not know about it
<jd_> so I wonder if it is something he coded, that is a custom method taking the filter as an argument, or if it was available at some point then deprecated/removed…
number-six has quit [Remote host closed the connection]
number-six has joined #nanoc
<VitamineD> jd_: you need the filtering helper
<jd_> VitamineD, thx
<jd_> In the mean time, I solved my problem by leveraging the engine backing my would-be filter directly in the preprocessor (in my case, Kramdown::Document)
<jd_> in fact, it's perfect, since I don't want to make an explicit call to that engine/filter to begin with :)
<jd_> but good to know, thx
<bobthecow> jd_: yeah, that's the preferred way. the filtering helper works, but it's less nanocy.
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]