Class: Appraisal::GemManager::Base
- Inherits:
-
Object
- Object
- Appraisal::GemManager::Base
- Defined in:
- lib/appraisal/gem_manager/base.rb
Overview
Abstract base class defining the interface for gem managers. Subclasses must implement all public methods.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#gemfile_path ⇒ Object
readonly
Returns the value of attribute gemfile_path.
-
#project_root ⇒ Object
readonly
Returns the value of attribute project_root.
Instance Method Summary collapse
-
#available? ⇒ Boolean
Check if the gem manager is available on the system.
-
#initialize(gemfile_path, project_root) ⇒ Base
constructor
A new instance of Base.
-
#install(options = {}) ⇒ void
Install gems for the given gemfile.
-
#name ⇒ String
Name of the gem manager for display.
-
#update(gems = []) ⇒ void
Update gems (all or specific gems).
-
#validate_availability! ⇒ void
Validate that the gem manager is available, raising an error if not.
Constructor Details
#initialize(gemfile_path, project_root) ⇒ Base
Returns a new instance of Base.
12 13 14 15 |
# File 'lib/appraisal/gem_manager/base.rb', line 12 def initialize(gemfile_path, project_root) @gemfile_path = gemfile_path @project_root = project_root end |
Instance Attribute Details
#gemfile_path ⇒ Object (readonly)
Returns the value of attribute gemfile_path.
8 9 10 |
# File 'lib/appraisal/gem_manager/base.rb', line 8 def gemfile_path @gemfile_path end |
#project_root ⇒ Object (readonly)
Returns the value of attribute project_root.
8 9 10 |
# File 'lib/appraisal/gem_manager/base.rb', line 8 def project_root @project_root end |
Instance Method Details
#available? ⇒ Boolean
Check if the gem manager is available on the system
39 40 41 |
# File 'lib/appraisal/gem_manager/base.rb', line 39 def available? raise NotImplementedError, "#{self.class}#available? must be implemented" end |
#install(options = {}) ⇒ void
This method returns an undefined value.
Install gems for the given gemfile
20 21 22 |
# File 'lib/appraisal/gem_manager/base.rb', line 20 def install( = {}) raise NotImplementedError, "#{self.class}#install must be implemented" end |
#name ⇒ String
Name of the gem manager for display
33 34 35 |
# File 'lib/appraisal/gem_manager/base.rb', line 33 def name raise NotImplementedError, "#{self.class}#name must be implemented" end |
#update(gems = []) ⇒ void
This method returns an undefined value.
Update gems (all or specific gems)
27 28 29 |
# File 'lib/appraisal/gem_manager/base.rb', line 27 def update(gems = []) raise NotImplementedError, "#{self.class}#update must be implemented" end |
#validate_availability! ⇒ void
This method returns an undefined value.
Validate that the gem manager is available, raising an error if not
46 47 48 |
# File 'lib/appraisal/gem_manager/base.rb', line 46 def validate_availability! # Default implementation does nothing (bundler is always available) end |