Class: Dapp::Config::GitArtifact::Local

Inherits:
Object
  • Object
show all
Defined in:
lib/dapp/config/git_artifact.rb

Overview

Local

Direct Known Subclasses

Remote

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(where_to_add, **options) ⇒ Local

Returns a new instance of Local.



29
30
31
32
33
34
35
36
37
# File 'lib/dapp/config/git_artifact.rb', line 29

def initialize(where_to_add, **options)
  @_cwd          = ''
  @_where_to_add = where_to_add

  options.each do |k, v|
    respond_to?("_#{k}=") ? send(:"_#{k}=", v) : raise(Error::Config, code: :git_artifact_unexpected_attribute,
                                                                      data: { type: object_name, attr: k })
  end
end

Instance Attribute Details

#_cwd ⇒ Object

Returns the value of attribute _cwd.



27
28
29
# File 'lib/dapp/config/git_artifact.rb', line 27

def _cwd
  @_cwd
end

#_group ⇒ Object

Returns the value of attribute _group.



27
28
29
# File 'lib/dapp/config/git_artifact.rb', line 27

def _group
  @_group
end

#_owner ⇒ Object

Returns the value of attribute _owner.



27
28
29
# File 'lib/dapp/config/git_artifact.rb', line 27

def _owner
  @_owner
end

#_paths ⇒ Object

Returns the value of attribute _paths.



27
28
29
# File 'lib/dapp/config/git_artifact.rb', line 27

def _paths
  @_paths
end

#_where_to_add ⇒ Object

Returns the value of attribute _where_to_add.



27
28
29
# File 'lib/dapp/config/git_artifact.rb', line 27

def _where_to_add
  @_where_to_add
end

Instance Method Details

#_artifact_options ⇒ Object



39
40
41
42
43
44
45
46
47
# File 'lib/dapp/config/git_artifact.rb', line 39

def _artifact_options
  {
    where_to_add: _where_to_add,
    cwd:          _cwd,
    paths:        _paths,
    owner:        _owner,
    group:        _group
  }
end

#clone ⇒ Object



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

def clone
  Marshal.load(Marshal.dump(self))
end