guard / guard-nanoc

A Guard for nanoc
39 stars 9 forks source link

broken with nanoc 4.3.8 #31

Closed whitequark closed 7 years ago

whitequark commented 7 years ago

First, Nanoc::Extra::Pruner got renamed to Nanoc::Pruner, which I've addressed here: https://github.com/whitequark/guard-nanoc/commit/3148c9c68934fbee2859aa801158c31d8e075f94.

But then it still crashes:

Message:

NoMethodError: undefined method `[]' for #<Nanoc::Int::Site:0x0056018373b240>

Compilation stack:

  (empty)

Stack trace:

  0. /var/lib/gems/2.3.0/gems/nanoc-4.3.8/lib/nanoc/base/services/pruner.rb:29:in `run'
  1. /home/whitequark/.bundle/ruby/2.3.0/guard-nanoc-3148c9c68934/lib/guard/nanoc.rb:83:in `prune'
  2. /home/whitequark/.bundle/ruby/2.3.0/guard-nanoc-3148c9c68934/lib/guard/nanoc.rb:65:in `block in recompile'
  3. /home/whitequark/.bundle/ruby/2.3.0/guard-nanoc-3148c9c68934/lib/guard/nanoc.rb:62:in `chdir'
  4. /home/whitequark/.bundle/ruby/2.3.0/guard-nanoc-3148c9c68934/lib/guard/nanoc.rb:62:in `recompile'
  5. /home/whitequark/.bundle/ruby/2.3.0/guard-nanoc-3148c9c68934/lib/guard/nanoc.rb:54:in `block in recompile_in_subprocess'
  6. /home/whitequark/.bundle/ruby/2.3.0/guard-nanoc-3148c9c68934/lib/guard/nanoc.rb:54:in `fork'
  7. /home/whitequark/.bundle/ruby/2.3.0/guard-nanoc-3148c9c68934/lib/guard/nanoc.rb:54:in `recompile_in_subprocess'
  8. /home/whitequark/.bundle/ruby/2.3.0/guard-nanoc-3148c9c68934/lib/guard/nanoc.rb:19:in `start'
  9. /home/whitequark/.gem/ruby/2.3.0/gems/guard-2.14.0/lib/guard/runner.rb:82:in `block in _supervise'
  ... 30 more lines omitted. See full crash log for details.

I don't have time right now to figure out why.

denis-soundcloud commented 7 years ago

Oh, strange… the refactoring inside Nanoc (creating Nanoc::Pruner) was not intended to be a breaking one. I’ll release 4.3.9 which adds Nanoc::Extra::Pruner as an alias.

denisdefreyne commented 7 years ago

Nanoc::Extra::Pruner alias is added in https://github.com/nanoc/nanoc/commit/14f662e9f1a58c3d49195c16511146a6289a8a1f.

whitequark commented 7 years ago

What about the other bug?

denisdefreyne commented 7 years ago

Working on it!

whitequark commented 7 years ago

@ddfreyne Looks like the culprit is this commit, which broke the API contract of Pruner: https://github.com/nanoc/nanoc/commit/86291cf7f27622916582e4aaace738bf9ef2b19f#diff-e4b217529af19acd7c22d317b1731556R186. So maybe it wasn't a good idea to expose it under Extras::Pruner after all.

denisdefreyne commented 7 years ago

Yep, just figured that out. The good news is that Pruner is part of a private api (# @api private), and that the compiler now takes care of pruning (which makes much more sense). The fix for guard-nanoc (which I’m working on right now) is to not prune explicitly.

denisdefreyne commented 7 years ago

Fixed (along with some other issues) in the newly released guard-nanoc 2.1.1.

whitequark commented 7 years ago

Thanks!