Module: Dapp::Dimg::Config::Directive::Dimg::InstanceMethods

Included in:
Dapp::Dimg::Config::Directive::Dimg, Dapp::Dimg::Config::Directive::DimgGroup
Defined in:
lib/dapp/dimg/config/directive/dimg/instance_methods.rb

Defined Under Namespace

Classes: GitArtifact

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#_artifactObject (readonly)

Returns the value of attribute _artifact.



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

def _artifact
  @_artifact
end

#_artifact_groupsObject (readonly)

Returns the value of attribute _artifact_groups.



9
10
11
# File 'lib/dapp/dimg/config/directive/dimg/instance_methods.rb', line 9

def _artifact_groups
  @_artifact_groups
end

#_builderObject (readonly)

Returns the value of attribute _builder.



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

def _builder
  @_builder
end

#_chefObject (readonly)

Returns the value of attribute _chef.



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

def _chef
  @_chef
end

#_dockerObject (readonly)

Returns the value of attribute _docker.



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

def _docker
  @_docker
end

#_git_artifactObject (readonly)

Returns the value of attribute _git_artifact.



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

def _git_artifact
  @_git_artifact
end

#_mountObject (readonly)

Returns the value of attribute _mount.



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

def _mount
  @_mount
end

#_shellObject (readonly)

Returns the value of attribute _shell.



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

def _shell
  @_shell
end

Instance Method Details

#_import_artifactObject



90
91
92
# File 'lib/dapp/dimg/config/directive/dimg/instance_methods.rb', line 90

def _import_artifact
  _artifact.select(&:not_associated?)
end

#artifact(&blk) ⇒ Object



25
26
27
28
29
# File 'lib/dapp/dimg/config/directive/dimg/instance_methods.rb', line 25

def artifact(&blk)
  pass_to(ArtifactGroup.new(dapp: dapp), :clone_to_artifact).tap do |artifact_group|
    _artifact_groups << directive_eval(artifact_group, &blk)
  end
end

#chef(&blk) ⇒ Object



11
12
13
14
# File 'lib/dapp/dimg/config/directive/dimg/instance_methods.rb', line 11

def chef(&blk)
  builder(:chef)
  directive_eval(_chef, &blk)
end

#docker(&blk) ⇒ Object



21
22
23
# File 'lib/dapp/dimg/config/directive/dimg/instance_methods.rb', line 21

def docker(&blk)
  directive_eval(_docker, &blk)
end

#git(url = nil, &blk) ⇒ Object



31
32
33
34
# File 'lib/dapp/dimg/config/directive/dimg/instance_methods.rb', line 31

def git(url = nil, &blk)
  type = url.nil? ? :local : :remote
  _git_artifact.public_send(type, url.to_s, &blk)
end

#mount(to, &blk) ⇒ Object



36
37
38
39
40
# File 'lib/dapp/dimg/config/directive/dimg/instance_methods.rb', line 36

def mount(to, &blk)
  Mount.new(to, dapp: dapp, &blk).tap do |mount|
    _mount << mount
  end
end

#shell(&blk) ⇒ Object



16
17
18
19
# File 'lib/dapp/dimg/config/directive/dimg/instance_methods.rb', line 16

def shell(&blk)
  builder(:shell)
  directive_eval(_shell, &blk)
end