Skip to content

Adapt Guardfile to support nanoc-cli >= 4.14.7 by handling removed `r…#38

Merged
rubensworks merged 3 commits into
rubensworks:masterfrom
Michiel-VandeVelde:guard-nanoc-compatibility
Mar 26, 2026
Merged

Adapt Guardfile to support nanoc-cli >= 4.14.7 by handling removed `r…#38
rubensworks merged 3 commits into
rubensworks:masterfrom
Michiel-VandeVelde:guard-nanoc-compatibility

Conversation

@Michiel-VandeVelde
Copy link
Copy Markdown
Contributor

bundle exec guard crashes on startup because guard-nanoc 2.1.x calls FileActionPrinter.new(reps: []), but nanoc-cli 4.14.7 removed that parameter from initialize.

This patches the Guardfile template to make FileActionPrinter#initialize accept and ignore the stale keyword argument, making bundle exec guard work again without requiring a downgrade of either gem.

@rubensworks
Copy link
Copy Markdown
Owner

I've added CI on master with the last commit.
Could you rebase onto master?
Then we can easily validate this change.

Instead of patching the code like this, couldn't we just bump guard-nanoc to a more recent version?
I suspect @jitsedesmet may also have some thoughts on this.

(While I would prefer backwards-compatibility with Ruby 3.2, if it's too hard to guarantee, it's not the end of the world IMO)

@Michiel-VandeVelde Michiel-VandeVelde force-pushed the guard-nanoc-compatibility branch from 175b0ba to 1d7a9e4 Compare March 20, 2026 09:11
@rubensworks
Copy link
Copy Markdown
Owner

The CI does not seem to pass (it also doesn't pass for these versions on master).
But maybe there are different parallel issues.

What Ruby version are you using?

@jitsedesmet, is this the same problem you were running into?

@jitsedesmet
Copy link
Copy Markdown
Contributor

Yes, the build.yml and publish.yml should be upgarded to ruby-version: '4.0'. I also did not need to alter the build file.

@jitsedesmet
Copy link
Copy Markdown
Contributor

jitsedesmet commented Mar 20, 2026

My changes were: adding gem "csv", "~> 3.3" to Gemfile at the end. Changing line 17 of config.ru to run Rack::Files.new("output") (and running bundle update using ruby 4)

@rubensworks
Copy link
Copy Markdown
Owner

@jitsedesmet Your change sounds less invasive. Want to make a PR for it?

@jitsedesmet
Copy link
Copy Markdown
Contributor

I lied. This is something else, sorry (just tested locally)

@jitsedesmet
Copy link
Copy Markdown
Contributor

jitsedesmet commented Mar 20, 2026

Aha, but DO we really need this fix?
I feel like it's a mistake on nanoc-cli their part? https://rubygems.org/gems/nanoc-cli

They updated their package (March 7) and introduced a breaking change on a patch. Maybe we should just pin the version? Or flag the mistake on their part?

@jitsedesmet
Copy link
Copy Markdown
Contributor

After looking for 15 more minutes. Idk when this broke. But I think the approach here is valid?

@rubensworks
Copy link
Copy Markdown
Owner

My changes were: adding gem "csv", "~> 3.3" to Gemfile at the end. Changing line 17 of config.ru to run Rack::Files.new("output") (and running bundle update using ruby 4)

@jitsedesmet Could you open a PR with these changes? I assume this will fix the CI.

I suggest to put the PR on hold until that one is merged, as there seem to be different problems.

@jitsedesmet
Copy link
Copy Markdown
Contributor

@Michiel-VandeVelde I think you can merge with main since my issue (distinct from yours) has been merged

@Michiel-VandeVelde Michiel-VandeVelde force-pushed the guard-nanoc-compatibility branch from 1d7a9e4 to ae809df Compare March 26, 2026 08:21
@rubensworks rubensworks merged commit d2fa5c5 into rubensworks:master Mar 26, 2026
8 checks passed
@rubensworks
Copy link
Copy Markdown
Owner

Excellent, all seems to work now, thanks @Michiel-VandeVelde!
Released as 3.6.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants