Gem Operations

Manage Ruby gem packages. (see https://rubygems.org/ )

gem.packages

Add/remove/update gem packages.

gem.packages(packages=None, present=True, latest=False)
  • packages: list of packages to ensure
  • present: whether the packages should be installed
  • latest: whether to upgrade packages without a specified version
Versions:
Package versions can be pinned like gem: <pkg>:<version>.

Example:

# Note: Assumes that 'gem' is installed.
gem.packages(
    name='Install rspec',
    packages=['rspec'],
)