I wrote a gem with a certain array of dependencies, and some of them I'd like not to have implicitly required when bundled into another project. An example is the uuidtools gem, which I only want to require in files using it.
gem.add_dependency("uuidtools",["=2.1.3"], :require => false)
This syntax is false, since :require => false is unexpected there, but this more or less sums up what I would like to do with it. Can someone help me on this?
Gems specified in an engines gemspec file already do need to be explicitly required, by default. From the official documentation - Note that if you want to immediately require dependencies when the engine is required, you should require them before the engine's initialization
. In your case, you should be able to get by with something like gem.add_dependency 'uuidtools', '2.1.3'
in your gemspec file, and requires in the relevant locations.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With