Class: Dapp::Dimg::Config::Directive::GitArtifactRemote

Inherits:
GitArtifactLocal show all
Includes:
Helper::Url
Defined in:
lib/dapp/dimg/config/directive/git_artifact_remote.rb

Defined Under Namespace

Classes: Export

Instance Attribute Summary collapse

Attributes inherited from ArtifactBase

#_group, #_owner

Instance Method Summary collapse

Methods included from Helper::Url

#get_host_from_git_url, #git_url_to_name

Methods inherited from GitArtifactLocal

#export

Methods inherited from ArtifactBase

#export, #group, #owner

Methods inherited from Base

#clone_to_artifact

Methods inherited from Config::Directive::Base

#clone

Constructor Details

#initialize(url, **kwargs, &blk) ⇒ GitArtifactRemote

Returns a new instance of GitArtifactRemote.



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

def initialize(url, **kwargs, &blk)
  @_url  = url
  @_name = git_url_to_name(url)

  super(**kwargs, &blk)
end

Instance Attribute Details

#_branchObject (readonly)

Returns the value of attribute _branch.



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

def _branch
  @_branch
end

#_commitObject (readonly)

Returns the value of attribute _commit.



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

def _commit
  @_commit
end

#_nameObject (readonly)

Returns the value of attribute _name.



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

def _name
  @_name
end

#_urlObject (readonly)

Returns the value of attribute _url.



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

def _url
  @_url
end

Instance Method Details

#_exportObject



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

def _export
  super do |export|
    export._url    = @_url
    export._name   = @_name
    export._branch ||= @_branch
    export._commit ||= @_commit
  end
end

#branch(value) ⇒ Object



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

def branch(value)
  sub_directive_eval { @_branch = value.to_s }
end

#commit(value) ⇒ Object



21
22
23
# File 'lib/dapp/dimg/config/directive/git_artifact_remote.rb', line 21

def commit(value)
  sub_directive_eval { @_commit = value }
end