Class: GemHadar::RvmConfig
- Inherits:
-
Object
- Object
- GemHadar::RvmConfig
- Extended by:
- DSLKit::DSLAccessor
- Includes:
- DSLKit::BlockSelf
- Defined in:
- lib/gem_hadar.rb
Overview
A class that encapsulates Ruby Version Manager (RVM) configuration settings for a gem project.
This class is responsible for managing RVM-specific configuration such as the Ruby version to use and the gemset name. It provides a structured way to define and access these settings within the context of a GemHadar configuration.
Instance Method Summary collapse
-
#gemset ⇒ String
The gemset method retrieves or sets the RVM gemset name for the project.
-
#initialize(&block) ⇒ GemHadar::RvmConfig
constructor
The initialize method sets up the RvmConfig instance by evaluating the provided block in the context of the object.
-
#use ⇒ String
The use method retrieves or sets the Ruby version to be used with RVM.
Constructor Details
#initialize(&block) ⇒ GemHadar::RvmConfig
The initialize method sets up the RvmConfig instance by evaluating the provided block in the context of the object.
601 602 603 604 |
# File 'lib/gem_hadar.rb', line 601 def initialize(&block) @outer_scope = block_self(&block) instance_eval(&block) end |
Instance Method Details
#gemset ⇒ String
The gemset method retrieves or sets the RVM gemset name for the project.
This method serves as an accessor for the RVM (Ruby Version Manager) gemset configuration within the nested RvmConfig class. When called without arguments, it returns the configured gemset name, which defaults to the gem’s name. When called with an argument, it sets the gemset name to be used with RVM.
628 |
# File 'lib/gem_hadar.rb', line 628 dsl_accessor :gemset do @outer_scope.name end |
#use ⇒ String
The use method retrieves or sets the Ruby version to be used with RVM.
This method serves as an accessor for the Ruby version configuration within the RVM (Ruby Version Manager) settings. When called without arguments, it returns the configured Ruby version. When called with an argument, it sets the Ruby version to be used.
615 |
# File 'lib/gem_hadar.rb', line 615 dsl_accessor :use do `rvm tools strings`.split(/\n/).full?(:last) || 'ruby' end |