meta_package_manager.managers.gem

class meta_package_manager.managers.gem.Gem[source]

Bases: meta_package_manager.base.PackageManager

platforms = frozenset({'linux', 'macos', 'windows'})
name = 'Ruby Gems'
requirement = '2.5.0'
global_args = ['--quiet']
get_version()[source]

Fetch version from gem --version output.

Raw CLI output samples:

$ gem --version
3.0.3
cli_path

Fully qualified path to the package manager CLI.

Automaticaly search the location of the CLI in the system.

Returns None if CLI is not found or is not a file.

installed

Fetch installed packages from gem list output.

Raw CLI output samples:

$ gem list

*** LOCAL GEMS ***

bigdecimal (default: 1.4.1)
bundler (default: 1.17.2)
CFPropertyList (2.3.6)
cmath (default: 1.0.0)
csv (default: 3.0.9)
date (default: 2.0.0)
fileutils (1.4.1, default: 1.1.0)
io-console (0.5.6, default: 0.4.7)
ipaddr (default: 1.2.2)
molinillo (0.5.4, 0.4.5, 0.2.3)
nokogiri (1.5.6)
psych (2.0.0)
rake (0.9.6)
rdoc (4.0.0)
sqlite3 (1.3.7)
test-unit (2.0.0.0)
search(query, extended, exact)[source]

Fetch matching packages from gem search output.

$ gem search python --versions --quiet
at_coder_friends-generator-python_ref (0.2.0)
bee_python (0.2.3)
dependabot-python (0.117.5)
logstash-filter-python (0.0.1 java)
python (0.0.1)
python-generator (1.1.0)
python_with_git_test (2.499.8)
rabbit-slide-niku-erlangvm-for-pythonista (2015.09.12)
RubyToPython (0.0)
$ gem search python --versions --exact --quiet
python (0.0.1)
outdated

Fetch outdated packages from gem outdated output.

Raw CLI output samples:

$ gem outdated
did_you_mean (1.0.0 < 1.0.2)
io-console (0.4.5 < 0.4.6)
json (1.8.3 < 2.0.1)
minitest (5.8.3 < 5.9.0)
power_assert (0.2.6 < 0.3.0)
psych (2.0.17 < 2.1.0)
upgrade_cli(package_id=None)[source]

Return a bash-compatible full-CLI to upgrade a package.

upgrade_all_cli()[source]

Return a bash-compatible full-CLI to upgrade all packages.

cleanup()[source]

Run gem cleanup CLI.

Raw CLI output samples:

$ gem cleanup
Cleaning up installed gems...
Attempting to uninstall test-unit-3.2.9
Unable to uninstall test-unit-3.2.9:
    Gem::FilePermissionError: You don't have write permissions                 for the /Library/Ruby/Gems/2.6.0 directory.
Attempting to uninstall did_you_mean-1.3.0
Unable to uninstall did_you_mean-1.3.0:
    Gem::FilePermissionError: You don't have write permissions                 for the /Library/Ruby/Gems/2.6.0 directory.
Clean up complete