Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Beginnings of bringing the documentation up to date.

  • Loading branch information...
commit ee2947cc3aa58debebccc3002d51f027671468e4 1 parent cd90eaf
Wayne E. Seguin wayneeseguin authored
Showing with 123 additions and 5,177 deletions.
  1. +7 −19 content/modules/shell/array.haml
  2. +0 −244 content/modules/shell/array/dsl.haml
  3. +0 −2  content/modules/shell/array/dsl.yaml
  4. +29 −0 content/modules/shell/config.haml
  5. 0  content/modules/shell/{defaults.yaml → config.yaml}
  6. +9 −14 content/modules/shell/core.haml
  7. +0 −88 content/modules/shell/core/dsl.haml
  8. +0 −2  content/modules/shell/core/dsl.yaml
  9. +0 −33 content/modules/shell/defaults.haml
  10. +0 −49 content/modules/shell/defaults/dsl.haml
  11. +0 −2  content/modules/shell/defaults/dsl.yaml
  12. +0 −107 content/modules/shell/environment/dsl.haml
  13. +0 −2  content/modules/shell/environment/dsl.yaml
  14. +0 −332 content/modules/shell/extensions/dsl.haml
  15. +0 −2  content/modules/shell/extensions/dsl.yaml
  16. +0 −893 content/modules/shell/filesystem/dsl.haml
  17. +0 −2  content/modules/shell/filesystem/dsl.yaml
  18. +0 −318 content/modules/shell/help/dsl.haml
  19. +0 −2  content/modules/shell/help/dsl.yaml
  20. 0  content/modules/shell/{environment.haml → interactive.haml}
  21. 0  content/modules/shell/{environment.yaml → interactive.yaml}
  22. +6 −19 content/modules/shell/logging.haml
  23. +0 −167 content/modules/shell/logging/dsl.haml
  24. +0 −2  content/modules/shell/logging/dsl.yaml
  25. +5 −18 content/modules/shell/modules.haml
  26. +0 −236 content/modules/shell/modules/dsl.haml
  27. +0 −2  content/modules/shell/modules/dsl.yaml
  28. +8 −33 content/modules/shell/package.haml
  29. +0 −468 content/modules/shell/package/dsl.haml
  30. +0 −2  content/modules/shell/package/dsl.yaml
  31. +0 −46 content/modules/shell/paranoid.haml
  32. +0 −2  content/modules/shell/paranoid.yaml
  33. +0 −21 content/modules/shell/paranoid/dsl.haml
  34. +0 −2  content/modules/shell/paranoid/dsl.yaml
  35. +7 −12 content/modules/shell/project.haml
  36. +0 −62 content/modules/shell/project/dsl.haml
  37. +0 −2  content/modules/shell/project/dsl.yaml
  38. +0 −38 content/modules/shell/rvm.haml
  39. +0 −2  content/modules/shell/rvm.yaml
  40. +0 −83 content/modules/shell/rvm/dsl.haml
  41. +0 −2  content/modules/shell/rvm/dsl.yaml
  42. +7 −38 content/modules/shell/service.haml
  43. +0 −584 content/modules/shell/service/dsl.haml
  44. +0 −2  content/modules/shell/service/dsl.yaml
  45. +9 −23 content/modules/shell/system.haml
  46. +0 −258 content/modules/shell/system/dsl.haml
  47. +0 −2  content/modules/shell/system/dsl.yaml
  48. +8 −14 content/modules/shell/templates.haml
  49. +0 −97 content/modules/shell/templates/dsl.haml
  50. +0 −2  content/modules/shell/templates/dsl.yaml
  51. +6 −14 content/modules/shell/time.haml
  52. +0 −76 content/modules/shell/time/dsl.haml
  53. +0 −2  content/modules/shell/time/dsl.yaml
  54. +0 −44 content/modules/shell/trace.haml
  55. +0 −2  content/modules/shell/trace.yaml
  56. +0 −263 content/modules/shell/trace/dsl.haml
  57. +0 −2  content/modules/shell/trace/dsl.yaml
  58. +8 −19 content/modules/shell/users.haml
  59. +0 −178 content/modules/shell/users/dsl.haml
  60. +0 −2  content/modules/shell/users/dsl.yaml
  61. +6 −17 content/modules/shell/variables.haml
  62. +0 −176 content/modules/shell/variables/dsl.haml
  63. +0 −2  content/modules/shell/variables/dsl.yaml
  64. +8 −8 content/modules/shell/vcs.haml
  65. +0 −20 content/modules/shell/vcs/dsl.haml
  66. +0 −2  content/modules/shell/vcs/dsl.yaml
26 content/modules/shell/array.haml
View
@@ -16,26 +16,14 @@
Array Module
%h2 What it does
-The Array Module adds array manipulation functionality within the BDSM framework, such as push, unshift, length, and join operations.
-%h2 Functions
+The Array Module adds array manipulation functionality within the SM framework,
+such as push, unshift, length, and join operations.
-%pre.code
- :preserve
- array_is_nonempty()
- array_last_element()
- array_first_element()
- array_push()
- array_length()
- array_unshift()
- array_join()
- array_largest()
+%h2 Help us!!!
-%h2
- DSL
-%p
- Read the
- %a{:href => "/modules/shell/array/dsl/"}
- Array module DSL documentation
- for more detail on the individual Array functions.
+This document needs you're help! Please
+%a{:href => "https://github.com/sm/website/edit/master/content/modules/shell/array.haml"}
+ Edit on GitHub
+and send a pull request!
244 content/modules/shell/array/dsl.haml
View
@@ -1,244 +0,0 @@
-.breadcrumbs
- %a{ :href => "/" }
- Documentation
-  > 
- %a{ :href => "/modules/" }
- Modules
-  > 
- %a{ :href => "/modules/shell/" }
- Shell
-  > 
- %a{ :href => "/modules/shell/array/" }
- array
-  > 
- %a{ :href => "/modules/shell/array/dsl/" }
- DSL API :: array
- %hr
-
-%h1
- Module array
-
-%h2 array_is_nonempty()
-%p Checks to see if an array with the name given as the first parameter is nonempty.
-%h4 Input Parameters
-%p The first parameter is the name of the array variable.
-%h4 Stream Outputs
-%p None.
-%h4 Return Codes
-%p
- 0 if the array is non-empty.
- 1 if the array is empty.
-%h4 Failure Scenarios
-%p Fails if the array name, the first parameter, is not given.
-%h4 Usage Examples
-%pre
- %code
- :preserve
- user$ the_array=(1 2 3 4 5)
- user$ array_is_nonempty the_array
- user$ echo $?
- 0
-
- user$ the_array=()
- user$ array_is_nonempty the_array
- user$ echo $?
- 1
-%h2 array_length()
-%p Return the length of the given array.
-%h4 Input Parameters
-%p First parameter is the name of the array variable.
-%h4 Stream Outputs
-%p
- Prints the length of the named array to the STDOUT stream of the calling
- environment.
-%h4 Return Codes
-%p returns 0
-%h4 Failure Scenarios
-%p Fails if the array name, first parameter, is not given.
-%h4 Usage Examples
-%pre
- %code
- :preserve
- user$ the_array=(1 2 3 4 5)
- user$ array_length the_array
- 5
-%h2 array_last_element()
-%p Print the last element of the given array.
-%h4 Input Parameters
-%p First parameter is the name of the array variable.
-%h4 Stream Outputs
-%p
- Prints the last element of the named array to the STDOUT stream of the
- calling environment.
-%h4 Failure Scenarios
-%p Fails if the array name, first parameter, is not given.
-%h4 Return Codes
-%p 0 denoting success
-%h4 Usage Examples
-%pre
- %code
- :preserve
- $ the_array=(one two three four five)
- $ array_last_element the_array
- five
-%h2 array_first_element()
-%p Print the first element of the given array.
-%h4 Input Parameters
-%p First parameter is the name of the array variable.
-%h4 Stream Outputs
-%p
- Prints the first element of the named array to the STDOUT stream of the
- calling environment.
-%h4 Return Codes
-%p 0 denoting success
-%h4 Failure Scenarios
-%p Fails if the array name, the first parameter, is not given.
-%h4 Usage Examples
-%pre
- %code
- :preserve
- $ the_array=(one two three four five)
- $ array_first_element the_array
- one
-%h2 array_push()
-%p Appends one or more elements to the array with the given name.
-%h4 Input Parameters
-%p
- The first parameter is the name of the array variable.
- Remaining parameters are the elements to be appended to the array.
-%h4 Stream Outputs
-%p None.
-%h4 Returns
-%p 0 denoting success
-%h4 Failure Scenarios
-%p
- Fails if the array name, the first parameter, is not given.
- Fails if no elements were given (second paramater and beyond).
-%h4 Usage Examples
-%pre
- %code
- :preserve
- $ the_array=(1 2 3 4 5)
- $ array_length the_array
- 5
-%h2 array_append()
-%p Append elements to a named array.
-%h4 Input Parameters
-%p
- The first parameter is the name of the array variable.
- Remaining parameters are the elements to append to the end of the array.
-%h4 Stream Outputs
-%p None.
-%h4 Returns
-%p 0 denoting success
-%h4 Failure Scenarios
-%p
- Fails if the array name, the first parameter, is not given.
- Fails if no elements were given to append to the array.
-%h4 Usage Examples
-%pre
- %code
- :preserve
- user$ the_array=(1)
- user$ array_append the_array 2 3 4 5
- user$ array_join the_array # print the contents of the array, space separated.
- 1 2 3 4 5
-%h2 array_length()
-%p Return the length of the given array.
-%h4 Input Parameters
-%p The first parameter is the name of the array variable.
-%h4 Stream Outputs
-%p Prints the length of the named array to the STDOUT stream of the calling environment.
-%h4 Usage Examples
-%pre
- %code
- :preserve
- user$ cat $HOME/test
- #!/usr/bin/env bdsm
-
- modules bdsm/array
-
- my_array=(1 2 3 4)
- echo ${my_array[@]}
- array_shift my_array
- echo ${my_array[@]}
-
- user$ $HOME/test
- 1 2 3 4
- 1
- 2 3 4
-%h2 array_unshift()
-%p
- Prepends one or more elements to the array whose name is given, in the order
- given.
-%h4 Input Parameters Parameters
-%p
- The first parameter is the name of the array variable.
- Remaining parameters are the elements to prepend to the array.
-%h4 Stream Outputs
-%p
- None.
- Yields a failure message if no array name was given.
- Yields a failure message if no elements were given to unshift.
-%h4 Return Codes
-%p 0 denoting success
-%h4 Usage Examples
-%pre
- %code
- :preserve
- $ the_array=(2 3 4 5)
- $ array_unshift 1
- user$ array_join the_array # print the contents of the array, space separated.
- 1 2 3 4 5
-
- $ the_array=(4 5)
- $ array_unshift 3 2 1
- user$ array_join the_array # print the contents of the array, space separated.
- 1 2 3 4 5
-%h2 array_join()
-%p Joins the named array into a string separated by either a space or a given string.
-%h4 Input Parameters
-%p
- The first parameter is the name of the array variable.
- The second parameter is the separator between elements in the string, this is optional and defaults to a space.
-%h4 Stream Outputs
-%p
- Prints the elements of the named array, separted by either the 2nd parameter
- if given or else a space character, to the STDOUT stream of the calling
- environment.
-%h4 Return Codes
-%p 0 denoting success
-%h4 Failure Scenarios
-%p Fails if the array name, the first parameter, is not given.
-%h4 Usage Examples
-%pre
- %code
- :preserve
- $ the_array=(1 2 3 4 5)
- $ array_join the_array
- 1 2 3 4 5
-
- $ array_join the_array '.'
- 1.2.3.4.5
-%h2 array_largest()
-%p Outputs the largest element of the array, in the sense of longest string.
-%h4 Input Parameters
-%p The first element is an array variable name.
-%h4 Stream Outputs
-%p
- Prints the largest elements of the named array to the STDOUT
- stream of the calling environment.
-%h4 Return Codes
-%p 0 denoting success
-%h4 Failure Scenarios
-%p Fails if the array name, the first parameter, is not given.
-%h4 Usage Examples
-%pre
- %code
- :preserve
- $ the_array=(1 2 3 4 5)
- $ array_join the_array
- 1 2 3 4 5
-
- $ array_join the_array '.'
- 1.2.3.4.5
2  content/modules/shell/array/dsl.yaml
View
@@ -1,2 +0,0 @@
----
-title: "DSL API :: array"
29 content/modules/shell/config.haml
View
@@ -0,0 +1,29 @@
+.breadcrumbs
+ %a{ :href => "/" }
+ Documentation
+  > 
+ %a{ :href => "/modules/" }
+ Modules
+  > 
+ %a{ :href => "/modules/shell/" }
+ Shell
+  > 
+ %a{ :href => "/modules/shell/config/" }
+ config
+ %hr
+
+%h1
+ config Module
+
+%h2 What it does
+
+The config Module creates a convention for retrieving default settings for a given extension.
+
+%h2 Help us!!!
+
+This document needs you're help! Please
+%a{:href => "https://github.com/sm/website/edit/master/content/modules/shell/config.haml"}
+ Edit on GitHub
+and send a pull request!
+
+
0  content/modules/shell/defaults.yaml → content/modules/shell/config.yaml
View
File renamed without changes
23 content/modules/shell/core.haml
View
@@ -16,20 +16,15 @@
Core Module
%h2 What it does
-The Core Module contains functionality key to the development of the BDSM framework. It's unlikely you'll need to use these functions.
-%h2 Functions
+The Core Module contains functionality key to the development of the SM framework.
+It's unlikely you'll need to use these functions.
+
+%h2 Help us!!!
+
+This document needs you're help! Please
+%a{:href => "https://github.com/sm/website/edit/master/content/modules/shell/core.haml"}
+ Edit on GitHub
+and send a pull request!
-%pre.code
- :preserve
- bdsm_exports()
- bdsm_version()
- NIY()
-%h2
- DSL
-%p
- Read the
- %a{:href => "/modules/shell/core/dsl/"}
- Core module DSL documentation
- for more detail on the individual Core functions.
88 content/modules/shell/core/dsl.haml
View
@@ -1,88 +0,0 @@
-.breadcrumbs
- %a{ :href => "/" }
- Documentation
-  > 
- %a{ :href => "/modules/" }
- Modules
-  > 
- %a{ :href => "/modules/shell/" }
- Shell
-  > 
- %a{ :href => "/modules/shell/core/" }
- core
-  > 
- %a{ :href => "/modules/shell/core/dsl/" }
- DSL API :: core
- %hr
-
-%h1
- Module core
-
-%h2 bdsm_exports()
-%p
- Exports bdsm framework relevant environment variables for extension action
- processes.
-%h4 Input Parameters
-%p None.
-%h4 Stream Outputs
-%p None.
-%h4 Return Codes
-%p 0 for success.
-%h4 Failure Scenarios
-%p No failure scenarios currently.
-%h4 Usage Examples
-%pre
- %code
- :preserve
- user$ bdsm_exports
-%h2 bdsm_version()
-%p Reads the currently installed bdsm version into the variable 'bdsm_version'.
-%h4 Input Parameters
-%p None.
-%h4 Stream Outputs
-%p None.
-%h4 Environmental effects
-%p The variable 'bdsm_version' will be set after the function is executed.
-%h4 Return Codes
-%p 0 for success.
-%h4 Failure Scenarios
-%p No failure scenarios currently.
-%h4 Usage Examples
-%pre
- %code
- :preserve
- user$ bdsm_version
- user$ echo $bdsm_version
- 69.69.69
-%h2 NIY()
-%p
- Prints a failure message and backtrace to the screen letting the caller know
- that the requested feature has not yet been implemented.
-%h4 Input Parameters
-%p None.
-%h4 Stream Outputs
-%p
- Prints "This feature has not yet been implemented." to STDERR of the calling
- environment.
-%h4 Environmental effects
-%p None.
-%h4 Return Codes
-%p None, only exit is through failure.
-%h4 Failure Scenarios
-%p Fails always.
-%h4 Usage Examples
-%pre
- %code
- :preserve
- user$ cat $HOME/test
- #!/usr/bin/env bdsm
- NIY
-
- user$ $HOME/test
- ERROR: This feature has not yet been implemented.
- Backtrace:
- Trace Line Function File
- 3. 262 fail() /usr/local/bdsm/modules/bash/logging/dsl
- 2. 5 NIY() /usr/local/bdsm/modules/bash/extensions/dsl
- 1. 5 main() /Users/wayneeseguin/test
- > modules/bash/logging/dsl fail() 263 $ exit 1
2  content/modules/shell/core/dsl.yaml
View
@@ -1,2 +0,0 @@
----
-title: "DSL API :: core"
33 content/modules/shell/defaults.haml
View
@@ -1,33 +0,0 @@
-.breadcrumbs
- %a{ :href => "/" }
- Documentation
-  > 
- %a{ :href => "/modules/" }
- Modules
-  > 
- %a{ :href => "/modules/shell/" }
- Shell
-  > 
- %a{ :href => "/modules/shell/defaults/" }
- defaults
- %hr
-
-%h1
- Defaults Module
-
-%h2 What it does
-The Defaults Module creates a convention for retrieving default settings for a given extension.
-
-%h2 Functions
-
-%pre.code
- :preserve
- read_default()
-
-%h2
- DSL
-%p
- Read the
- %a{:href => "/modules/shell/defaults/dsl/"}
- Defaults module DSL documentation
- for more detail on the individual Defaults functions.
49 content/modules/shell/defaults/dsl.haml
View
@@ -1,49 +0,0 @@
-.breadcrumbs
- %a{ :href => "/" }
- Documentation
-  > 
- %a{ :href => "/modules/" }
- Modules
-  > 
- %a{ :href => "/modules/shell/" }
- Shell
-  > 
- %a{ :href => "/modules/shell/defaults/" }
- defaults
-  > 
- %a{ :href => "/modules/shell/defaults/dsl/" }
- DSL API :: defaults
- %hr
-
-%h1
- Module defaults
-
-%h2 read_default()
-%p Reads default values from an extension's config/defaults file.
-%h4 Input Parameters
-%p
- First parameter is the defaults file key to read (key=value).
- Second parameter is the variable name to store the retrieved value in.
- Remaining parameters are parsed out as token, value and prefix
- into|as
- %variable{:name => ""}
- prefix
- %name
- %variable # If no specifier.
-%h4 Stream Outputs
-%p None.
-%h4 Environmental effects
-%p
- A variable will be set to the value, if the value is nonempty. If no variable
- name is specified the variable will be assigned the same name as the key.
-%h4 Return Codes
-%p 0 for success.
-%h4 Failure Scenarios
-%p Fails if no arguments are passed in, at least need to specify a key.
-%h4 Usage Examples
-%pre
- %code
- :preserve
- user$ read_default "version" prefix "package" # extension is nginx for example
- user$ echo $package_version
- 1.0.0
2  content/modules/shell/defaults/dsl.yaml
View
@@ -1,2 +0,0 @@
----
-title: "DSL API :: defaults"
107 content/modules/shell/environment/dsl.haml
View
@@ -1,107 +0,0 @@
-.breadcrumbs
- %a{ :href => "/" }
- Documentation
-  > 
- %a{ :href => "/modules/" }
- Modules
-  > 
- %a{ :href => "/modules/shell/" }
- Shell
-  > 
- %a{ :href => "/modules/shell/environment/" }
- environment
-  > 
- %a{ :href => "/modules/shell/environment/dsl/" }
- DSL API :: environment
- %hr
-
-%h1
- Module environment
-
-%h2 command_exists()
-%p Checks to see whether a command exists within the current environment and PATH
-%h4 Input Parameters
-%p First parameter is a command name.
-%h4 Stream Outputs
-%p None.
-%h4 Environmental effects
-%p none.
-%h4 return codes
-%p
- 0 if the command was found in the current environment
- 1 if the command was not found in the current environment
-%h4 failure scenarios
-%p Fails if no command name was given.
-%h4 usage examples
-%pre
- %code
- :preserve
- user$ command_exists adsf
- user$ echo $?
- 1
-
- user$ command_exists ls
- user$ echo $?
- 0
-%h2 is_a_function()
-%p Checks to see whether a named function exists within the current environment
-%h4 Input Parameters
-%p First parameter is a command name.
-%h4 Stream Outputs
-%p None.
-%h4 Environmental effects
-%p none.
-%h4 return codes
-%p
- 0 if the function exists
- 1 if the function does not exist
-%h4 failure scenarios
-%p Fails if no function name was given.
-%h4 usage examples
-%pre
- %code
- :preserve
- user$ is_a_function rvm
- user$ echo $?
- 0
-
- user$ is_a_function asdf
- user$ echo $?
- 1
-
- user$ is_a_function ls
- user$ echo $?
- 1
-%h2 shell_is_interactive()
-%p Checks if the currently running shell is interactive (user controlled).
-%h4 Input Parameters
-%p None.
-%h4 Stream Outputs
-%p None.
-%h4 Environmental effects
-%p none.
-%h4 return codes
-%p
- 0 if the shell is interactive (user controlled)
- 1 if the shell is not interactive
-%h4 failure scenarios
-%p None currently.
-%h4 usage examples
-%p
- user$ cat $HOME/test
- \!/usr/bin/env bdsm
-
- modules bdsm/environment # Load the environment module.
-%p
- if shell_is_interactive
- then
- echo "Shell is Interactive! "
- else
- echo "Shell is Not Interactive! "
- fi
-%p
- user$ "$HOME/test"
- Shell is Not Interactive!
-%p
- user$ source "$HOME/test"
- Shell is Interactive!
2  content/modules/shell/environment/dsl.yaml
View
@@ -1,2 +0,0 @@
----
-title: "DSL API :: environment"
332 content/modules/shell/extensions/dsl.haml
View
@@ -1,332 +0,0 @@
-.breadcrumbs
- %a{ :href => "/" }
- Documentation
-  > 
- %a{ :href => "/modules/" }
- Modules
-  > 
- %a{ :href => "/modules/shell/" }
- Bash
-  > 
- %a{ :href => "/modules/shell/extensions/" }
- extensions
-  > 
- %a{ :href => "/modules/shell/extensions/dsl/" }
- DSL API :: extensions
- %hr
-
-%h1
- Module extensions
-
-%h2 extension_action()
-%p
- Load the environment for a given extension action and then call it.
- This is the main function for BDSM.
-%h4 Input Parameters
-%p One or more extension names.
-%h4 Stream Outputs
-%p None.
-%h4 Environmental effects
-%p
- The current extension's initialize file will be resourced into the current
- environment.
-%h4 Return Codes
-%p
- 0 for success
- 1 for failure
-%h4 Failure Scenarios
-%p
- Fails if no extension was given.
- Fails if no action was given.
-%h4 Usage Examples
-%pre
- %code
- :preserve
- $ cat $HOME/test
- #!/usr/bin/env bdsm
-
- modules bdsm/extensions
- extension_action ext list
-
- $ $HOME/test
- bash fossil git libevent nginx p7zip postgresql rails redis srv tig tmux zeromq zlib
-%h2 extensions_install()
-%p Installs the given extensions.
-%h4 Input Parameters
-%p One or more extension names.
-%h4 Stream Outputs
-%p None.
-%h4 Environmental effects
-%p
- The named extensions will be installed to the filesystem in the BDSM
- extensions directory.
-%h4 Return Codes
-%p 0 for success
-%h4 Failure Scenarios
-%p Fails if no extensions are passed in to install.
-%h4 Usage Examples
-%pre
- %code
- :preserve
- user$ extensions_install libevent tmux
-%h2 extension_reload()
-%p Reloads (re-sources) the current extension's DSL and initialization files.
-%h4 Input Parameters
-%p None.
-%h4 Stream Outputs
-%p None.
-%h4 Environmental effects
-%p
- The current extension's DSL and initialization files are re-sourced into the
- calling environment.
-%h4 Return Codes
-%p 0 for success
-%h4 Failure Scenarios
-%p No current failure scenarios.
-%h4 Usage Examples
-%pre
- %code
- :preserve
- user$ extension_reload
-%h2 extension_reinitialize()
-%p Reinitializes the current extension.
-%h4 Input Parameters
-%p None.
-%h4 Stream Outputs
-%p None.
-%h4 Environmental effects
-%p
- The current extension's initialize file will be resourced into the current
- environment.
-%h4 Return Codes
-%p 0 for success
-%h4 Failure Scenarios
-%p No failure scenarios currently.
-%h4 Usage Examples
-%pre
- %code
- :preserve
- user$ extension_reinitialize
-%h2 extension_version()
-%p Outputs the named extension's version
-%h4 Input Parameters
-%p First parameter must be the name of an extension.
-%h4 Stream Outputs
-%p The extension-version string for the named extension.
-%h4 Environmental effects
-%p None.
-%h4 Return Codes
-%p 0 for success
-%h4 Failure Scenarios
-%p Fails if the extension name is not given.
-%h4 Usage Examples
-%pre
- %code
- :preserve
- user$ extension_reinitialize
-%h2 extension_licence()
-%p Emits the extension's license file, if it exists.
-%h4 Input Parameters
-%p First parameter may optionally be an extension name.
-%h4 Stream Outputs
-%p If the extension has a LICENSE file then it wil be printed to STDOUT.
-%h4 Environmental effects
-%p None.
-%h4 Return Codes
-%p 0 for success.
-%h4 Failure Scenarios
-%p No failure scenarios currently exist.
-%h4 Usage Examples
-%pre
- %code
- :preserve
- $ cat $HOME/test
- !/usr/bin/env bash
- source "/usr/local/bdsm/modules/bash/core/initialize" # Load BDSM framework core.
- modules extensions
- extension_license postgresql
-
- $ $HOME/test
- Copyright (c) 2009-2011 Wayne E. Seguin
-
- Licensed under the Apache License, Version 2.0 (the \"License\");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an \"AS IS\" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-%h2 extensions_installed()
-%p Lists the extensions installed on the currently running process's system.
-%h4 Input Parameters
-%p None.
-%h4 Stream Outputs
-%p
- The names of the currently installed non-core extensions are printed to the
- calling environment's STDOUT.
-%h4 Environmental effects
-%p None.
-%h4 Return Codes
-%p 0 for success.
-%h4 Failure Scenarios
-%p No failure scenarios currently.
-%h4 Usage Examples
-%pre
- %code
- :preserve
- $ cat $HOME/test
- #!/usr/bin/env bash
- source "/usr/local/bdsm/modules/bash/core/initialize" # Load BDSM framework core.
- modules extensions
- extensions_installed
-
- $ $HOME/test
- bash fossil git libevent nginx p7zip postgresql rails redis tig tmux zeromq zlib
-%h2 extensions_available()
-%p
- Lists the extensions available to install on the currently running process's
- system.
-%h4 Input Parameters
-%p None.
-%h4 Stream Outputs
-%p
- The names of the available to install non-core extensions are printed to the
- calling environment's STDOUT.
-%h4 Environmental effects
-%p None.
-%h4 Return Codes
-%p 0 for success.
-%h4 Failure Scenarios
-%p No failure scenarios currently.
-%h4 Usage Examples
-%pre
- %code
- :preserve
- $ cat $HOME/test
- #!/usr/bin/env bash
- source "/usr/local/bdsm/modules/bash/core/initialize" # Load BDSM framework core.
- modules extensions
- extensions_available
- $ $HOME/test
- ack androidsdk apache bash bcrypt cacti cmake ctags curl deploy erlang fossil freetype ghc ghostscript git god iconv imagemagick jpeg keepalived lcms libevent libpng libwmf libxml2 libxslt logrotate lua memcached mercurial mongodb monit mysql nginx node npm openpkg openssl p7zip passenger pcre perl postgresql r rails rainbows readline redis riak rsync rvm screen sphinx sqlite3 subversion system thin tiff tig tmux unicorn unrar zeromq zlib zsh
-%h2 extensions_in_development()
-%p Lists the extensions available in the development repository, if set.
-%h4 Input Parameters
-%p None.
-%h4 Stream Outputs
-%p
- The names of the available to install non-core development repository
- extensions are printed to the calling environment's STDOUT, if defined.
-%h4 Environmental effects
-%p None.
-%h4 Return Codes
-%p 0 for success.
-%h4 Failure Scenarios
-%p No failure scenarios currently.
-%h4 Usage Examples
-%pre
- %code
- :preserve
- $ cat $HOME/test
- #!/usr/bin/env bash
- source "/usr/local/bdsm/modules/bash/core/initialize" # Load BDSM framework core.
- modules extensions
- extensions_in_development
- $ $HOME/test
- ack androidsdk apache bash bcrypt cacti cmake ctags curl deploy erlang fossil freetype ghc ghostscript git god iconv imagemagick jpeg keepalived lcms libevent libpng libwmf libxml2 libxslt logrotate lua memcached mercurial mongodb monit mysql nginx node npm openpkg openssl p7zip passenger pcre perl postgresql r rails rainbows readline redis riak rsync rvm screen sphinx sqlite3 subversion system thin tiff tig tmux unicorn unrar zeromq zlib zsh
-%h2 extensions_in()
-%p Lists the extensions in a given directory.
-%h4 Input Parameters
-%p
- First parameter is a full path a BDSM extensions directory.
- (example: /usr/local/bdsm/extensions)
-%h4 Stream Outputs
-%p
- The names of the extensions in the given directory are printed to the
- calling environment's STDOUT.
-%h4 Environmental effects
-%p None.
-%h4 Return Codes
-%p 0 for success.
-%h4 Failure Scenarios
-%p No failure scenarios currently.
-%h4 Usage Examples
-%pre
- %code
- :preserve
- $ cat $HOME/test
- #!/usr/bin/env bash
- source "/usr/local/bdsm/modules/bash/core/initialize" # Load BDSM framework core.
- modules extensions
- extensions_in /usr/local/bdsm/extensions
-
- $ $HOME/test
- bash fossil git libevent nginx p7zip postgresql rails redis tig tmux zeromq zlib
-%h2 extension_actions()
-%p Lists actions exposed by the named extension.
-%h4 Input Parameters
-%p First parameter is the name of the extension to list actions for.
-%h4 Stream Outputs
-%p
- The names of the extensions in the given directory are printed to the
- calling environment's STDOUT.
-%h4 Environmental effects
-%p None.
-%h4 Return Codes
-%p 0 for success.
-%h4 Failure Scenarios
-%p Fails if no extension name is given.
-%h4 Usage Examples
-%pre
- %code
- :preserve
- $ cat $HOME/test
- #!/usr/bin/env bash
- source "/usr/local/bdsm/modules/bash/core/initialize" # Load BDSM framework core.
- modules extensions
- extension_actions "postgresql"
-
- $ $HOME/test
- backup configure help initialize install restart start status stop uninstall upgrade
-%h2 extension_is_installed()
-%p Tests if a given extension is installed.
-%h4 Input Parameters
-%p First parameter is an extension name.
-%h4 Stream Outputs
-%p None.
-%h4 Environmental effects
-%p None.
-%h4 Return Codes
-%p
- 0 if the extension is installed.
- 1 if the extension is not installed.
-%h4 Failure Scenarios
-%p Fails if no extension name is given.
-%h4 Usage Examples
-%pre
- %code
- :preserve
- $ cat $HOME/test
- #!/usr/bin/env bash
- source "/usr/local/bdsm/modules/bash/core/initialize" # Load BDSM framework core.
- modules extensions
- extensions_installed
- echo
- for extension in postgresql asdf
- do
- if extension_is_installed "${extension}"
- then
- echo "${extension} is installed! "
- else
- echo "${extension} is NOT installed! "
- fi
- done
-
- $ $HOME/test
- bash fossil git libevent mysql nginx node npm p7zip postgresql rails redis tig tmux zeromq zlib
- postgresql is installed!
- asdf is NOT installed!
2  content/modules/shell/extensions/dsl.yaml
View
@@ -1,2 +0,0 @@
----
-title: "DSL API :: extensions"
893 content/modules/shell/filesystem/dsl.haml
View
@@ -1,893 +0,0 @@
-.breadcrumbs
- %a{ :href => "/" }
- Documentation
-  > 
- %a{ :href => "/modules/" }
- Modules
-  > 
- %a{ :href => "/modules/shell/" }
- Bash
-  > 
- %a{ :href => "/modules/shell/filesystem/" }
- filesystem
-  > 
- %a{ :href => "/modules/shell/filesystem/dsl/" }
- DSL API :: filesystem
- %hr
-
-%h1
- Module filesystem
-
-%h1 source_files
-%p Safely source files only if they exists and are nonempty.
-%h4 Input Parameters
-%p One or more files.
-%h4 Stream Outputs
-%p None.
-%h4 Environmental effects
-%p Nonempty files given will be sourced into the calling environment.
-%h4 Return Codes
-%p 0 for success
-%h4 Failure Scenarios
-%p Fails if no files are given to sources.
-%h4 Usage Examples
-%pre
- %code
- :preserve
- user$ source_files "$HOME/.dotfiles/scripts/functions"
-%h1 nonempty_files
-%p Outputs a subset of the named files that are nonempty.
-%h4 Input Parameters
-%p One or more files.
-%h4 Stream Outputs
-%p
- Each nonempty filename parameter will be printed to STDOUT of the calling
- environment.
-%h4 Environmental effects
-%p None.
-%h4 Return Codes
-%p 0 for success
-%h4 Failure Scenarios
-%p Fails if no file names are given as arguments.
-%h4 Usage Examples
-%pre
- %code
- :preserve
- user$ nonempty_files a $HOME/.bdmsrc c
- /Users/wayneeseguin/.bdsmrc
-%h1 ensure_paths_exist
-%p
- Iterates over the list of given paths, creates the directory if it
- does not exist.
-%h4 Input Parameters
-%p A list of paths to create if missing.
-%h4 Stream Outputs
-%p None.
-%h4 Environmental effects
-%p Paths that were given but do not exist will be created.
-%h4 Return Codes
-%p 0 for success
-%h4 Failure Scenarios
-%p Fails if no paths were given to.
-%h4 Usage Examples
-%pre
- %code
- :preserve
- user$ ls -a
- . ..
- user$ ensure_paths_exist a b c
- user$ ls -a
- . .. a b c
-%h1 remove_files
-%p Removes the given files, if they exist.
-%h4 Input Parameters
-%p One or more file names/paths.
-%h4 Stream Outputs
-%p None.
-%h4 Environmental effects
-%p
- The named files will no longer exist on the system, if they existed to begin
- with.
-%h4 Return Codes
-%p 0 for success
-%h4 Failure Scenarios
-%p
- Fails if no files were named.
- Fails if a named file is a directory.
- Fails if a named file exists but is not a file.
-%h4 Usage Examples
-%pre
- %code
- :preserve
- user$ touch a b c
- user$ ls -a
- . .. a b c
- user$ remove_files a b c
- user$ ls
- . ..
-%h1 remove_paths
-%p Function Description
-%h4 Input Parameters
-%p Positional Parameter listing and descriptions.
-%h4 Stream Outputs
-%p What gets printed to STDOUT and STDERROR. 'None.' if nothing is output.
-%h4 Environmental effects
-%p What, if any, environmental side effects this function causes. 'None.' for none.
-%h4 Return Codes
-%p
- 0 if ...
- 1 if ...
-%h4 Failure Scenarios
-%p Fails if ...
-%h4 Usage Examples
-%pre
- %code
- :preserve
- user$ {{ setup the scenario }}
- user$ function_name {{ parameters }}
- user$ {{ demonstrate the results}}
-%h1 ensure_files_exist
-%p
- Iterates over the list of given files, creates the directory if it
- does not exist.
-%h4 Input Parameters
-%p A list of files to create if missing.
-%h4 Stream Outputs
-%p None.
-%h4 Environmental effects
-%p files that were given but do not exist will be created.
-%h4 Return Codes
-%p 0 for success
-%h4 Failure Scenarios
-%p Fails if no files were given to.
-%h4 Usage Examples
-%pre
- %code
- :preserve
- user$ ls -a
- . ..
- user$ ensure_files_exist a b c
- user$ ls -a
- . .. a b c
-%h1 ensure_files_are_executable
-%p Sets the executable bits on a file if it is not executable.
-%h4 Input Parameters
-%p One or more file name/paths
-%h4 Stream Outputs
-%p None.
-%h4 Environmental effects
-%p Files that were given and not executable will have their execute bits set.
-%h4 Return Codes
-%p 0 for success.
-%h4 Failure Scenarios
-%p
- Fails if no files were given as parameters.
- Fails if one of the files given was a directory.
- Fails if one of the files given does not exist.
- Fails if one of the files paths does not exist.
-%h4 Usage Examples
-%pre
- %code
- :preserve
- user$ ensure_files_are_executable /etc/rc.d/postgresql
-%h1 link
-%p Create a symlink from source to target.
-%h4 Input Parameters
-%p
- First parameter is the source
- Second parameter is the target
-%h4 Stream Outputs
-%p None.
-%h4 Environmental effects
-%p Symlink is created if no failure conditions are triggered.
-%h4 Return Codes
-%p 0 for success
-%h4 Failure Scenarios
-%p
- Fails if target exists and is a file.
- Fails if target exists and is a directory.
-%h4 Usage Examples
-%p The following usages are equivalent
-%pre
- %code
- :preserve
- user$ link from /home/user/.vim/vimrc to /home/user/.vimrc
- user$ link /home/user/.vim/vimrc to /home/user/.vimrc
- user$ link /home/user/.vim/vimrc /home/user/.vimrc
-%h1 move_directory
-%p
- Moves a directory from one location to another.
- (This is also used to rename a directory.)
-%h4 Input Parameters
-%p
- The first parameter is the source directory name
- The second parameter is the target directory name
-%h4 Stream Outputs
-%p None.
-%h4 Environmental effects
-%p If successful, a directory is renamed (moved).
-%h4 Return Codes
-%p 0 for success.
-%h4 Failure Scenarios
-%p
- Fails if the source directory is not specified.
- Fails if the target directory is not specified.
-%h4 Usage Examples
-%pre
- %code
- :preserve
- user$ move_directory "freetds-0.91rc"* to "freetds-0.91"
-%h1 move_file
-%p
- Moves a file from one location to another.
- (This is also used to rename a file.)
-%h4 Input Parameters
-%p
- The first parameter is the source file name
- The second parameter is the target file name
-%h4 Stream Outputs
-%p None.
-%h4 Environmental effects
-%p If successful, a file is renamed (moved).
-%h4 Return Codes
-%p 0 for success.
-%h4 Failure Scenarios
-%p
- Fails if the source file is not specified.
- Fails if the target file is not specified.
-%h4 Usage Examples
-%pre
- %code
- :preserve
- user$ move_file "$HOME/.bashrc" to "$HOME/.bashrc.orig"
-%h1 copy_file
-%p
- Copys a file from one location to another.
- (This is also used to rename a file.)
-%h4 Input Parameters
-%p
- The first parameter is the source file name
- The second parameter is the target file name
-%h4 Stream Outputs
-%p None.
-%h4 Environmental effects
-%p If successful, a file is renamed (copyd).
-%h4 Return Codes
-%p 0 for success.
-%h4 Failure Scenarios
-%p
- Fails if the source file is not specified.
- Fails if the target file is not specified.
-%h4 Usage Examples
-%pre
- %code
- :preserve
- user$ copy_file "$HOME/.bashrc" to "$HOME/.bashrc.orig"
-%h1 copy_files_to
-%p Copys a given list of files into the named path.
-%h4 Input Parameters
-%p
- The first parameter is the path to copy the files into.
- Remaining parameters are the file name/path list.
-%h4 Stream Outputs
-%p None.
-%h4 Environmental effects
-%p If successful, all named files are copied into the target path.
-%h4 Return Codes
-%p 0 for success.
-%h4 Failure Scenarios
-%p
- Fails if no target path is given.
- Fails if no files are given.
-%h4 Usage Examples
-%pre
- %code
- :preserve
- user$ copy_files_to "$HOME/backup" "$HOME/.bashrc" "$HOME/.bash_profile"
-%h1 copy_directories_to
-%p Copys a given list of directories into the named path.
-%h4 Input Parameters
-%p
- The first parameter is the path to copy the directorys into.
- Remaining parameters are the directory name/path list.
-%h4 Stream Outputs
-%p None.
-%h4 Environmental effects
-%p If successful, all named directories are copied into the target path.
-%h4 Return Codes
-%p 0 for success.
-%h4 Failure Scenarios
-%p
- Fails if no target path is given.
- Fails if no directories are given.
-%h4 Usage Examples
-%pre
- %code
- :preserve
- user$ copy_directories_to "$HOME/backup/" "$HOME/bin" "$HOME/projects"
-%h1 copy_directory
-%p
- Copys a directory from one location to another.
- (This is also used to rename a directory.)
-%h4 Input Parameters
-%p
- The first parameter is the source directory name
- The second parameter is the target directory name
-%h4 Stream Outputs
-%p None.
-%h4 Environmental effects
-%p If successful, a directory is renamed (copyd).
-%h4 Return Codes
-%p 0 for success.
-%h4 Failure Scenarios
-%p
- Fails if the source directory is not specified.
- Fails if the target directory is not specified.
-%h4 Usage Examples
-%pre
- %code
- :preserve
- user$ copy_directory "freetds-0.91rc"* to "freetds-0.91"
-%h1 move_files_to
-%p Moves a given list of files into the named path.
-%h4 Input Parameters
-%p
- The first parameter is the path to move the files into.
- Remaining parameters are the file name/path list.
-%h4 Stream Outputs
-%p None.
-%h4 Environmental effects
-%p If successful, all named files are copied into the target path.
-%h4 Return Codes
-%p 0 for success.
-%h4 Failure Scenarios
-%p
- Fails if no target path is given.
- Fails if no files are given.
-%h4 Usage Examples
-%pre
- %code
- :preserve
- user$ move_files_to "$HOME/backup" "$HOME/.bashrc" "$HOME/.bash_profile"
-%h1 chown_files
-%p Change ownership of a list of files.
-%h4 Input Parameters
-%p
- First parameter is the new owner[:group] of the files.
- Remaining parameters are the file names/paths.
-%h4 Stream Outputs
-%p None.
-%h4 Environmental effects
-%p None.
-%h4 Return Codes
-%p 0 for success
-%h4 Failure Scenarios
-%p
- Fails if no new owner[:group] was specified.
- Fails if no list of files was given.
-%h4 Usage Examples
-%pre
- %code
- :preserve
- user$ chown_files $USER "$HOME/.bashrc" "$HOME/.bash_profile"
-%h1 chown_paths
-%p Change ownership of a list of paths.
-%h4 Input Parameters
-%p
- First parameter is the new owner[:group] of the paths.
- Remaining parameters are the path names/paths.
-%h4 Stream Outputs
-%p None.
-%h4 Environmental effects
-%p None.
-%h4 Return Codes
-%p 0 for success
-%h4 Failure Scenarios
-%p
- Fails if no new owner[:group] was specified.
- Fails if no list of paths was given.
-%h4 Usage Examples
-%pre
- %code
- :preserve
- user$ chown_paths $USER "$HOME" "/usr/local"
-%h1 chown_paths_recursively
-%p Change ownership of a list of paths, recursively.
-%h4 Input Parameters
-%p
- First parameter is the new owner[:group] of the paths.
- Remaining parameters are the path names/paths.
-%h4 Stream Outputs
-%p None.
-%h4 Environmental effects
-%p None.
-%h4 Return Codes
-%p 0 for success
-%h4 Failure Scenarios
-%p
- Fails if no new owner[:group] was specified.
- Fails if no list of paths was given.
-%h4 Usage Examples
-%pre
- %code
- :preserve
- user$ chown_paths_recursively $USER "$HOME" "/usr/local"
-%h1 chmod_files
-%p Change ownership of a list of files.
-%h4 Input Parameters
-%p
- First parameter is the new owner[:group] of the files.
- Remaining parameters are the file names/files.
-%h4 Stream Outputs
-%p None.
-%h4 Environmental effects
-%p None.
-%h4 Return Codes
-%p 0 for success
-%h4 Failure Scenarios
-%p
- Fails if no new owner[:group] was specified.
- Fails if no list of files was given.
-%h4 Usage Examples
-%pre
- %code
- :preserve
- user$ chmod_files $USER "$HOME" "/usr/local"
-%h1 chmod_paths
-%p Change ownership of a list of paths.
-%h4 Input Parameters
-%p
- First parameter is the new owner[:group] of the paths.
- Remaining parameters are the path names/paths.
-%h4 Stream Outputs
-%p None.
-%h4 Environmental effects
-%p None.
-%h4 Return Codes
-%p 0 for success
-%h4 Failure Scenarios
-%p
- Fails if no new owner[:group] was specified.
- Fails if no list of paths was given.
-%h4 Usage Examples
-%pre
- %code
- :preserve
- user$ chmod_paths $USER "$HOME" "/usr/local"
-%h1 chmod_paths_recursively
-%p Change ownership of a list of paths, recursively.
-%h4 Input Parameters
-%p
- First parameter is the new owner[:group] of the paths.
- Remaining parameters are the path names/paths.
-%h4 Stream Outputs
-%p None.
-%h4 Environmental effects
-%p None.
-%h4 Return Codes
-%p 0 for success
-%h4 Failure Scenarios
-%p
- Fails if no new owner[:group] was specified.
- Fails if no list of paths was given.
-%h4 Usage Examples
-%pre
- %code
- :preserve
- user$ chmod_paths_recursively $USER "$HOME" "/usr/local"
-%h1 enter
-%p
- Changes the current working directory ($PWD) to the given directory with
- sanity checks.
-%h4 Input Parameters
-%p First parameter is the directory to change into.
-%h4 Stream Outputs
-%p None.
-%h4 Environmental effects
-%p
- The current working directory (PWD) will become the given directory if
- successful.
-%h4 Return Codes
-%p 0 for success
-%h4 Failure Scenarios
-%p
- Fails if no directory was given.
- Fails if the given directory does not exist.
-%h4 Usage Examples
-%pre
- %code
- :preserve
- user$ enter "/usr/local/src"
-%h1 hash_file
-%p Set and get key/value pairs from a given has file.
-%h4 Input Parameters
-%p
- The first parameter is the file name/path for the hash file.
- The second parameter is the key name.
- The third (optional) parameter is the value to assign to the given key.
-%h4 Stream Outputs
-%p The value of the key retrieved is printed if no value parameter was given.
-%h4 Environmental effects
-%p
- If a value parameter was given the key=value pair is written to the named
- hash file.
-%h4 Return Codes
-%p 0 for success
-%h4 Failure Scenarios
-%p
- Fails if no file name/path was provided.
- Fails if no key name was given.
- Fails if the file path does not exist.
-%h4 Usage Examples
-%pre
- %code
- :preserve
- user$ hash_file /usr/local/bdsm/extensions/core/config/defaults website_url
- https://bdsm.beginrescueend.com/
-%h1 file_is_executable
-%p Check if a file name/path is executable.
-%h4 Input Parameters
-%p First parameter is a file name/path.
-%h4 Stream Outputs
-%p None.
-%h4 Environmental effects
-%p None.
-%h4 Return Codes
-%p
- 0 if the named file is executable.
- 1 if the named file is not executable or does not exist.
-%h4 Failure Scenarios
-%p Fails if no file name/path was given.
-%h4 Usage Examples
-%pre
- %code
- :preserve
- user$ file_is_executable /bin/bash
- user$ echo $?
- 0
-
- user$ file_is_executable /bin/asdfasdf
- user$ echo $?
- 1
-%h1 file_exists
-%p Check if a file name/path exists.
-%h4 Input Parameters
-%p First parameter is a file name/path.
-%h4 Stream Outputs
-%p None.
-%h4 Environmental effects
-%p None.
-%h4 Return Codes
-%p
- 0 if the named file exists.
- 1 if the named file does not exist or does not exist.
-%h4 Failure Scenarios
-%p Fails if no file name/path was given.
-%h4 Usage Examples
-%pre
- %code
- :preserve
- user$ file_exists /bin/bash
- user$ echo $?
- 0
-
- user$ file_exists /bin/asdfasdf
- user$ echo $?
- 1
-%h1 file_is_nonempty
-%p Check if a file name/path is nonempty.
-%h4 Input Parameters
-%p First parameter is a file name/path.
-%h4 Stream Outputs
-%p None.
-%h4 Environmental effects
-%p None.
-%h4 Return Codes
-%p
- 0 if the named file is nonempty.
- 1 if the named file is empty or does not exist.
-%h4 Failure Scenarios
-%p Fails if no file name/path was given.
-%h4 Usage Examples
-%pre
- %code
- :preserve
- user$ file_is_nonempty /bin/bash
- user$ echo $?
- 0
-
- user$ file_is_nonempty /bin/asdfasdf
- user$ echo $?
- 1
-%h1 file_is_empty
-%p Check if a file name/path is empty.
-%h4 Input Parameters
-%p First parameter is a file name/path.
-%h4 Stream Outputs
-%p None.
-%h4 Environmental effects
-%p None.
-%h4 Return Codes
-%p
- 0 if the named file is empty.
- 1 if the named file is not empty or does not exist.
-%h4 Failure Scenarios
-%p Fails if no file name/path was given.
-%h4 Usage Examples
-%pre
- %code
- :preserve
- user$ file_is_empty /bin/bash
- user$ echo $?
- 1
-
- user$ file_is_empty /bin/asdfasdf
- user$ echo $?
- 0
-%h1 file_is_missing
-%p Check if a file name/path is missing.
-%h4 Input Parameters
-%p First parameter is a file name/path.
-%h4 Stream Outputs
-%p None.
-%h4 Environmental effects
-%p None.
-%h4 Return Codes
-%p
- 0 if the named file is missing.
- 1 if the named file is not missing or does not exist.
-%h4 Failure Scenarios
-%p Fails if no file name/path was given.
-%h4 Usage Examples
-%pre
- %code
- :preserve
- user$ file_is_missing /bin/bash
- user$ echo $?
- 1
-
- user$ file_is_missing /bin/asdfasdf
- user$ echo $?
- 0
-%h1 file_is_empty_or_missing
-%p Check if a file name/path is empty or missing.
-%h4 Input Parameters
-%p First parameter is a file name/path.
-%h4 Stream Outputs
-%p None.
-%h4 Environmental effects
-%p None.
-%h4 Return Codes
-%p
- 0 if the named file is empty or missing.
- 1 if the named file exists or is nonempty.
-%h4 Failure Scenarios
-%p Fails if no file name/path was given.
-%h4 Usage Examples
-%pre
- %code
- :preserve
- user$ file_is_missing /bin/bash
- user$ echo $?
- 1
-
- user$ file_is_missing /bin/asdfasdf
- user$ echo $?
- 0
-%h1 file_contains()
-%p Checks if a named file contains a given string/unix regexp pattern.
-%h4 Input Parameters
-%p
- First parameter is the file name/path.
- Second parameter is the pattern to match.
-%h4 Stream Outputs
-%p None.
-%h4 Environmental effects
-%p None.
-%h4 Return Codes
-%p
- 0 if the given file contains the given pattern.
- 1 if the given file does not contain the given pattern.
-%h4 Failure Scenarios
-%p
- Fails if the file path/name was not given
- Fails if the pattern is not given.
- Fails if the file path/name given either does not exist or is not a file.
-%h4 Usage Examples
-%pre
- %code
- :preserve
- user$ cat "$HOME/test"
- #!/usr/bin/env bdsm
-
- modules bdsm/filesystem
-
- if file_contains "$HOME/.bdsmrc" ".*w00t.*"
- then
- echo "w00t! "
- else
- echo "no w00t :("
- fi
-
- user$ "$HOME/test"
- no w00t :(
-%h1 symlink_exists
-%p Check if a symlink name/path exists.
-%h4 Input Parameters
-%p First parameter is a symlink name/path.
-%h4 Stream Outputs
-%p None.
-%h4 Environmental effects
-%p None.
-%h4 Return Codes
-%p
- 0 if the named symlink exists.
- 1 if the named symlink does not exist or does not exist.
-%h4 Failure Scenarios
-%p Fails if no symlink name/path was given.
-%h4 Usage Examples
-%pre
- %code
- :preserve
- user$ symlink_exists /usr/local/bin/bdsm
- user$ echo $?
- 0
-
- user$ symlink_exists /bin/asdfasdf
- user$ echo $?
- 1
-%h1 directory_exists
-%p Check if a directory name/path exists.
-%h4 Input Parameters
-%p First parameter is a directory name/path.
-%h4 Stream Outputs
-%p None.
-%h4 Environmental effects
-%p None.
-%h4 Return Codes
-%p
- 0 if the named directory exists.
- 1 if the named directory does not exist or does not exist.
-%h4 Failure Scenarios
-%p Fails if no directory name/path was given.
-%h4 Usage Examples
-%pre
- %code
- :preserve
- user$ directory_exists /usr/local/bin/bdsm
- user$ echo $?
- 0
-
- user$ directory_exists /bin/asdfasdf
- user$ echo $?
- 1
-%h1 function_name
-%p Function Description
-%h4 Input Parameters
-%p Positional Parameter listing and descriptions.
-%h4 Stream Outputs
-%p What gets printed to STDOUT and STDERROR. 'None.' if nothing is output.
-%h4 Environmental effects
-%p What, if any, environmental side effects this function causes. 'None.' for none.
-%h4 Return Codes
-%p
- 0 if ...
- 1 if ...
-%h4 Failure Scenarios
-%p Fails if ...
-%h4 Usage Examples
-%pre
- %code
- :preserve
- user$ {{ setup the scenario }}
- user$ function_name {{ parameters }}
- user$ {{ demonstrate the results}}
-%h1 function_name
-%p Function Description
-%h4 Input Parameters
-%p Positional Parameter listing and descriptions.
-%h4 Stream Outputs
-%p What gets printed to STDOUT and STDERROR. 'None.' if nothing is output.
-%h4 Environmental effects
-%p What, if any, environmental side effects this function causes. 'None.' for none.
-%h4 Return Codes
-%p
- 0 if ...
- 1 if ...
-%h4 Failure Scenarios
-%p Fails if ...
-%h4 Usage Examples
-%pre
- %code
- :preserve
- user$ {{ setup the scenario }}
- user$ function_name {{ parameters }}
- user$ {{ demonstrate the results}}
-%h1 function_name
-%p Function Description
-%h4 Input Parameters
-%p Positional Parameter listing and descriptions.
-%h4 Stream Outputs
-%p What gets printed to STDOUT and STDERROR. 'None.' if nothing is output.
-%h4 Environmental effects
-%p What, if any, environmental side effects this function causes. 'None.' for none.
-%h4 Return Codes
-%p
- 0 if ...
- 1 if ...
-%h4 Failure Scenarios
-%p Fails if ...
-%h4 Usage Examples
-%pre
- %code
- :preserve
- user$ {{ setup the scenario }}
- user$ function_name {{ parameters }}
- user$ {{ demonstrate the results}}
-%h1 function_name
-%p Function Description
-%h4 Input Parameters
-%p Positional Parameter listing and descriptions.
-%h4 Stream Outputs
-%p What gets printed to STDOUT and STDERROR. 'None.' if nothing is output.
-%h4 Environmental effects
-%p What, if any, environmental side effects this function causes. 'None.' for none.
-%h4 Return Codes
-%p
- 0 if ...
- 1 if ...
-%h4 Failure Scenarios
-%p Fails if ...
-%h4 Usage Examples
-%pre
- %code
- :preserve
- user$ {{ setup the scenario }}
- user$ function_name {{ parameters }}
- user$ {{ demonstrate the results}}
-%h1 function_name
-%p Function Description
-%h4 Input Parameters
-%p Positional Parameter listing and descriptions.
-%h4 Stream Outputs
-%p What gets printed to STDOUT and STDERROR. 'None.' if nothing is output.
-%h4 Environmental effects
-%p What, if any, environmental side effects this function causes. 'None.' for none.
-%h4 Return Codes
-%p
- 0 if ...
- 1 if ...
-%h4 Failure Scenarios
-%p Fails if ...
-%h4 Usage Examples
-%pre
- %code
- :preserve
- user$ {{ setup the scenario }}
- user$ function_name {{ parameters }}
- user$ {{ demonstrate the results}}
-%p Replace contents in a file with a given (sed) regex pattern.
-%p
- Example:
- replace_content "^PREFIX =.*" with "${install_path}" in Makefile
-%h1 file_matches_md5
-%p Fetches the package's md5 sum from the md5_url, if given.
-%h4 Input Parameters
-%p None.
-%h4 Stream Outputs
-%p none.
-%h4 Environmental effects
-%p None.
-%h4 Return Codes
-%p
- 0 if the file matches the md5sum
- 1 if the file does not match the md5sum
- 1 if the file is empty or missing
-%h4 Failure Scenarios
-%p
- Fails if no file name/path was given.
- Fails if no md5 string was given.
-%h4 Usage Examples
-%p Example Usage:
-%p user$ file_matches_md5
-%h4 Notes
2  content/modules/shell/filesystem/dsl.yaml
View
@@ -1,2 +0,0 @@
----
-title: "DSL API :: filesystem"
318 content/modules/shell/help/dsl.haml
View
@@ -1,318 +0,0 @@
-.breadcrumbs
- %a{ :href => "/" }
- Documentation
-  > 
- %a{ :href => "/modules/" }
- Modules
-  > 
- %a{ :href => "/modules/shell/" }
- Bash
-  > 
- %a{ :href => "/modules/shell/help/" }
- help
-  > 
- %a{ :href => "/modules/shell/help/dsl/" }
- DSL API :: help
- %hr
-
-%h1
- Module help
-
-%h2 show_help()
-%p
- Display help for the current extension based on settings declared in the help
- action.
-%h4 Input Parameters
-%p First parameter is the help section to display, default is all sections 'usage'.
-%h4 Stream Outputs
-%p Prints out formatted help sections to the calling environments STDOUT stream.
-%h4 Environmental effects
-%p None.
-%h4 Return Codes
-%p 0 for success.
-%h4 Failure Scenarios
-%p No failure scenarios currently.
-%h4 Usage Examples
-%pre
- %code
- :preserve
- user$ show_help usage
-%h2 description()
-%p Set the string that will be printed when the actions help section is output.
-%h4 Input Parameters
-%p First parameter is a string containing a description of the extension.
-%h4 Stream Outputs
-%p None.
-%h4 Environmental effects
-%p None.
-%h4 Return Codes
-%p 0 for success.
-%h4 Failure Scenarios
-%p Fails if no description is given.
-%h4 Usage Examples
-%pre
- %code
- :preserve
- user$ description "This extension handles X Y and Z."
-%h2 help_description()
-%p Outputs the collected help description.
-%h4 Input Parameters
-%p None.
-%h4 Stream Outputs
-%p Prints the help description output.
-%h4 Environmental effects
-%p None.
-%h4 Return Codes
-%p 0 for success.
-%h4 Failure Scenarios
-%p None.
-%h4 Usage Examples
-%pre
- %code
- :preserve
- user$ description "This extension handles X Y and Z."
-%h2 actions()
-%p Set the string that will be printed when the actions help section is output.
-%h4 Input Parameters
-%p First parameter is a string of the action descriptions.
-%h4 Stream Outputs
-%p None.
-%h4 Environmental effects
-%p None.
-%h4 Return Codes
-%p 0 for success.
-%h4 Failure Scenarios
-%p Fails if no actions are given.
-%h4 Usage Examples
-%pre
- %code
- :preserve
- user$ actions "install - Installs the extension..."
-%h2 action()
-%p Adds an action definition for help output.
-%h4 Input Parameters
-%p
- First parameter is the name of the extension action
- Second parameter is the description of the extension action
-%h4 Stream Outputs
-%p None.
-%h4 Environmental effects
-%p The action description will be stored for use on help output.
-%h4 Return Codes
-%p 0 for success.
-%h4 Failure Scenarios
-%p
- Fails if an action name is not given.
- Fails if a description is not provided.
-%h4 Usage Examples
-%pre
- %code
- :preserve
- user$ action "install" "Installs the extension..."
-%h2 note()
-%p Adds a note definition for help Notes section.
-%h4 Input Parameters
-%p
- First parameter is a string containing any note for the notes section of
- the current extension's help output.
-%h4 Stream Outputs
-%p None.
-%h4 Environmental effects
-%p None.
-%h4 Return Codes
-%p 0 for success.
-%h4 Failure Scenarios
-%p No failure scenarios currently.
-%h4 Usage Examples
-%pre
- %code
- :preserve
- user$ note "Help for this extension can be found in #beginrescueend on irc.freenode.net"
-%h2 dependencies()
-%p Specify content for the dependencies section of the help command.
-%h4 Input Parameters
-%p
- First parameter is a string containing any dependencies for the dependencies
- section of the current extension's help output.
-%h4 Stream Outputs
-%p None.
-%h4 Environmental effects
-%p None.
-%h4 Return Codes
-%p 0 for success
-%h4 Failure Scenarios
-%p No failure scenarios currently.
-%h4 Usage Examples
-%pre
- %code
- :preserve
- user$ dependencies " * pcre"
-%h2 resource()
-%p Add a resource for the Resources section of the help command.
-%h4 Input Parameters
-%p
- First parameter is a string containing any resources for the resources
- section of the current extension's help output.
-%h4 Stream Outputs
-%p None.
-%h4 Environmental effects
-%p None.
-%h4 Return Codes
-%p 0 for success
-%h4 Failure Scenarios
-%p No failure scenarios currently.
-%h4 Usage Examples
-%pre
- %code
- :preserve
- user$ resource "website: ..."
-%h2 help_actions()
-%p
- Outputs the help actions in a formatted manner.
- Outputs a message if there are no actions.
-%h4 Input Parameters
-%p None.
-%h4 Stream Outputs
-%p
- Prints a formatted listing of the actions and their descriptions to the
- calling environments STDOUT.
-%h4 Environmental effects
-%p None.
-%h4 Return Codes
-%p 0 for success
-%h4 Failure Scenarios
-%p No failure scenarios currently.
-%h4 Usage Examples
-%pre
- %code
- :preserve
- user$ cat $HOME/test
- #!/usr/bin/env bdsm
-
- modules bdsm/help
-
- action "help" "Displays the help output for the ${extension} extension"
- action "install" "Installs Z redis package"
- action "uninstall" "Uninstalls Z redis package"
-
- help_actions
-
- user$ "$HOME/test"
- help - Displays the help output for the redis extension
- install - Installs Z redis package
- uninstall - Uninstalls Z redis package
-%h2 help_notes()
-%p
- Outputs the help notes in a formatted manner.
- Outputs a message if there are no notes.
-%h4 Input Parameters
-%p None.
-%h4 Stream Outputs
-%p Prints a formatted listing of the notes to the calling environments STDOUT.
-%h4 Environmental effects
-%p None.
-%h4 Return Codes
-%p 0 for success
-%h4 Failure Scenarios
-%p No failure scenarios currently.
-%h4 Usage Examples
-%pre
- %code
- :preserve
- user$ cat $HOME/test
- #!/usr/bin/env bdsm
-
- modules bdsm/help
-
- note "Don't forget the milk! "
- note "... and cookies... mmm...."
-
- help_notes
-
- user$ "$HOME/test"
- * Don't forget the milk!
- * ... and cookies... mmm....
-%h2 help_dependencies()
-%p Outputs the help dependencies in a formatted manner.
-%h4 Input Parameters
-%p None.
-%h4 Stream Outputs
-%p
- Prints a formatted listing of the current extensions defined dependencies to
- the calling environments STDOUT.
-%h4 Environmental effects
-%p None.
-%h4 Return Codes
-%p 0 for success
-%h4 Failure Scenarios
-%p No failure scenarios currently.
-%h4 Usage Examples
-%h2 help_resources()
-%p
- Outputs the help notes in a formatted manner.
- Outputs a message if there are no notes.
-%h4 Input Parameters
-%p None.
-%h4 Stream Outputs
-%p
- Prints a formatted listing of the defined resources to the calling
- environments STDOUT.
-%h4 Environmental effects
-%p None.
-%h4 Return Codes
-%p 0 for success
-%h4 Failure Scenarios
-%p No failure scenarios currently.
-%h4 Usage Examples
-%h2 help_section()
-%p Displays a help section header.
-%h4 Input Parameters
-%p None.
-%h4 Stream Outputs
-%p Prints the given string as a help section header.
-%h4 Environmental effects
-%p None.
-%h4 Return Codes
-%p 0 for success
-%h4 Failure Scenarios
-%p No failure scenarios currently.
-%h4 Usage Examples
-%pre
- %code
- :preserve
- user$ help_section Usage
-%h2 help_usage()
-%p Display the CLI signature.
-%h4 Input Parameters
-%p None.
-%h4 Stream Outputs
-%p Prints the CLI command signature.
-%h4 Environmental effects
-%p None.
-%h4 Return Codes
-%p 0 for success
-%h4 Failure Scenarios
-%p No failure scenarios currently.
-%h4 Usage Examples
-%pre
- %code
- :preserve
- user$ help_usage
- bdsm core {action} [arguments...]
-%h2 usage()
-%p Display the usage help output of the command. This displays all help sections.
-%h4 Input Parameters
-%p None.
-%h4 Stream Outputs
-%p Prints all help sections to the STDOUT of the calling environment.
-%h4 Environmental effects
-%p None.
-%h4 Return Codes
-%p 0 for success
-%h4 Failure Scenarios
-%p No failure scenarios currently.
-%h4 Usage Examples
-%pre
- %code
- :preserve
- user$ usage
2  content/modules/shell/help/dsl.yaml
View
@@ -1,2 +0,0 @@
----
-title: "DSL API :: help"
0  content/modules/shell/environment.haml → content/modules/shell/interactive.haml
View
File renamed without changes
0  content/modules/shell/environment.yaml → content/modules/shell/interactive.yaml
View
File renamed without changes
25 content/modules/shell/logging.haml
View
@@ -16,26 +16,13 @@
Logging Module
%h2 What it does
-The Logging module adds an easy way to handle error and warning logging and debugging within the BDSM framework.
-%h2 Functions
+The Logging module adds an easy way to handle error and warning logging and debugging within the SM framework.
-%pre.code
- :preserve
- log()
- info()
- warn()
- debug()
- error()
- succeed()
- fail()
-
-%h2
- DSL
-%p
- Read the
- %a{:href => "/modules/shell/logging/dsl/"}
- Logging module DSL documentation
- for more detail on the individual Logging functions.
+%h2 Help us!!!
+This document needs you're help! Please
+%a{:href => "https://github.com/sm/website/edit/master/content/modules/shell/logging.haml"}
+ Edit on GitHub
+and send a pull request!
167 content/modules/shell/logging/dsl.haml
View
@@ -1,167 +0,0 @@
-.breadcrumbs
- %a{ :href => "/" }
- Documentation
-  > 
- %a{ :href => "/modules/" }
- Modules
-  > 
- %a{ :href => "/modules/shell/" }
- Bash
-  > 
- %a{ :href => "/modules/shell/logging/" }
- logging
-  > 
- %a{ :href => "/modules/shell/logging/dsl/" }
- DSL API :: logging
- %hr
-
-%h1
- Module logging
-
-%h2 log()
-%p Log arguments to the calling environments STDOUT.
-%h4 Input Parameters
-%p Strings to be logged.
-%h4 Stream Outputs
-%p
- Prints arguments passed in to the calling environments STDOUT with a newline
- character appended.
-%h4 Environmental effects
-%p None.
-%h4 Return Codes
-%p 0 for success
-%h4 Failure Scenarios
-%p Fails if no arguments are given.
-%h4 Usage Examples
-%pre
- %code
- :preserve
- user$ log "Hello there! "
- Hello there!
-%h2 info()
-%p Log arguments to the calling environments STDOUT preceded by 'INFO .
-%h4 Input Parameters
-%p Strings to be logged.
-%h4 Stream Outputs
-%p
- Prints arguments passed in to the calling environments STDOUT with a newline
- character appended and 'INFO ' prepended.
-%h4 Environmental effects
-%p None.
-%h4 Return Codes
-%p 0 for success
-%h4 Failure Scenarios
-%p Fails if no arguments are given.
-%h4 Usage Examples
-%pre
- %code
- :preserve
- user$ info "Hello there! "
- INFO Hello there!
-%h2 warn()
-%p Log arguments to the calling environments STDOUT preceded by 'WARNING .
-%h4 Input Parameters
-%p Strings to be logged.
-%h4 Stream Outputs
-%p
- Prints arguments passed in to the calling environments STDOUT with a newline
- character appended and 'WARNING ' prepended.
-%h4 Environmental effects
-%p None.
-%h4 Return Codes
-%p 0 for success
-%h4 Failure Scenarios
-%p Fails if no arguments are given.
-%h4 Usage Examples
-%pre
- %code
- :preserve
- user$ info "Hello there! "
- INFO Hello there!
-%h2 debug()
-%p Log arguments to the calling environments STDOUT preceded by 'DEBUG: .
-%h4 Input Parameters
-%p Strings to be logged.
-%h4 Stream Outputs
-%p
- Prints arguments passed in to the calling environments STDOUT with a newline
- character appended and 'DEBUG: ' prepended.
-%h4 Environmental effects
-%p None.
-%h4 Return Codes
-%p 0 for success
-%h4 Failure Scenarios
-%p Fails if no arguments are given.
-%h4 Usage Examples
-%pre
- %code
- :preserve
- user$ debug "Hello there! "
- DEBUG: Hello there!
-%h2 error()
-%p
- Log arguments to the calling environments STDERR preceded by 'ERROR '.
- Exits with status code 1.
-%h4 Input Parameters
-%p Strings to be logged.
-%h4 Stream Outputs
-%p
- Prints arguments passed in to the calling environments STDOUT with a newline
- character appended and 'ERROR ' prepended.
-%h4 Environmental effects
-%p None.
-%h4 Return Codes
-%p 1 for failure.
-%h4 Failure Scenarios
-%p Fails if no arguments are given.
-%h4 Usage Examples
-%pre
- %code
- :preserve
- user$ error "Hello there! "
- ERROR Hello there!
- *poof* shell closed...
-%h2 succeed()
-%p Log arguments to the calling environments STDOUT. Exits with status code 0.
-%h4 Input Parameters
-%p Strings to be logged.
-%h4 Stream Outputs
-%p
- Prints arguments passed in to the calling environments STDOUT with a newline
- character appended.
-%h4 Environmental effects
-%p None.
-%h4 Return Codes
-%p 0 for success
-%h4 Failure Scenarios
-%p Fails if no arguments are given.
-%h4 Usage Examples
-%pre
- %code
- :preserve
- user$ succeed "Hello there! "
- Hello there!
- *poof* shell closed...
-%h2 fail()
-%p
- Log arguments to the calling environments STDERR preceded by 'ERROR '.
- Exits with status code 1.
-%h4 Input Parameters
-%p Strings to be logged.
-%h4 Stream Outputs
-%p
- Prints arguments passed in to the calling environments STDOUT with a newline
- character appended and 'ERROR ' prepended.
-%h4 Environmental effects
-%p None.
-%h4 Return Codes
-%p 1 for failure.
-%h4 Failure Scenarios
-%p Fails if no arguments are given.
-%h4 Usage Examples
-%pre
- %code
- :preserve
- user$ error "Hello there! "
- ERROR Hello there!
- *poof* shell closed...
2  content/modules/shell/logging/dsl.yaml
View
@@ -1,2 +0,0 @@
----
-title: "DSL API :: logging"
23 content/modules/shell/modules.haml
View
@@ -18,24 +18,11 @@
%h2 What it does
The Modules Module (ooh, meta) gives you the ability to list, load, or get information about all the modules available in the BDSM framework.
- %h2 Functions
+%h2 Help us!!!
- %pre.code
- :preserve
- modules()
- module_load()
- module_is_loaded()
- modules_loaded()
- module_dsl()
- modules_list()
- modules_docs()
- modules_docgen()
+This document needs you're help! Please
+%a{:href => "https://github.com/sm/website/edit/master/content/modules/shell/modules.haml"}
+ Edit on GitHub
+and send a pull request!
- %h2
- DSL
- %p
- Read the
- %a{:href => "/modules/shell/modules/dsl/"}
- Modules module DSL documentation
- for more detail on the individual Modules module functions.
236 content/modules/shell/modules/dsl.haml
View
@@ -1,236 +0,0 @@
-.breadcrumbs
- %a{ :href => "/" }
- Documentation
-  > 
- %a{ :href => "/modules/" }
- Modules
-  > 
- %a{ :href => "/modules/shell/" }
- Bash
-  > 
- %a{ :href => "/modules/shell/modules/" }
- modules
-  > 
- %a{ :href => "/modules/shell/modules/dsl/" }
- DSL API :: modules
- %hr
-
-%h1
- Module modules
-
-%h2 modules()
-%p Loads named BDSM modules into the calling environment.
-%h4 Input Parameters
-%p Positional Parameter listing and descriptions.
-%h4 Stream Outputs
-%p None, unless loading the module causes output to a stream.
-%h4 Return Codes
-%p 0 for success
-%h4 Failure Scenarios
-%p Fails if no module names were given as parameters.
-%h4 Usage Examples
-%pre
- %code
- :preserve
- user$ modules array system
- user$ modules_loaded
- logging trace filesystem array system
-%h2 module_load()
-%p Function Description
-%h4 Input Parameters
-%p Positional Parameter listing and descriptions.
-%h4 Stream Outputs
-%p None, unless loading the module causes output to a stream.
-%h4 Return Codes
-%p 0 for success
-%h4 Failure Scenarios
-%p Fails if no extension module files names have been given.
-%h4 Usage Examples
-%pre
- %code
- :preserve
- user$ ls ${extension_modules_path}/bash/
- cli dsl initialize zebra
-
- user$ cat ${extension_modules_path}/bash/zebra
- #!/usr/bin/env bash
- echo "Zebra!!! "
-
- user$ module_load zebra # This will load zebra into the current context
- Zebra!!!
-%h2 module_is_loaded()
-%p Checks to see whether or not the named module has been loaded or not.
-%h4 Input Parameters
-%p First parameter is a module name.
-%h4 Stream Outputs
-%p None.
-%h4 Return Codes
-%p
- 0 if the module has already been loaded
- 1 if the module has not already been loaded
-%h4 Failure Scenarios
-%p Fails if no module name was given as the first parameter.
-%h4 Usage Examples
-%pre
- %code
- :preserve
- user$ module_is_loaded package
- user$ echo $?
- 1
- user$ modules package
- user$ module_is_loaded package
- 0
-%h2 modules_loaded()
-%p Outputs a list of all modules that have been loaded.
-%h4 Input Parameters
-%p Positional Parameter listing and descriptions.
-%h4 Stream Outputs
-%p
- Prints a space separated list of all loaded modules to the STDOUT stream of
- the calling environment.
-%h4 Return Codes
-%p 0 for success
-%h4 Failure Scenarios
-%p No failure scenarios.
-%h4 Usage Examples
-%pre
- %code
- :preserve
- user$ modules_loaded
- logging trace filesystem
-%p Print out a list of all installed modules.
-%h2 module_dsl()
-%p Print out a list of all dsl for the given module.
-%h4 Input Parameters
-%p First parameter is the module name to print out the dsl for.
-%h4 Stream Outputs
-%p
- The named module's DSL function listing will is printed to the calling
- environments STDOUT.
-%h4 Environmental effects
-%p None.
-%h4 Return Codes
-%p 0 for success
-%h4 Failure Scenarios
-%p Fails if no module name was given.
-%h4 Usage Examples
-%pre
- %code
- :preserve
- user$ module_dsl defaults
- read_default()
-%h2 modules_list()
-%p Lists dsl for all modules.
-%h4 Input Parameters
-%p First parameter is the module name to print out the dsl for.
-%h4 Stream Outputs
-%p
- DSL function listing for each module is printed to the STDOUT of the calling
- environment.
-%h4 Environmental effects
-%p None.
-%h4 Return Codes
-%p 0 for success
-%h4 Failure Scenarios
-%p No failure scenarios currently.
-%h4 Usage Examples
-%pre
- %code
- :preserve
- user$ modules_list
- array
-
- array_is_nonempty()
- array_length()
- array_last_element()
- array_first_element()
- array_push()
- array_append()
- array_shift()
- array_unshift()
- array_join()
- ... longish output ...
-%h2 modules_docs()
-%p Output the module DSL documentation for a given module name.
-%h4 Input Parameters
-%p First parameter is the module name to print out the dsl documentation for.
-%h4 Stream Outputs
-%p DSL documentation for every function of the named module.
-%h4 Environmental effects
-%p None.
-%h4 Return Codes
-%p 0 for success
-%h4 Failure Scenarios
-%p Fails if no module name is given.
-%h4 Usage Examples
-%pre
- %code
- :preserve
- user$ module_docs defaults
-
- # read_default
-
- Reads default values from an extension's config/defaults file.
-
- ##### Input Parameters
-
- First parameter is the defaults file key to read (key=value).
- Second parameter is the variable name to store the retrieved value in.
- Remaining parameters are parsed out as token, value and prefix
- into|as <variable name>
- prefix <name>
- <variable> # If no specifier.
-
- ##### Stream Outputs
-
- None.
-
- ##### Environmental effects
-
- A variable will be set to the value, if the value is nonempty. If no variable
- name is specified the variable will be assigned the same name as the key.
-
- ##### Return Codes
-
- 0 for success.
-
- ##### Failure Scenarios
-
- Fails if no arguments are passed in, at least need to specify a key.
-
- ##### Usage Examples
-
- user$ read_default "version" prefix "package" # extension is nginx for example
- user$ echo $package_version
- 1.0.0
-%h2 modules_docgen()
-%p Lists dsl for all modules.
-%h4 Input Parameters
-%p First parameter is the module name to print out the dsl for.
-%h4 Stream Outputs
-%p
- DSL function listing for each module is printed to the STDOUT of the calling
- environment.
-%h4 Environmental effects
-%p None.
-%h4 Return Codes
-%p 0 for success
-%h4 Failure Scenarios
-%p No failure scenarios currently.
-%h4 Usage Examples
-%pre
- %code
- :preserve
- user$ modules_list
- array
-
- array_is_nonempty()
- array_length()
- array_last_element()
- array_first_element()
- array_push()
- array_append()
- array_shift()
- array_unshift()
- array_join()
- ... longish output ...
2  content/modules/shell/modules/dsl.yaml
View
@@ -1,2 +0,0 @@
----
-title: "DSL API :: modules"
41 content/modules/shell/package.haml
View
@@ -16,40 +16,15 @@
Package Module
%h2 What it does
-The Package module gives BDSM functions specifically for installing/uninstalling/building packages. If you want to automate the installation, management, and configuration of packages, you're going to be good friends with the Package module.
+The Package module gives BDSM functions specifically for installing/uninstalling/building packages.
+If you want to automate the installation, management, and configuration of packages,
+you're going to be good friends with the Package module.
-%h2 Functions
+%h2 Help us!!!
-%pre.code
- :preserve
- package_definition()
- package_install()
- package_fetch_md5()
- package_fetch()
- package_extract()
- package_configure()
- package_build()
- package_make_install()
- package_activate()
- package_setup()
- package_deactivate()
- package_activate_if_first()
- package_ldconfig()
- package_profile_d()
- package_uninstall()
- package_patch()
- package_apply_patches()
- package_usage()
- package_cli()
- package_active()
- package_must be()
- packages_must_be_active()
+This document needs you're help! Please
+%a{:href => "https://github.com/sm/website/edit/master/content/modules/shell/package.haml"}
+ Edit on GitHub
+and send a pull request!
-%h2
- DSL
-%p
- Read the