Class: Halite::HelperBase
- Inherits:
-
Object
- Object
- Halite::HelperBase
- Defined in:
- lib/halite/helper_base.rb
Overview
Base class for helpers like Rake tasks.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#base ⇒ String
readonly
Base folder of the gem.
-
#gem_name ⇒ String
readonly
Name of the gem to use in these Rake tasks.
-
#options ⇒ Hash<Symbol, Object>
readonly
Helper options.
Class Method Summary collapse
-
.install(*args)
Class method helper to install the tasks.
Instance Method Summary collapse
-
#initialize(gem_name: nil, base: nil, **options) ⇒ HelperBase
constructor
A new instance of HelperBase.
-
#install
Subclass hoook to provide the actual tasks or other helpers to install.
Constructor Details
#initialize(gem_name: nil, base: nil, **options) ⇒ HelperBase
Returns a new instance of HelperBase.
58 59 60 61 62 63 64 65 66 |
# File 'lib/halite/helper_base.rb', line 58 def initialize(gem_name: nil, base: nil, **) @base = base || if defined?(::Rake) && ::Rake.original_dir ::Rake.original_dir else Dir.pwd end # rubocop:disable Lint/EndAlignment @gem_name = gem_name || find_gem_name(@base) @options = end |
Instance Attribute Details
#base ⇒ String (readonly)
Base folder of the gem.
49 50 51 |
# File 'lib/halite/helper_base.rb', line 49 def base @base end |
#gem_name ⇒ String (readonly)
Name of the gem to use in these Rake tasks.
45 46 47 |
# File 'lib/halite/helper_base.rb', line 45 def gem_name @gem_name end |
#options ⇒ Hash<Symbol, Object> (readonly)
Helper options.
53 54 55 |
# File 'lib/halite/helper_base.rb', line 53 def @options end |
Class Method Details
.install(*args)
This method returns an undefined value.
Class method helper to install the tasks.
39 40 41 |
# File 'lib/halite/helper_base.rb', line 39 def self.install(*args) new(*args).install end |
Instance Method Details
#install
This method returns an undefined value.
Subclass hoook to provide the actual tasks or other helpers to install.
79 80 81 |
# File 'lib/halite/helper_base.rb', line 79 def install raise NotImplementedError end |