+++ /dev/null
-;;; ob-cfengine3-autoloads.el --- automatically extracted autoloads
-;;
-;;; Code:
-(add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path))))
-\f
-;;;### (autoloads nil nil ("ob-cfengine3.el") (23082 53516 115159
-;;;;;; 478000))
-
-;;;***
-\f
-;; Local Variables:
-;; version-control: never
-;; no-byte-compile: t
-;; no-update-autoloads: t
-;; End:
-;;; ob-cfengine3-autoloads.el ends here
+++ /dev/null
-;;; -*- no-byte-compile: t -*-
-(define-package "ob-cfengine3" "20170915.634" "Org Babel functions for CFEngine 3" 'nil :commit "f38f87256efcb2b02f5c7042900087be941c1ddc" :url "https://github.com/nickanderson/ob-cfengine3" :keywords '("tools" "convenience"))
+++ /dev/null
-;;; ob-cfengine3.el --- Org Babel functions for CFEngine 3
-
-;; Copyright (C) 2017 Nick Anderson
-
-;; Permission is hereby granted, free of charge, to any person obtaining a copy
-;; of this software and associated documentation files (the "Software"), to deal
-;; in the Software without restriction, including without limitation the rights
-;; to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-;; copies of the Software, and to permit persons to whom the Software is
-;; furnished to do so, subject to the following conditions:
-;; The above copyright notice and this permission notice shall be included in
-;; all copies or substantial portions of the Software.
-
-;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-;; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-;; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-;; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-;; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-;; OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-;; THE SOFTWARE.
-
-;; Author: Nick Anderson <nickNOSPAMcmdln.org>
-;; Keywords: tools, convenience
-;; Package-Version: 20170915.634
-;; URL: https://github.com/nickanderson/ob-cfengine3
-;; Version: 0.0.1
-
-
-;;; Commentary:
-;; Execute CFEngine 3 policy inside org-mode src blocks.
-
-;;; Code:
-
-(defvar ob-cfengine3-command "cf-agent"
- "Name of command to use for executing cfengine policy.")
-
-(defvar ob-cfengine3-command-options ""
- "Option string that should be passed to the agent.
-Note that --file will be appended to the options.")
-
-(defvar ob-cfengine3-file-control-stdlib "body file control{ inputs => { '$(sys.libdir)/stdlib.cf' };}\n"
- "File control body to include the standard libriary from $(sys.libdir).
-It is useful to inject into an example source block before execution.")
-
-(defconst ob-cfengine3-header-args-cfengine3
- '(
- (no-lock . :any)
- (include-stdlib . :any)
- (define . :any)
- (bundlesequence . :any))
- "CFEngine specific header arguments.")
-
-(defun org-babel-execute:cfengine3 (body params)
- "Actuate a block of CFEngine 3 policy.
-This function is called by `org-babel-execute-src-block'.
-
- A temporary file is constructed containing
- `ob-cfengine3-file-control-stdlib and the BODY of the src
- block. `ob-cfengine3-command' is used to execute the
- temporary file."
-
- (let* ((temporary-file-directory ".")
- (use-locks (cdr (assoc :use-locks params)))
- (include-stdlib (not (string= "no" (cdr (assoc :include-stdlib params)))))
- (define (cdr (assoc :define params)))
- (bundlesequence (cdr (assoc :bundlesequence params)))
- (tempfile (make-temp-file "cfengine3-")))
- (with-temp-file tempfile
- (when include-stdlib (insert ob-cfengine3-file-control-stdlib))
- (insert body))
- (unwind-protect
- (shell-command-to-string
- (concat
- ob-cfengine3-command
- " "
- (when bundlesequence (concat "--bundlesequence " bundlesequence ))
- " "
- (when define (concat "--define " define ))
- " "
- (unless use-locks "--no-lock")
- ob-cfengine3-command-options
- " "
- (format " --file %s" (shell-quote-argument tempfile))))
- (delete-file tempfile))))
-
-(add-to-list 'org-src-lang-modes '("cfengine3" . cfengine3))
-(add-to-list 'org-babel-tangle-lang-exts '("cfengine3" . "cf"))
-
-(provide 'ob-cfengine3)
-;;; ob-cfengine3.el ends here
--- /dev/null
+;;; ob-cfengine3-autoloads.el --- automatically extracted autoloads
+;;
+;;; Code:
+
+(add-to-list 'load-path (directory-file-name
+ (or (file-name-directory #$) (car load-path))))
+
+\f
+;;;### (autoloads nil "ob-cfengine3" "ob-cfengine3.el" (0 0 0 0))
+;;; Generated autoloads from ob-cfengine3.el
+
+(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "ob-cfengine3" '("ob-cfengine3-" "org-babel-execute:cfengine3")))
+
+;;;***
+\f
+;; Local Variables:
+;; version-control: never
+;; no-byte-compile: t
+;; no-update-autoloads: t
+;; coding: utf-8
+;; End:
+;;; ob-cfengine3-autoloads.el ends here
--- /dev/null
+;;; -*- no-byte-compile: t -*-
+(define-package "ob-cfengine3" "20180102.1812" "Org Babel functions for CFEngine 3" 'nil :commit "93ebcfceec3734f4bd187ae123686187d66fd401" :keywords '("tools" "convenience") :authors '(("Nick Anderson" . "nickNOSPAMcmdln.org")) :maintainer '("Nick Anderson" . "nickNOSPAMcmdln.org") :url "https://github.com/nickanderson/ob-cfengine3")
--- /dev/null
+;;; ob-cfengine3.el --- Org Babel functions for CFEngine 3
+
+;; Copyright (C) 2017 Nick Anderson
+
+;; Permission is hereby granted, free of charge, to any person obtaining a copy
+;; of this software and associated documentation files (the "Software"), to deal
+;; in the Software without restriction, including without limitation the rights
+;; to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+;; copies of the Software, and to permit persons to whom the Software is
+;; furnished to do so, subject to the following conditions:
+;; The above copyright notice and this permission notice shall be included in
+;; all copies or substantial portions of the Software.
+
+;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+;; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+;; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+;; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+;; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+;; OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+;; THE SOFTWARE.
+
+;; Author: Nick Anderson <nickNOSPAMcmdln.org>
+;; Keywords: tools, convenience
+;; Package-Version: 20180102.1812
+;; URL: https://github.com/nickanderson/ob-cfengine3
+;; Version: 0.0.2
+
+;;; Commentary:
+;; Execute CFEngine 3 policy inside org-mode src blocks.
+
+;;; Code:
+
+(defvar ob-cfengine3-command "cf-agent"
+ "Name of command to use for executing cfengine policy.")
+
+(defvar ob-cfengine3-command-options ""
+ "Option string that should be passed to the agent.
+Note that --file will be appended to the options.")
+
+(defvar ob-cfengine3-file-control-stdlib "body file control{ inputs => { '$(sys.libdir)/stdlib.cf' };}\n"
+ "File control body to include the standard libriary from $(sys.libdir).
+It is useful to inject into an example source block before execution.")
+
+(defconst ob-cfengine3-header-args-cfengine3
+ '(
+ (no-lock . :any)
+ (debug . :any)
+ (verbose . :any)
+ (info . :any)
+ (include-stdlib . :any)
+ (define . :any)
+ (bundlesequence . :any))
+ "CFEngine specific header arguments.")
+
+(defun org-babel-execute:cfengine3 (body params)
+ "Actuate a block of CFEngine 3 policy.
+This function is called by `org-babel-execute-src-block'.
+
+ A temporary file is constructed containing
+ `ob-cfengine3-file-control-stdlib and the BODY of the src
+ block. `ob-cfengine3-command' is used to execute the
+ temporary file."
+
+ (let* ((temporary-file-directory ".")
+ (debug (cdr (assoc :debug params)))
+ (verbose (cdr (assoc :verbose params)))
+ (info (cdr (assoc :info params)))
+ (use-locks (cdr (assoc :use-locks params)))
+ (include-stdlib (not (string= "no" (cdr (assoc :include-stdlib params)))))
+ (define (cdr (assoc :define params)))
+ (bundlesequence (cdr (assoc :bundlesequence params)))
+ (tempfile (make-temp-file "cfengine3-")))
+ (with-temp-file tempfile
+ (when include-stdlib (insert ob-cfengine3-file-control-stdlib))
+ (insert body))
+ (unwind-protect
+ (shell-command-to-string
+ (concat
+ ob-cfengine3-command
+ " "
+ (when bundlesequence (concat "--bundlesequence " bundlesequence ))
+ " "
+ (when define (concat "--define " define ))
+ " "
+ (unless use-locks "--no-lock ")
+
+ ;; When info header arg is yes add --info to the command string and throw away the args
+ (when info (concat "--info "))
+ " "
+ ;; When verbose header arg is yes add --verbose to the command string and throw away the args
+ (when verbose (concat "--verbose "))
+ " "
+ ;; When debug header arg is yes add --debug with all log modules enabled to the command string and throw away the args
+ (when debug (concat "--debug --log-modules=all "))
+ " "
+ ob-cfengine3-command-options
+ " "
+ (format " --file %s" (shell-quote-argument tempfile))))
+ (delete-file tempfile))))
+
+(add-to-list 'org-src-lang-modes '("cfengine3" . cfengine3))
+(add-to-list 'org-babel-tangle-lang-exts '("cfengine3" . "cf"))
+
+(provide 'ob-cfengine3)
+;;; ob-cfengine3.el ends here