开发者

How do you specify a gem's dependency on a unix program, e.g. fmt or tidy?

开发者 https://www.devze.com 2023-02-12 08:19 出处:网络
How do you specify in a gem\'s gemspec that the gem assumes that \"fmt\" or \"tidy\" is installed on the system? These are uni开发者_StackOverflow中文版x tools and not Ruby gems.This is another place

How do you specify in a gem's gemspec that the gem assumes that "fmt" or "tidy" is installed on the system? These are uni开发者_StackOverflow中文版x tools and not Ruby gems.


This is another place where rubygems just lacks...

A few workarounds:

put a message about it in the post_install message

check for it at runtime

check for it at install time by using a fake mkrf_conf.rb http://en.wikibooks.org/wiki/Ruby_Programming/RubyGems#How_to_install_different_versions_of_gems_depending_on_which_version_of_ruby_the_installee_is_using


You can use the requirements attribute. It doesn't actually enforce the dependency, but it looks like the right place to put the information.


Put it in the README and hope people read it. ;)

0

精彩评论

暂无评论...
验证码 换一张
取 消