Class: Mnenv::Installer
- Inherits:
-
Object
- Object
- Mnenv::Installer
- Defined in:
- lib/mnenv/installer/base.rb
Direct Known Subclasses
Mnenv::Installers::BinaryInstaller, Mnenv::Installers::GemfileInstaller
Defined Under Namespace
Classes: DevelopmentToolsMissing, InstallationError
Instance Attribute Summary collapse
-
#source ⇒ Object
readonly
Returns the value of attribute source.
-
#version ⇒ Object
readonly
Returns the value of attribute version.
Instance Method Summary collapse
-
#initialize(version, source: nil, target_dir: nil) ⇒ Installer
constructor
A new instance of Installer.
- #install ⇒ Object
- #installed? ⇒ Boolean
Constructor Details
#initialize(version, source: nil, target_dir: nil) ⇒ Installer
Returns a new instance of Installer.
10 11 12 13 14 |
# File 'lib/mnenv/installer/base.rb', line 10 def initialize(version, source: nil, target_dir: nil) @version = version @source = source || default_source @target_dir = target_dir || default_target_dir end |
Instance Attribute Details
#source ⇒ Object (readonly)
Returns the value of attribute source.
8 9 10 |
# File 'lib/mnenv/installer/base.rb', line 8 def source @source end |
#version ⇒ Object (readonly)
Returns the value of attribute version.
8 9 10 |
# File 'lib/mnenv/installer/base.rb', line 8 def version @version end |
Instance Method Details
#install ⇒ Object
16 17 18 19 20 21 |
# File 'lib/mnenv/installer/base.rb', line 16 def install verify_prerequisites! create_install_directory perform_installation regenerate_shims end |
#installed? ⇒ Boolean
23 24 25 |
# File 'lib/mnenv/installer/base.rb', line 23 def installed? Dir.exist?(version_dir) end |