Class: Toys::Utils::Gems
- Inherits:
-
Object
- Object
- Toys::Utils::Gems
- Defined in:
- core-docs/toys/utils/gems.rb
Overview
Defined in the toys-core gem
A helper class that activates and installs gems and sets up bundler.
This class is not loaded by default. Before using it directly, you should
require "toys/utils/gems"
Defined Under Namespace
Classes: ActivationFailedError, AlreadyBundledError, BundleNotInstalledError, BundlerFailedError, GemfileNotFoundError, GemfileUpdateNeededError, IncompatibleToysError, InstallFailedError
Constant Summary collapse
- DEFAULT_GEMFILE_NAMES =
The gemfile names that are searched by default.
[".gems.rb", "gems.rb", "Gemfile"].freeze
Class Method Summary collapse
-
.activate(name, *requirements) ⇒ :activated, ...
Activate the given gem.
Instance Method Summary collapse
-
#activate(name, *requirements) ⇒ :activated, ...
Activate the given gem.
-
#bundle(groups: nil, gemfile_path: nil, search_dirs: nil, gemfile_names: nil, retries: nil) ⇒ :setup, ...
Search for an appropriate Gemfile, and set up the bundle.
-
#initialize(on_missing: nil, on_conflict: nil, terminal: nil, input: nil, output: nil, suppress_confirm: nil, default_confirm: nil) ⇒ Gems
constructor
Create a new gem activator.
Constructor Details
#initialize(on_missing: nil, on_conflict: nil, terminal: nil, input: nil, output: nil, suppress_confirm: nil, default_confirm: nil) ⇒ Gems
Create a new gem activator.
137 138 139 140 141 142 143 144 145 |
# File 'core-docs/toys/utils/gems.rb', line 137 def initialize(on_missing: nil, on_conflict: nil, terminal: nil, input: nil, output: nil, suppress_confirm: nil, default_confirm: nil) # Source available in the toys-core gem end |
Class Method Details
.activate(name, *requirements) ⇒ :activated, ...
Activate the given gem. If it is not present, attempt to install it (or inform the user to update the bundle).
105 106 107 |
# File 'core-docs/toys/utils/gems.rb', line 105 def self.activate(name, *requirements) # Source available in the toys-core gem end |
Instance Method Details
#activate(name, *requirements) ⇒ :activated, ...
Activate the given gem. If it is not present, attempt to install it (or inform the user to update the bundle).
160 161 162 |
# File 'core-docs/toys/utils/gems.rb', line 160 def activate(name, *requirements) # Source available in the toys-core gem end |
#bundle(groups: nil, gemfile_path: nil, search_dirs: nil, gemfile_names: nil, retries: nil) ⇒ :setup, ...
Search for an appropriate Gemfile, and set up the bundle.
187 188 189 190 191 192 193 |
# File 'core-docs/toys/utils/gems.rb', line 187 def bundle(groups: nil, gemfile_path: nil, search_dirs: nil, gemfile_names: nil, retries: nil) # Source available in the toys-core gem end |