ddfreyne changed the topic of #nanoc to: 3.6.4 (may 29th) | 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
louquillio has quit [Remote host closed the connection]
koan has quit [Ping timeout: 240 seconds]
koan has joined #nanoc
louquillio has joined #nanoc
alerante has quit [Remote host closed the connection]
<skroon> hi ddfreyne
<ddfreyne> Hey
_br_- has quit [Remote host closed the connection]
_br_ has joined #nanoc
louquillio has quit [*.net *.split]
musicmatze has quit [*.net *.split]
smkelly has quit [*.net *.split]
francois2 has quit [*.net *.split]
louquillio has joined #nanoc
musicmatze has joined #nanoc
francois2 has joined #nanoc
smkelly has joined #nanoc
<skroon> how are you doing today ddfreyne ? how is your internet?
pavelkunc has joined #nanoc
jugglinmike has joined #nanoc
alerante has joined #nanoc
pavelkunc has quit [Quit: Leaving.]
pavelkunc has joined #nanoc
pavelkunc has quit [Quit: Leaving.]
alerante has quit [Remote host closed the connection]
alerante has joined #nanoc
pavelkunc has joined #nanoc
skroon_ has joined #nanoc
skroon has quit [Ping timeout: 264 seconds]
<skroon_> good evening all
<bobthecow> hallo skroon_
<skroon_> hi bobthecow
skroon_ is now known as skroon
pavelkunc has quit [Quit: Leaving.]
pavelkunc has joined #nanoc
Evolution has joined #nanoc
<Evolution> quick (stupid) question.
<Evolution> how does one use nanoc guard like nanoc watch? for live viewing?
<Evolution> guard init nanoc recompiles on change, but how do I run view this on :3000 for example?
<bobthecow> you have to run guard and nanoc server
<Evolution> outside of the guard shell prompt I'm left with then?
<Evolution> so guard & ; nanoc server ;
<Evolution> or am I making this harder than I need to?
<bobthecow> i'd go the other direction, personally.
<bobthecow> nanoc server &; guard
<Evolution> oh, okay.
<Evolution> yeah, there we go.
<Evolution> thanks
<bobthecow> since the "watch" functionality was offloaded to guard (where it's a better fit) there's no combined "compile and serve" anymore.
<jugglinmike> I have a rookie gem question here
<jugglinmike> I was to test out nanoc-guard, but I'm having trouble installing it
<jugglinmike> following the steps here: https://github.com/guard/guard-nanoc
<jugglinmike> using rbenv
<jugglinmike> I've installed via the former method (Gemfile), but I can't invoke "guard" from the command line
<jugglinmike> it's not found
<jugglinmike> here's my PATH: # /home/mike/.rbenv/shims:/home/mike/.rbenv/bin:/usr/local/bin:/usr/bin:/bin:/usr/games:/sbin:/usr/sbin #
<jugglinmike> # bundle exec guard # also fails
<gkarekinian> Did you run "rbenv rehash"?
<jugglinmike> as does # bundle exec guard-nanoc #
<jugglinmike> nope gkarekinian, will do
<jugglinmike> Same results
<jugglinmike> Maybe those instructions assume that I've already installed guard?
<jugglinmike> Should I add # gem "guard" # to my Gemfile?
<jugglinmike> looks like that isn't necessary https://github.com/cdlm/website-nanoc/blob/master/Gemfile
<cDlm> no, if you have guard-nanoc, omitting guard should be ok
<jugglinmike> hmm
<jugglinmike> I've also tried # bundle install --binstubs #, but it doesn't create a `bin/guard` executable
<bobthecow> jugglinmike: try adding guard explicitly to your Gemfile just for fun?
<jugglinmike> sure thing
<bobthecow> oh, also try `rbenv exec bundle install`
<bobthecow> to make sure the rbenv is properly taken into consideration
<bobthecow> (then rbenv rehash after that)
<jugglinmike> adding "guard" to my Gemfile creates a "bin/guard" executable
<jugglinmike> running *that* surfaces an entirely separate problem: "You're running a version of ruby with no Readline support
<jugglinmike> Please `gem install rb-readline` or recompile ruby --with-readline."
<jugglinmike> I'll try that second approach
<jugglinmike> okay, that second approach works (without explicitly adding "guard" to the Gemfile)
<jugglinmike> now I have to re-compile Ruby with readline support, I guess :/
<bobthecow> how did you end up with ruby sans-readline?
<jugglinmike> No idea. Ruby is not my thing (see above) :P
<jugglinmike> although it looks like I'm not alone: http://vvv.tobiassjosten.net/ruby/readline-in-ruby-with-rbenv/
<bobthecow> yeah, that'd prolly do it.
<bobthecow> i wonder why it wouldn't detect ubuntu's libreadline without explicitly configuring it.
darix has quit [Ping timeout: 246 seconds]
darix has joined #nanoc
darix has joined #nanoc
Evolution has left #nanoc ["http://www.bit-integrity.com"]
<jugglinmike> Hopefully this won't be a problem on Macs
<jugglinmike> bobthecow: all working now.. thanks!
<bobthecow> it's not a problem on macs.
<bobthecow> i've never had an issue with readline on my mac.
<jugglinmike> ok, cool
number-six has quit [Ping timeout: 246 seconds]
<jugglinmike> After the initial build, I'm spending ~4 seconds "Loading site data..." and ~1 second "Compiling site...". 5 Seconds is nothing to scoff at, but for my designer's sake I have to ask: is there anything I can do to optimize the "Loading site data..." step?
<jugglinmike> I suspect it's largely site-specific, so could you tell me a bit about what nanoc is doing in that step? Maybe I can optimize based on that
number-six has joined #nanoc
<bobthecow> how big is your site?
<bobthecow> how many content files, how many mb?
<jugglinmike> bobthecow: # find * content/* | wc -l # -> 2320
<bobthecow> how 'bout just `find content/ | wc -l` ?
<jugglinmike> bobthecow: 346
<jugglinmike> the directory is 2.0 MB in size
<bobthecow> okay.
<bobthecow> so four seconds is a bit on the long side, but not unheard of.
<bobthecow> basically what it's doing:
<bobthecow> finding all the files in all the data sources
<bobthecow> deciding whether they (or any of their dependencies) have changed since the last compile
<bobthecow> figuring out where they should be routed and how they should be compiled
<bobthecow> deciding whether other things have changed that would require a fresh compile (i.e. new / changed layouts, changed rules, changed settings, etc)
<bobthecow> i think that's about it.
<bobthecow> i would imagine the longest part of that is reading all the files and calculating hashes for them to decide whether they've changed.
<bobthecow> there are a lot of things you can do to optimize the compile part of the time it takes, but i'm not sure i know of anything specific you could do to optimize the "loading data" part.
<bobthecow> do you have any third-party data sources?
<jugglinmike> Yeah, I tried hard to optimize the compilation step, especially with regards to appending asset hashes as GET parameters for cache-busting
<jugglinmike> ooh, come to think of it
<jugglinmike> I think there might be one
<jugglinmike> Well
<jugglinmike> We have a "static" directory that loads binary assets
<jugglinmike> but I think we also do something fishy with external (ie over the web) data sources
<bobthecow> if you're doing that, there's your problem.
<bobthecow> i used to have one of those, but i implemented Nanoc::DataSource#sync so i could compile faster :)
<bobthecow> that's the one I use.
<bobthecow> basically you offload the time consuming bit to the `nanoc sync` command, and stash the result locally.
<jugglinmike> interesting! Let me see if I can verify that there is an external data source, and if it is causing this delay
<bobthecow> check data_sources in nanoc.yaml (or config.yaml if you're rockin' the old-school config file name)
<jugglinmike> It's worse than I thought
<jugglinmike> the external data source isn't actually modeled as a nanoc data source
<bobthecow> umm.
<jugglinmike> it's a request made in some random ruby script in our `lib/` directory
<bobthecow> oh, awesome.
<bobthecow> called in the preprocess block?
<jugglinmike> hmm, I'm not sure about that
<jugglinmike> I'm grepping around for where the file is required
<jugglinmike> because it's not encapsulated in a function--it's immediately executed when this helper file is loaded
<bobthecow> lib files are automatically required.
<jugglinmike> Does nanoc treat "lib/helpers_.rb"
<jugglinmike> oh
<jugglinmike> got it
<jugglinmike> So it just loads the data whenever it's includes, and makes it globally available :/
<jugglinmike> included*
<bobthecow> wheee!
<jugglinmike> haha
<bobthecow> yeah, that should prolly go into a data source.
<bobthecow> is it at least creating items with it?
<jugglinmike> nope. Arrays
<bobthecow> or is the site just accessing the global data whilst compiling.
<bobthecow> ugh.
<bobthecow> so it's not even marking the dependency graph as dirty when it changes.
<bobthecow> you should prolly fix that.
<jugglinmike> the good news is that I can stub it out easily (by defining empty arrays), and the site compilation time goes from 5s to 3s
<jugglinmike> so at least I know this will yield the results I want
<jugglinmike> in addition to being cleaner
<jugglinmike> next step: learn how to define external data sources in Nanoc
<jugglinmike> and wrap this EventBrite gem
<bobthecow> and have the added bonus of actually recompiling bits of your site that depend on that data when said data changes :)
<bobthecow> check that github data source i posted.
<bobthecow> the basic dance is:
<jugglinmike> oh wow! This won't be so bad
<bobthecow> define a sync method for grabbing data from the api and squishing it into a local store of some sort. i chose a yaml file.
<jugglinmike> .gitignore that file
<jugglinmike> ?
<bobthecow> then define an items method that reads the yaml file and returns a list of Nanoc::Item instances
<bobthecow> or commit, whichever.
<bobthecow> if it's changing often, or if you can put a `nanoc sync` call into your deploy workflow somewhere and not worry about the local version, i would gitignore it.
_whitelogger has joined #nanoc
<jugglinmike> yes
<jugglinmike> oh, good to know about static
<bobthecow> then you should be able to simply remove the static.rb file from lib and your site will continue to compile.
<bobthecow> depending, of course, on whether your static.rb is compatible with the core one.
<bobthecow> but it probably is, if it's the one that was floating around a while back.
pavelkunc1 has joined #nanoc
pavelkunc has quit [Ping timeout: 264 seconds]
pavelkunc1 has quit [Client Quit]
alerante has quit [Remote host closed the connection]
alerante has joined #nanoc
<jugglinmike> thanks again bobthecow :)
<bobthecow> no problem.
jugglinmike has quit [Quit: Leaving.]