Reputation: 1984
I currently have a large gem installed that I only use part of. So, a few questions:
require
ing the part I need?Upvotes: 1
Views: 123
Reputation: 13541
It is only possible to install the gem in its entirety, i.e. everything declared in the gemspec.
If so, does that make more sense then installing the whole thing and only requireing the part I need?
Only requiring what you need is exactly what you're looking for. If the gem is declared in your Gemfile like this:
gem "your_gem", require: false
Then, it won't be automatically required in your app and therefore, won't be loaded into memory, which seems to be the effect you want. Then, just require only the parts you need.
Upvotes: 1