New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
backport of Nanoc::CLI.after_setup functionality #407
backport of Nanoc::CLI.after_setup functionality #407
Conversation
|
||
# Require | ||
if defined?(Bundler) | ||
Bundler.require(:default) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you undo the changes to bin/nanoc
? These changes are not required for the after_setup_procs
feature to work. I’d like to limit the changes made to nanoc 3.x as much as possible to prevent difficult merges later on.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ddfreyne well I first tried with the original bin/nanoc but the weird thing is that it does not work as expected. I am maybe doing something wrong but when I use the original/nanoc my plugin is not loaded and therefore my custom plugin's command is not showing up in the list of available commands (when doing 'nanoc --help'), also I cannot execute the command neither.
I guess I still need the Bundler.require(:default) after the require 'bundler/setup'? Should not be something like this?
# Try loading bundler if it's possible
begin
require 'bundler/setup'
Bundler.require(:default)
rescue LoadError
# no problem
end
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
👍 apart from remarks. |
Looks good. Will run some tests locally to make sure this doesn’t break anything, but if it doesn’t, I’ll merge. |
Concerning the test, in nanoc-cli you have one test concerning the after_setup that maybe we should also add to the merge: https://github.com/nanoc/nanoc-cli/blob/8e49e1907741c54bcd053de8b7ae4eb732f82d0d/test/cli/test_cli.rb#L105 |
Yup, would be great if you could move that over too. |
ok, I'm running the test too before commiting |
Backport Nanoc::CLI.after_setup functionality from nanoc 4.0
Cool stuff. |
This commit backport the useful Nanoc::CLI.after_setup functionality from Nanoc 4.x to Nanoc 3.x
This backport is really useful to initiate the migration from Nanoc 3.x to Nanoc 4.x since developers can already start packaging their plugins following the Nanoc 4.x packaging style!
For instance, the plugin nanoc-photomator is packaged as follow for Nanoc 3.x