Module: Dapp::Dimg::Config::Directive::Dimg::InstanceMethods
- Defined in:
- lib/dapp/dimg/config/directive/dimg/instance_methods.rb
Defined Under Namespace
Classes: GitArtifact
Instance Attribute Summary collapse
-
#_ansible ⇒ Object
readonly
Returns the value of attribute _ansible.
-
#_artifact ⇒ Object
readonly
Returns the value of attribute _artifact.
-
#_artifact_groups ⇒ Object
readonly
Returns the value of attribute _artifact_groups.
-
#_builder ⇒ Object
readonly
Returns the value of attribute _builder.
-
#_chef ⇒ Object
readonly
Returns the value of attribute _chef.
-
#_docker ⇒ Object
readonly
Returns the value of attribute _docker.
-
#_from_dimg ⇒ Object
readonly
Returns the value of attribute _from_dimg.
-
#_from_dimg_artifact ⇒ Object
readonly
Returns the value of attribute _from_dimg_artifact.
-
#_git_artifact ⇒ Object
readonly
Returns the value of attribute _git_artifact.
-
#_mount ⇒ Object
readonly
Returns the value of attribute _mount.
-
#_shell ⇒ Object
readonly
Returns the value of attribute _shell.
Instance Method Summary collapse
- #_context_artifact_groups ⇒ Object
- #_import_artifact ⇒ Object
- #artifact(name = nil, &blk) ⇒ Object
- #artifacts_after_parsing! ⇒ Object
- #chef(&blk) ⇒ Object
- #docker(&blk) ⇒ Object
- #git(url = nil, &blk) ⇒ Object
- #import(name, from = nil, &blk) ⇒ Object
- #mount(to, &blk) ⇒ Object
- #shell(&blk) ⇒ Object
Instance Attribute Details
#_ansible ⇒ Object (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 |
#_artifact ⇒ Object (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_groups ⇒ Object (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 |
#_builder ⇒ Object (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 |
#_chef ⇒ Object (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 |
#_docker ⇒ Object (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_dimg ⇒ Object (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_artifact ⇒ Object (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_artifact ⇒ Object (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 |
#_mount ⇒ Object (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 |
#_shell ⇒ Object (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_groups ⇒ Object
85 86 87 |
# File 'lib/dapp/dimg/config/directive/dimg/instance_methods.rb', line 85 def _context_artifact_groups @_context_artifact_groups ||= [] end |
#_import_artifact ⇒ Object
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 |