Module: Toys::StandardMixins::Gems::ClassMethods

Defined in:
core-docs/toys/standard_mixins/gems.rb

Overview

This module extends the tool class when you include the Gems mixin, so that the gems and gem directives defined in this module are available.

Defined in the toys-core gem

Instance Method Summary collapse

Instance Method Details

#gem(name, *requirements, **options) ⇒ :activated, ...

Activate the given gem. If it is not present, attempt to install it (or inform the user to update the bundle).

Parameters:

  • name (String) —

    Name of the gem

  • requirements (String...) —

    Version requirements

  • options (keywords) —

    Additional options to pass to the Utils::Gems constructor

Returns:

  • (:activated) —

    if the gem was activated

  • (:installed) —

    if the gem was installed and activated

  • (false) —

    if the gem had already been activated

Raises:

  • (ActivationFailedError) —

    if activation or install failed



117
118
119
# File 'core-docs/toys/standard_mixins/gems.rb', line 117

def gem(name, *requirements, **options)
  # Source available in the toys-core gem
end

#gems ⇒ Toys::Utils::Gems

Returns a tool-wide instance of Utils::Gems.

Returns:



98
99
100
# File 'core-docs/toys/standard_mixins/gems.rb', line 98

def gems
  # Source available in the toys-core gem
end