Class: Dapp::Config::Directive::Shell::Dimg

Inherits:
Base
  • Object
show all
Defined in:
lib/dapp/config/directive/shell/dimg.rb

Overview

Dimg

Direct Known Subclasses

Artifact

Defined Under Namespace

Classes: StageCommand

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Dapp::Config::Base

Instance Attribute Details

#_before_installObject (readonly)

Returns the value of attribute _before_install.



8
9
10
# File 'lib/dapp/config/directive/shell/dimg.rb', line 8

def _before_install
  @_before_install
end

#_before_setupObject (readonly)

Returns the value of attribute _before_setup.



8
9
10
# File 'lib/dapp/config/directive/shell/dimg.rb', line 8

def _before_setup
  @_before_setup
end

#_installObject (readonly)

Returns the value of attribute _install.



8
9
10
# File 'lib/dapp/config/directive/shell/dimg.rb', line 8

def _install
  @_install
end

#_setupObject (readonly)

Returns the value of attribute _setup.



8
9
10
# File 'lib/dapp/config/directive/shell/dimg.rb', line 8

def _setup
  @_setup
end

#_versionObject (readonly)

Returns the value of attribute _version.



7
8
9
# File 'lib/dapp/config/directive/shell/dimg.rb', line 7

def _version
  @_version
end

Class Method Details

.stage_command_generator(stage) ⇒ Object



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/dapp/config/directive/shell/dimg.rb', line 14

def self.stage_command_generator(stage)
  define_method stage do |&blk|
    (variable = instance_variable_get("@_#{stage}") || StageCommand.new(project: project)).instance_eval(&blk)
    instance_variable_set("@_#{stage}", variable)
  end

  define_method "_#{stage}_command" do
    return [] if (variable = instance_variable_get("@_#{stage}")).nil?
    variable._run
  end

  define_method "_#{stage}_version" do
    return [] if (variable = instance_variable_get("@_#{stage}")).nil?
    variable._version || _version
  end
end

Instance Method Details

#version(value) ⇒ Object



10
11
12
# File 'lib/dapp/config/directive/shell/dimg.rb', line 10

def version(value)
  @_version = value
end