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, #test_run

Constructor Details

#initialize(params = {}) ⇒ Forge

Returns a new instance of Forge.



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

def initialize(params = {})
  @options = params
  @license = 'LICENSE'
  @deps = {}
  @flags = {}
  @patches = []
  @build_block = proc { raise('No build block provided') }
  @test_block = proc { raise('No test block provided') }
  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

#cflagsObject

Returns the value of attribute cflags.



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

def cflags
  @cflags
end

#configure_flagsObject

Returns the value of attribute configure_flags.



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

def configure_flags
  @configure_flags
end

#depsObject

Returns the value of attribute deps.



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

def deps
  @deps
end

#libsObject

Returns the value of attribute libs.



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

def libs
  @libs
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

#test_blockObject

Returns the value of attribute test_block.



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

def test_block
  @test_block
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



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

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

#push!Object



50
51
52
53
54
55
56
# File 'lib/pkgforge/forge.rb', line 50

def push!
  add_license!
  make_tarball!
  bump_revision!
  update_repo!
  upload_artifact!
end

#test!Object



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

def test!
  tester = TestDSL.new(self)
  tester.instance_eval(&test_block)
end