Class: Texas::Task::Base

Inherits:
Object
  • Object
show all
Includes:
OutputHelper
Defined in:
lib/texas/task/base.rb

Direct Known Subclasses

NewProject, Watch

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from OutputHelper

#trace, #verbose, #warning

Constructor Details

#initialize(_options, _build = nil) ⇒ Base

Returns a new instance of Base


7
8
9
10
# File 'lib/texas/task/base.rb', line 7

def initialize(_options, _build = nil)
  self.options = _options
  @build = _build if _build
end

Instance Attribute Details

#optionsObject

Returns the value of attribute options


5
6
7
# File 'lib/texas/task/base.rb', line 5

def options
  @options
end

Instance Method Details

#build(klass = Build::Dry) ⇒ Object


12
13
14
15
16
17
18
# File 'lib/texas/task/base.rb', line 12

def build(klass = Build::Dry)
  @build ||= begin
    b = klass.new(options)
    b.run
    b
  end
end

#runObject


20
21
# File 'lib/texas/task/base.rb', line 20

def run
end