Class: Dapp::Dimg::Config::Directive::ArtifactBase::Export
- Inherits:
-
Base
- Object
- Config::Directive::Base
- Base
- Dapp::Dimg::Config::Directive::ArtifactBase::Export
- Defined in:
- lib/dapp/dimg/config/directive/artifact_base.rb
Direct Known Subclasses
Dapp::Dimg::Config::Directive::Artifact::Export, GitArtifactLocal::Export
Instance Attribute Summary collapse
-
#_cwd ⇒ Object
Returns the value of attribute _cwd.
-
#_exclude_paths ⇒ Object
Returns the value of attribute _exclude_paths.
-
#_group ⇒ Object
Returns the value of attribute _group.
-
#_include_paths ⇒ Object
Returns the value of attribute _include_paths.
-
#_owner ⇒ Object
Returns the value of attribute _owner.
-
#_to ⇒ Object
Returns the value of attribute _to.
Instance Method Summary collapse
- #_artifact_options ⇒ Object
- #exclude_paths(*relative_paths) ⇒ Object
- #group(group) ⇒ Object
- #include_paths(*relative_paths) ⇒ Object
-
#initialize(cwd, **kwargs, &blk) ⇒ Export
constructor
A new instance of Export.
- #owner(owner) ⇒ Object
- #to(absolute_path) ⇒ Object
- #validate! ⇒ Object
Methods inherited from Base
Methods inherited from Config::Directive::Base
Constructor Details
#initialize(cwd, **kwargs, &blk) ⇒ Export
Returns a new instance of Export.
39 40 41 42 43 44 45 |
# File 'lib/dapp/dimg/config/directive/artifact_base.rb', line 39 def initialize(cwd, **kwargs, &blk) self._cwd = cwd @_include_paths ||= [] @_exclude_paths ||= [] super(**kwargs, &blk) end |
Instance Attribute Details
#_cwd ⇒ Object
Returns the value of attribute _cwd.
37 38 39 |
# File 'lib/dapp/dimg/config/directive/artifact_base.rb', line 37 def _cwd @_cwd end |
#_exclude_paths ⇒ Object
Returns the value of attribute _exclude_paths.
37 38 39 |
# File 'lib/dapp/dimg/config/directive/artifact_base.rb', line 37 def _exclude_paths @_exclude_paths end |
#_group ⇒ Object
Returns the value of attribute _group.
37 38 39 |
# File 'lib/dapp/dimg/config/directive/artifact_base.rb', line 37 def _group @_group end |
#_include_paths ⇒ Object
Returns the value of attribute _include_paths.
37 38 39 |
# File 'lib/dapp/dimg/config/directive/artifact_base.rb', line 37 def _include_paths @_include_paths end |
#_owner ⇒ Object
Returns the value of attribute _owner.
37 38 39 |
# File 'lib/dapp/dimg/config/directive/artifact_base.rb', line 37 def _owner @_owner end |
#_to ⇒ Object
Returns the value of attribute _to.
37 38 39 |
# File 'lib/dapp/dimg/config/directive/artifact_base.rb', line 37 def _to @_to end |
Instance Method Details
#_artifact_options ⇒ Object
47 48 49 50 51 52 53 54 55 56 |
# File 'lib/dapp/dimg/config/directive/artifact_base.rb', line 47 def { to: _to, cwd: _cwd, include_paths: _include_paths, exclude_paths: _exclude_paths, owner: _owner, group: _group } end |
#exclude_paths(*relative_paths) ⇒ Object
80 81 82 83 84 85 86 87 |
# File 'lib/dapp/dimg/config/directive/artifact_base.rb', line 80 def exclude_paths(*relative_paths) sub_directive_eval do unless relative_paths.all? { |path| Pathname(path).relative? } raise ::Dapp::Error::Config, code: :export_exclude_paths_relative_path_required end _exclude_paths.concat(relative_paths.map(&method(:path_format))) end end |
#group(group) ⇒ Object
93 94 95 |
# File 'lib/dapp/dimg/config/directive/artifact_base.rb', line 93 def group(group) sub_directive_eval { @_group = group } end |
#include_paths(*relative_paths) ⇒ Object
71 72 73 74 75 76 77 78 |
# File 'lib/dapp/dimg/config/directive/artifact_base.rb', line 71 def include_paths(*relative_paths) sub_directive_eval do unless relative_paths.all? { |path| Pathname(path).relative? } raise ::Dapp::Error::Config, code: :export_include_paths_relative_path_required end _include_paths.concat(relative_paths.map(&method(:path_format))) end end |
#owner(owner) ⇒ Object
89 90 91 |
# File 'lib/dapp/dimg/config/directive/artifact_base.rb', line 89 def owner(owner) sub_directive_eval { @_owner = owner } end |
#to(absolute_path) ⇒ Object
64 65 66 67 68 69 |
# File 'lib/dapp/dimg/config/directive/artifact_base.rb', line 64 def to(absolute_path) sub_directive_eval do raise ::Dapp::Error::Config, code: :export_to_absolute_path_required unless Pathname(absolute_path).absolute? @_to = path_format(absolute_path) end end |