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.
57 58 59 60 61 62 63 64 65 |
# File 'lib/halite/helper_base.rb', line 57 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.
48 49 50 |
# File 'lib/halite/helper_base.rb', line 48 def base @base end |
#gem_name ⇒ String (readonly)
Name of the gem to use in these Rake tasks.
44 45 46 |
# File 'lib/halite/helper_base.rb', line 44 def gem_name @gem_name end |
#options ⇒ Hash<Symbol, Object> (readonly)
Helper options.
52 53 54 |
# File 'lib/halite/helper_base.rb', line 52 def @options end |
Class Method Details
.install(*args)
This method returns an undefined value.
Class method helper to install the tasks.
38 39 40 |
# File 'lib/halite/helper_base.rb', line 38 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.
78 79 80 |
# File 'lib/halite/helper_base.rb', line 78 def install raise NotImplementedError end |