Class: BuildRecipe

Inherits:
MiniPortile
  • Object
show all
Defined in:
ext/tiny_tds/extconf.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, version, files) ⇒ BuildRecipe

Returns a new instance of BuildRecipe.



23
24
25
26
27
28
29
# File 'ext/tiny_tds/extconf.rb', line 23

def initialize(name, version, files)
  super(name, version)
  self.files = files
  rootdir = File.expand_path("../../..", __FILE__)
  self.target = File.join(rootdir, "ports")
  self.patch_files = Dir[File.join("patches", self.name, self.version, "*.patch")].sort
end

Instance Attribute Details

#gem_platformObject

Returns the value of attribute gem_platform.



21
22
23
# File 'ext/tiny_tds/extconf.rb', line 21

def gem_platform
  @gem_platform
end

Instance Method Details

#cook_and_activateObject



36
37
38
39
40
41
42
43
44
45
46
# File 'ext/tiny_tds/extconf.rb', line 36

def cook_and_activate
  checkpoint = File.join(target, "#{name}-#{version}-#{gem_platform}.installed")

  unless File.exist?(checkpoint)
    cook
    FileUtils.touch checkpoint
  end

  activate
  self
end

#port_pathObject

this will yield all ports into the same directory, making our path configuration for the linker easier



32
33
34
# File 'ext/tiny_tds/extconf.rb', line 32

def port_path
  "#{@target}/#{gem_platform}"
end