class Cany::Specification

Constants

EXT

Attributes

base_dir[RW]
binary[RW]
build[RW]
cany_version_constraint[RW]
clean[RW]
dependencies[RW]
description[RW]
licence[RW]
maintainer_email[RW]
maintainer_name[RW]
name[RW]
prepare[RW]
recipes[RW]
version[RW]
website[RW]

Public Class Methods

new(dsl=Cany::Specification::DSL, &block) click to toggle source
# File lib/cany/specification.rb, line 12
def initialize(dsl=Cany::Specification::DSL, &block)
  @recipes = []
  @dependencies = []
  setup dsl, &block
end

Public Instance Methods

build_dependencies() click to toggle source

@api public Return all dependencies needed to build this package @return [Array<Dependency>] A list of dependencies.

# File lib/cany/specification.rb, line 25
def build_dependencies
  dependencies.select(&:build?)
end
inspect()
Alias for: to_s
runtime_dependencies() click to toggle source

@api public Return all dependencies needed to build this package @return [Array<Dependency>] A list of dependencies.

# File lib/cany/specification.rb, line 32
def runtime_dependencies
  dependencies.select(&:runtime?)
end
setup(dsl=Cany::Specification::DSL, &block) click to toggle source
# File lib/cany/specification.rb, line 18
def setup(dsl=Cany::Specification::DSL, &block)
  dsl.new(self).exec(&block)
end
setup_recipes() click to toggle source

@api private This method creates recipe instances for all required recipes from the given spec.

# File lib/cany/specification.rb, line 55
def setup_recipes
  last_recipe = nil
  recipes.reverse.each do |recipe|
    recipe.inner = last_recipe unless last_recipe.nil?
    last_recipe = recipe
  end
  recipes.map(&:prepare)
end
system_recipe() click to toggle source

Return the system recipe for this specification. @return [Recipe] The system reciep @raise [NoSystemRecipe] if no system recipe was specified.

# File lib/cany/specification.rb, line 48
def system_recipe
  raise NoSystemRecipe.new unless @system_recipe
  @system_recipe
end
system_recipe=(recipe) click to toggle source

Define the given recipe instance as system recipe. It can be accessed by other recipes under the system name and it is added as last recipe and do system specific things. At the moment the only recipe designed to work as system recipe is the DebHelperRecipe The attribute should be set after all recipe changes are over. @param recipe the system recipe instance

# File lib/cany/specification.rb, line 41
def system_recipe=(recipe)
  @system_recipe = recipe
  @recipes << recipe
end
to_s() click to toggle source
# File lib/cany/specification.rb, line 64
def to_s
  "Cany::Specification<#{object_id}>(name=#{name}, recipes=[#{recipes.map(&:name).join(', ')}]"
end
Also aliased as: inspect