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

#_ansibleObject (readonly)

Returns the value of attribute _ansible.



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

def _ansible
  @_ansible
end

#_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

#_from_dimgObject (readonly)

Returns the value of attribute _from_dimg.



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

def _from_dimg
  @_from_dimg
end

#_from_dimg_artifactObject (readonly)

Returns the value of attribute _from_dimg_artifact.



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

def _from_dimg_artifact
  @_from_dimg_artifact
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

#_context_artifact_groupsObject



85
86
87
# File 'lib/dapp/dimg/config/directive/dimg/instance_methods.rb', line 85

def _context_artifact_groups
  @_context_artifact_groups ||= []
end

#_import_artifactObject



103
104
105
# File 'lib/dapp/dimg/config/directive/dimg/instance_methods.rb', line 103

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

#artifact(name = nil, &blk) ⇒ Object



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

def artifact(name = nil, &blk)
  pass_to(ArtifactGroup.new(name, dapp: dapp), :clone_to_artifact).tap do |artifact_group|
    _context_artifact_groups << directive_eval(artifact_group, &blk)
    dapp.artifact_config(name, artifact_group._artifact_config) unless name.nil?
  end
end

#artifacts_after_parsing!Object



146
147
148
149
# File 'lib/dapp/dimg/config/directive/dimg/instance_methods.rb', line 146

def artifacts_after_parsing!
  _artifacts_auto_excluding!
  _artifact.map(&:_config).each(&:artifacts_after_parsing!)
end

#chef(&blk) ⇒ Object



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

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

#docker(&blk) ⇒ Object



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

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

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



40
41
42
43
# File 'lib/dapp/dimg/config/directive/dimg/instance_methods.rb', line 40

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

#import(name, from = nil, &blk) ⇒ Object



33
34
35
36
37
38
# File 'lib/dapp/dimg/config/directive/dimg/instance_methods.rb', line 33

def import(name, from = nil, &blk)
  ArtifactGroup.new(dapp: dapp).tap do |artifact_group|
    artifact_group._artifact_export(dapp.artifact_config_by_name(name), from, &blk)
    _context_artifact_groups << artifact_group
  end
end

#mount(to, &blk) ⇒ Object



45
46
47
48
49
# File 'lib/dapp/dimg/config/directive/dimg/instance_methods.rb', line 45

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

#shell(&blk) ⇒ Object



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

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