Is there a way to configure a gem's gemspec to print an important informational message right after someone downloads and installs the gem using gem install
?
Yes, use post_install_message
in the gemspec (docs).
You can see how HTTParty does it in its gemspec.
来源:https://stackoverflow.com/questions/6543001/is-there-a-way-to-print-a-message-after-a-user-installs-a-ruby-gem