Class: FPM::Fry::Recipe

Inherits:
Object
  • Object
show all
Defined in:
lib/fpm/fry/recipe.rb,
lib/fpm/fry/recipe/error.rb,
lib/fpm/fry/recipe/builder.rb

Defined Under Namespace

Classes: Builder, DuplicateDependency, Error, NotFound, PackageBuilder, PackageRecipe, Step

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeRecipe

Returns a new instance of Recipe.



134
135
136
137
138
139
140
141
142
# File 'lib/fpm/fry/recipe.rb', line 134

def initialize
  @source = Source::Null
  @before_build_steps = []
  @steps = []
  @packages = [PackageRecipe.new]
  @packages[0].files << '**'
  @build_depends = {}
  @input_hooks = []
end

Instance Attribute Details

#before_build_stepsObject

Returns the value of attribute before_build_steps.



127
128
129
# File 'lib/fpm/fry/recipe.rb', line 127

def before_build_steps
  @before_build_steps
end

#build_dependsObject

Returns the value of attribute build_depends.



127
128
129
# File 'lib/fpm/fry/recipe.rb', line 127

def build_depends
  @build_depends
end

#input_hooksObject

Returns the value of attribute input_hooks.



127
128
129
# File 'lib/fpm/fry/recipe.rb', line 127

def input_hooks
  @input_hooks
end

#packagesObject

Returns the value of attribute packages.



127
128
129
# File 'lib/fpm/fry/recipe.rb', line 127

def packages
  @packages
end

#sourceObject

Returns the value of attribute source.



127
128
129
# File 'lib/fpm/fry/recipe.rb', line 127

def source
  @source
end

#stepsObject

Returns the value of attribute steps.



127
128
129
# File 'lib/fpm/fry/recipe.rb', line 127

def steps
  @steps
end

Instance Method Details

#apply_input(package) ⇒ Object



156
157
158
159
# File 'lib/fpm/fry/recipe.rb', line 156

def apply_input( package )
  input_hooks.each{|h| h.call(self, package) }
  return package
end

#dependsObject



144
145
146
147
148
149
150
# File 'lib/fpm/fry/recipe.rb', line 144

def depends
  depends = @packages.map(&:depends).inject(:merge)
  @packages.map(&:name).each do | n |
    depends.delete(n)
  end
  return depends
end

#lintObject



152
153
154
# File 'lib/fpm/fry/recipe.rb', line 152

def lint
  packages.flat_map(&:lint)
end