module Bivouac @@_plugins_view_helpers = [] @@_plugins_controller_helpers = [] def files( xPath, *options, &block ) path = File.dirname($0) + "/" + xPath.to_s if ENV['BIVOUAC_ROOT'] path = ENV['BIVOUAC_ROOT'] + "/app/" + xPath.to_s end Dir.glob("#{path}/**/*.rb").each do |file| if options[0] if options[0].keys.include?( :except ) if options[0][:except].include?(File.basename(file)) == false yield( file ) end end else yield( file ) end end end def addViewHelperModule( m ) @@_plugins_view_helpers << m end def viewHelperModule @@_plugins_view_helpers end def addControllerHelperModule( m ) @@_plugins_view_helpers << m end def controllerHelperModule @@_plugins_view_helpers end def filePath( from, *data ) File.join File.expand_path(File.dirname(from)), data end end