Class: FPM::Fry::Recipe
- Inherits:
-
Object
- Object
- FPM::Fry::Recipe
- 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
-
#before_build_steps ⇒ Object
Returns the value of attribute before_build_steps.
-
#build_depends ⇒ Object
Returns the value of attribute build_depends.
-
#input_hooks ⇒ Object
Returns the value of attribute input_hooks.
-
#packages ⇒ Object
Returns the value of attribute packages.
-
#source ⇒ Object
Returns the value of attribute source.
-
#steps ⇒ Object
Returns the value of attribute steps.
Instance Method Summary collapse
- #apply_input(package) ⇒ Object
- #depends ⇒ Object
-
#initialize ⇒ Recipe
constructor
A new instance of Recipe.
- #lint ⇒ Object
Constructor Details
#initialize ⇒ Recipe
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_steps ⇒ Object
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_depends ⇒ Object
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_hooks ⇒ Object
Returns the value of attribute input_hooks.
127 128 129 |
# File 'lib/fpm/fry/recipe.rb', line 127 def input_hooks @input_hooks end |
#packages ⇒ Object
Returns the value of attribute packages.
127 128 129 |
# File 'lib/fpm/fry/recipe.rb', line 127 def packages @packages end |
#source ⇒ Object
Returns the value of attribute source.
127 128 129 |
# File 'lib/fpm/fry/recipe.rb', line 127 def source @source end |
#steps ⇒ Object
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 |
#depends ⇒ Object
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 |
#lint ⇒ Object
152 153 154 |
# File 'lib/fpm/fry/recipe.rb', line 152 def lint packages.flat_map(&:lint) end |