class Object

Copyright © 2013 Nathan Currier

Use, modification, and distribution are all subject to the Boost Software License, Version 1.0. (See the accompanying file LICENSE.md or at rideliner.tk/LICENSE.html).

<description>

Public Instance Methods

author(*names)
Alias for: authors
authors(*names) click to toggle source
# File lib/bakery/dsl.rb, line 22
def authors *names
  if Bakery.getCake.icing[:authors] == nil
    Bakery::Log.debug "authors set: #{names}"

    Bakery.getCake.icing[:authors] = Array.new
  else
    Bakery::Log.debug "authors concatenated: #{names}"
  end

  Bakery.getCake.icing[:authors].concat names
end
Also aliased as: author
defaultAuthor(*names)
Alias for: defaultAuthors
defaultAuthors(*names) click to toggle source
# File lib/bakery/dsl.rb, line 70
def defaultAuthors *names
  if Bakery.icing[:authors] == nil
    Bakery::Log.debug "default author set: #{names}"
  else
    Bakery::Log.debug "default author overwritten: #{names}"
  end

  Bakery.icing[:authors] = names
end
Also aliased as: defaultAuthor
defaultCopyright(*lines) click to toggle source
# File lib/bakery/dsl.rb, line 82
def defaultCopyright *lines
  if Bakery.icing[:copyright] == nil
    Bakery::Log.debug "default copyright set: #{lines}"
  else
    Bakery::Log.debug "default copyright overwritten: #{lines}"
  end

  Bakery.icing[:copyright] = lines
end
defaultDescription(*desc) click to toggle source
# File lib/bakery/dsl.rb, line 92
def defaultDescription *desc
  if Bakery.icing[:description] == nil
    Bakery::Log.debug "default description set: #{desc}"
  else
    Bakery::Log.debug "default description overwritten: #{desc}"
  end

  Bakery.icing[:description] = desc
end
description(*desc) click to toggle source
# File lib/bakery/dsl.rb, line 36
def description *desc
  if Bakery.getCake.icing[:description] == nil
    Bakery::Log.debug "description set: #{desc}"

    Bakery.getCake.icing[:description] = Array.new
  else
    Bakery::Log.debug "description concatenated: #{desc}"
  end

  Bakery.getCake.icing[:description].concat desc
end
global_function(name, &block) click to toggle source
# File lib/bakery/detail/global_function.rb, line 13
def global_function name, &block
  Bakery::Log.debug "create global function: #{name.to_s}"

  self.class.send :define_method, name, &block
end
ingredient(associations)
Alias for: ingredients
ingredients(associations) click to toggle source

Copyright © 2013 Nathan Currier

Use, modification, and distribution are all subject to the Boost Software License, Version 1.0. (See the accompanying file LICENSE.md or at rideliner.tk/LICENSE.html).

<description>

# File lib/bakery/ingredient.rb, line 12
def ingredients associations
  associations.each_pair { |func, klass|
    global_function func do |*args, &block|
      klass.new *args, &block
    end
  }
end
Also aliased as: ingredient
loadIcing(filename) click to toggle source
# File lib/bakery/dsl.rb, line 102
def loadIcing filename
  Bakery::ICING_SEARCH.search(filename) { |file|
    Bakery::Log.info "loading icing: #{file}"
    load file
  }
end
load_if_exists(name) click to toggle source

Copyright © 2013 Nathan Currier

Use, modification, and distribution are all subject to the Boost Software License, Version 1.0. (See the accompanying file LICENSE.md or at rideliner.tk/LICENSE.html).

<description>

# File lib/bakery/detail/load.rb, line 12
def load_if_exists name
  if File.exists? name
    load name
  else
    Bakery::Log.debug "could not load file: #{name}"
  end
end
name(n) click to toggle source

Copyright © 2013 Nathan Currier

Use, modification, and distribution are all subject to the Boost Software License, Version 1.0. (See the accompanying file LICENSE.md or at rideliner.tk/LICENSE.html).

<description>

# File lib/bakery/dsl.rb, line 12
def name n
  if Bakery.getCake.icing[:name] == nil
    Bakery::Log.debug "name set: #{n}"
  else
    Bakery::Log.debug "name overwritten: #{n}"
  end

  Bakery.getCake.icing[:name] = n
end
summary(*sum) click to toggle source
# File lib/bakery/dsl.rb, line 48
def summary *sum
  if Bakery.getCake.icing[:summary] == nil
    Bakery::Log.debug "summary set: #{sum}"

    Bakery.getCake.icing[:summary] = Array.new
  else
    Bakery::Log.debug "summary concatenated: #{sum}"
  end

  Bakery.getCake.icing[:summary].concat sum
end
use_defaults() click to toggle source
# File lib/bakery/ingredient.rb, line 22
def use_defaults
  load File.join(Bakery::LIB_DIR, 'default.ingredients')
end