Parent

Methods

Class/Module Index [+]

Quicksearch

WebyastTasks

Public Class Methods

loadTasks(params = {:include => ["*.rake"], :exclude => []}) click to toggle source

load webyast *.rake files, exclude/include list can be specified

# File lib/tasks/webyast_tasks.rb, line 29
def WebyastTasks.loadTasks(params = {:include => ["*.rake"], :exclude => []})
    return if @@tasks_loaded

    exclude_list = []
    if params[:exclude].nil?
        params[:exclude] = []
    end

    # expand exclude files
    params[:exclude].each { |efile| exclude_list += Dir["#{File.dirname(__FILE__)}/#{efile}"]}

    include_list = []
    if params[:include].nil?
        params[:include] = ["*.rake"]
    end

    # expand include files
    params[:include].each { |ifile| include_list += Dir["#{File.dirname(__FILE__)}/#{ifile}"]}

    # load an include file only if it not in the exclude list
    include_list.each { |ext|
        if !exclude_list.include?(ext)
            load ext
        end
    }

    @@tasks_loaded = true
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.