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

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

Overview

InstanceMethods

Defined Under Namespace

Classes: GitArtifact

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#_artifactObject (readonly)

Returns the value of attribute _artifact.



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

def _artifact
  @_artifact
end

#_builderObject (readonly)

Returns the value of attribute _builder.



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

def _builder
  @_builder
end

#_chefObject (readonly)

Returns the value of attribute _chef.



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

def _chef
  @_chef
end

#_dockerObject (readonly)

Returns the value of attribute _docker.



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

def _docker
  @_docker
end

#_git_artifactObject (readonly)

Returns the value of attribute _git_artifact.



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

def _git_artifact
  @_git_artifact
end

#_install_dependenciesObject (readonly)

Returns the value of attribute _install_dependencies.



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

def _install_dependencies
  @_install_dependencies
end

#_mountObject (readonly)

Returns the value of attribute _mount.



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

def _mount
  @_mount
end

#_setup_dependenciesObject (readonly)

Returns the value of attribute _setup_dependencies.



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

def _setup_dependencies
  @_setup_dependencies
end

#_shellObject (readonly)

Returns the value of attribute _shell.



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

def _shell
  @_shell
end

Instance Method Details

#_dev_modeObject



53
54
55
# File 'lib/dapp/config/dimg/instance_methods.rb', line 53

def _dev_mode
  !!@_dev_mode
end

#_import_artifactObject



109
110
111
# File 'lib/dapp/config/dimg/instance_methods.rb', line 109

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

#artifact(&blk) ⇒ Object



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

def artifact(&blk)
  _artifact.concat begin
                     pass_to_custom(ArtifactGroup.new(project: project), :clone_to_artifact).tap do |artifact_group|
                       artifact_group.instance_eval(&blk) if block_given?
                     end._export
                   end
end

#chef(&blk) ⇒ Object



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

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

#dev_modeObject



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

def dev_mode
  @_dev_mode = true
end

#docker(&blk) ⇒ Object



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

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

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



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

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

#install_depends_on(*args) ⇒ Object



14
15
16
# File 'lib/dapp/config/dimg/instance_methods.rb', line 14

def install_depends_on(*args)
  _install_dependencies.concat(args)
end

#mount(to, &blk) ⇒ Object



49
50
51
# File 'lib/dapp/config/dimg/instance_methods.rb', line 49

def mount(to, &blk)
  _mount << Directive::Mount.new(to, project: project, &blk)
end

#setup_depends_on(*args) ⇒ Object



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

def setup_depends_on(*args)
  _setup_dependencies.concat(args)
end

#shell(&blk) ⇒ Object



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

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