Permalink
Browse files

Refactor of module/source.sh and rename of _pre_source _source and _p…

…ost_source to _pre_load _load and _post_load
  • Loading branch information...
1 parent 1702481 commit fc856365109fc5cb8dd6b2235a3e708ef9d07dac @jpic committed Oct 7, 2009
View
@@ -4,9 +4,9 @@
# the mtests_bashunit submodule.
# Sets up an arbitary conf path and break interval for testing.
-# @calls break_post_source()
+# @calls break_post_load()
function Setup() {
- break_post_source
+ break_post_load
break_conf_path=/tmp/break.test
break_interval=3
View
@@ -21,13 +21,13 @@
## break_previous="1254303082"
# Loads functions
-function break_source() {
+function break_load() {
source $(module_get_path break)/functions.sh
}
# This function is responsible for putting the module in a useable state by
# setting some defaults.
-function break_post_source() {
+function break_post_load() {
break_interval=7200
break_conf_path=${HOME}/.break
}
View
@@ -6,7 +6,7 @@
# supporting arrays.
# Function conf_auto_load_decorator() decorates conf_load() and so takes a
# module name as argument. This function can be called in your module
-# _post_source() function.
+# _post_load() function.
# Function conf_auto_save_all calls() conf_save() for all modules which the
# user choosed to auto save and load.
View
@@ -2,7 +2,7 @@
# -*- coding: utf-8 -*-
# This submodule of conf allows the user to define the modules which config
# should be auto saved and auto loaded.
-# It is the only module which _post_source() function, conf_auto_post_source()
+# It is the only module which _post_load() function, conf_auto_post_load()
# should call conf_load() because other module should have their configuration
# loaded by conf_auto_load_all().
# See conf_auto/functions.sh for information about the additionnal API for
@@ -11,17 +11,17 @@
# module.
# Loads the functions that extend the conf API and the conf overloads.
-function conf_auto_source() {
+function conf_auto_load() {
source $(module_get_path conf_auto)/functions.sh
source $(module_get_path conf_auto)/conf.sh
}
# Sets conf_auto_conf_path and loads the module configuration.
-# Note: your modules should not call conf_load in their _post_source() func, it
+# Note: your modules should not call conf_load in their _post_load() func, it
# should call conf_auto_load_decorator() instead, see functions.sh for more
# details.
# @calls conf_load()
-function conf_auto_post_source() {
+function conf_auto_post_load() {
conf_auto_conf_path="$HOME/.conf_auto"
conf_load conf_auto
View
@@ -9,7 +9,7 @@
# This function should be called when the module is loaded. It will load
# functions it depends on.
-function conf_source() {
+function conf_load() {
source $(module_get_path conf)/functions.sh
source $(module_get_path conf)/module.sh
}
View
@@ -4,7 +4,7 @@
# Blacklists the module.
# @calls module_blacklist_add()
-function docs_bashdoc_post_source() {
+function docs_bashdoc_post_load() {
module_blacklist_add docs_bashdoc
}
@@ -20,7 +20,7 @@
# another multilign
# item.
# Link to another another file like example.sh or from another module like
-# foomodule/source.sh or other_source.sh
+# foomodule/source.sh or other_load.sh
# Reference to the $foo, $foobar and $bar variables need the dollar prefix.
# This is a typed variable comment block
View
@@ -6,7 +6,7 @@
## docs # run the generator
# Sets up the default path.
-function docs_post_source() {
+function docs_post_load() {
docs_path="/tmp/docs"
docs_template_path="$(module_get_path docs)/bwdocs/templates"
docs_template_debug=0
View
@@ -4,10 +4,10 @@
# @Copyright Copyright 2009, James Pic
# @License Apache
-function hack_source() {
+function hack_load() {
source $(module_get_path hack)/functions.sh
}
-function hack_post_source() {
+function hack_post_load() {
hack_cdpath
}
View
@@ -4,7 +4,7 @@
# See mlog().
# Loads Bashinator!
-function mlog_source() {
+function mlog_load() {
source $(module_get_path mlog)/bashinator-0.3.sh
}
@@ -17,18 +17,10 @@ function mlog_source() {
## mlog err "Database is not started"
## mlog crit "Database crashed"
## mlog alert "Unsecure data"
-## mlog emerg "Data lost, probably burning in hell" Example usage:
-## mlog debug "Something happenned which might help you figuring what TF"
-## mlog info "Some script started correctly"
-## mlog notice "Database is 8 days old"
-## mlog warning "Database is older than your father"
-## mlog err "Database is not started"
-## mlog crit "Database crashed"
-## mlog alert "Unsecure data"
-## mlog emerg "Data lost, probably burning in hell"
+## mlog emerg "Data lost, probably burning in hell"
function mlog() {
local level="$1"
local message="$2"
- __msg $level $message
+ __msg $level "$message"
}
Oops, something went wrong.

0 comments on commit fc85636

Please sign in to comment.