Class: PkgForge::Forge

Inherits:
Object
  • Object
show all
Includes:
Contracts::Builtin, Contracts::Core, Helpers, Prepare, Push
Defined in:
lib/pkgforge/forge.rb

Overview

Real Forge object

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Helpers

#dep, #releasedir, #run

Constructor Details

#initialize(params = {}) ⇒ Forge



22
23
24
25
26
27
28
29
# File 'lib/pkgforge/forge.rb', line 22

def initialize(params = {})
  @options = params
  @license = 'LICENSE'
  @deps = {}
  @flags = {}
  @patches = []
  nil
end

Instance Attribute Details

#build_blockObject

Returns the value of attribute build_block.



18
19
20
# File 'lib/pkgforge/forge.rb', line 18

def build_block
  @build_block
end

#depsObject

Returns the value of attribute deps.



18
19
20
# File 'lib/pkgforge/forge.rb', line 18

def deps
  @deps
end

#flagsObject

Returns the value of attribute flags.



18
19
20
# File 'lib/pkgforge/forge.rb', line 18

def flags
  @flags
end

#licenseObject

Returns the value of attribute license.



18
19
20
# File 'lib/pkgforge/forge.rb', line 18

def license
  @license
end

#nameObject

Returns the value of attribute name.



18
19
20
# File 'lib/pkgforge/forge.rb', line 18

def name
  @name
end

#orgObject

Returns the value of attribute org.



18
19
20
# File 'lib/pkgforge/forge.rb', line 18

def org
  @org
end

#patchesObject

Returns the value of attribute patches.



18
19
20
# File 'lib/pkgforge/forge.rb', line 18

def patches
  @patches
end

#version_blockObject

Returns the value of attribute version_block.



18
19
20
# File 'lib/pkgforge/forge.rb', line 18

def version_block
  @version_block
end

Instance Method Details

#build!Object



32
33
34
35
36
37
38
39
40
# File 'lib/pkgforge/forge.rb', line 32

def build!
  prepare_source!
  patch_source!
  prepare_deps!
  builder = BuildDSL.new(self)
  builder.instance_eval(&build_block)
  add_license!
  make_tarball!
end

#push!Object



43
44
45
46
47
# File 'lib/pkgforge/forge.rb', line 43

def push!
  bump_revision!
  update_repo!
  upload_artifact!
end