Class: Dply::CodeArchive

Inherits:
Object
  • Object
show all
Includes:
Helper
Defined in:
lib/dply/code_archive.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Helper

#cmd, #error, #git, #logger, #sh, #symlink

Constructor Details

#initialize(name, revision:) ⇒ CodeArchive

Returns a new instance of CodeArchive.



12
13
14
15
16
17
18
# File 'lib/dply/code_archive.rb', line 12

def initialize(name, revision:)
  @name = name
  @branch = get_branch
  @revision = revision
  @dir = "tmp/build_artifacts"
  validate
end

Instance Attribute Details

#branchObject (readonly)

Returns the value of attribute branch.



9
10
11
# File 'lib/dply/code_archive.rb', line 9

def branch
  @branch
end

#nameObject (readonly)

Returns the value of attribute name.



9
10
11
# File 'lib/dply/code_archive.rb', line 9

def name
  @name
end

#skip_depcheck=(value) ⇒ Object (writeonly)

Sets the attribute skip_depcheck

Parameters:

  • value

    the value to set the attribute skip_depcheck to.



10
11
12
# File 'lib/dply/code_archive.rb', line 10

def skip_depcheck=(value)
  @skip_depcheck = value
end

Instance Method Details

#build(git: true, gnu_tar: false, &block) ⇒ Object



20
21
22
23
24
25
26
27
28
29
# File 'lib/dply/code_archive.rb', line 20

def build(git: true, gnu_tar: false, &block)
  make_dir
  create_tar git, gnu_tar
  instance_eval &block if block
  add_git_commit_id
  add_revision
  add_archive_name
  depcheck
  compress
end