[rkward-cvs] SF.net SVN: rkward:[3819] trunk/rkward/rkward/rbackend/rpackages/rkwarddev

m-eik at users.sourceforge.net m-eik at users.sourceforge.net
Thu Sep 22 20:23:54 UTC 2011


Revision: 3819
          http://rkward.svn.sourceforge.net/rkward/?rev=3819&view=rev
Author:   m-eik
Date:     2011-09-22 20:23:53 +0000 (Thu, 22 Sep 2011)
Log Message:
-----------
rkwarddev: new options "edit" and "create" in rk.plugin.skeleton()

Modified Paths:
--------------
    trunk/rkward/rkward/rbackend/rpackages/rkwarddev/ChangeLog
    trunk/rkward/rkward/rbackend/rpackages/rkwarddev/DESCRIPTION
    trunk/rkward/rkward/rbackend/rpackages/rkwarddev/R/rk.plugin.skeleton.R
    trunk/rkward/rkward/rbackend/rpackages/rkwarddev/R/rkwarddev-desc-internal.R
    trunk/rkward/rkward/rbackend/rpackages/rkwarddev/R/rkwarddev-package.R
    trunk/rkward/rkward/rbackend/rpackages/rkwarddev/man/rk.plugin.skeleton.Rd
    trunk/rkward/rkward/rbackend/rpackages/rkwarddev/man/rkwarddev-package.Rd

Modified: trunk/rkward/rkward/rbackend/rpackages/rkwarddev/ChangeLog
===================================================================
--- trunk/rkward/rkward/rbackend/rpackages/rkwarddev/ChangeLog	2011-09-22 16:21:52 UTC (rev 3818)
+++ trunk/rkward/rkward/rbackend/rpackages/rkwarddev/ChangeLog	2011-09-22 20:23:53 UTC (rev 3819)
@@ -1,10 +1,11 @@
 ChangeLog for package rkwarddev
 
-## 0.01-4 (2011-09-21)
-  - fixed wrong doc link in rk.plugin.skeleton()
+## 0.01-4 (2011-09-22)
+  - fixed wrong doc link and one wrong object name in rk.plugin.skeleton()
   - fixed attribute typo in rk.XML.vars()
   - fixed issue with auto-generated IDs (now using "_" instead of ".")
   - added wizard code options to rk.XML.plugin() and rk.plugin.skeleton()
+  - added "edit" and "create" options to rk.plugin.skeleton()
   - added function rk.XML.varslot()
   - added possibility to add custom XML nodes to the varslot in rk.XML.vars()
   - added possibility to paste ready-to-use JavaScript code directly to the preprocess(),

Modified: trunk/rkward/rkward/rbackend/rpackages/rkwarddev/DESCRIPTION
===================================================================
--- trunk/rkward/rkward/rbackend/rpackages/rkwarddev/DESCRIPTION	2011-09-22 16:21:52 UTC (rev 3818)
+++ trunk/rkward/rkward/rbackend/rpackages/rkwarddev/DESCRIPTION	2011-09-22 20:23:53 UTC (rev 3819)
@@ -4,8 +4,7 @@
 Author: m.eik michalke <meik.michalke at hhu.de>
 Maintainer: m.eik michalke <meik.michalke at hhu.de>
 Depends:
-    R (>= 2.9.0),
-    XiMpLe
+    R (>= 2.9.0),XiMpLe,rkward
 Enhances: rkward
 Description: Provides functions to create plugin skeletons
     and XML structures for RKWard.

Modified: trunk/rkward/rkward/rbackend/rpackages/rkwarddev/R/rk.plugin.skeleton.R
===================================================================
--- trunk/rkward/rkward/rbackend/rpackages/rkwarddev/R/rk.plugin.skeleton.R	2011-09-22 16:21:52 UTC (rev 3818)
+++ trunk/rkward/rkward/rbackend/rpackages/rkwarddev/R/rk.plugin.skeleton.R	2011-09-22 20:23:53 UTC (rev 3819)
@@ -22,6 +22,17 @@
 #'		pasted as-is, see \code{\link[rkwarddev:rk.JS.doc]{rk.JS.doc}}.
 #' @param JS.prnt A character string with JavaScript code to be included in the \code{printout()} function. This string will be
 #'		pasted as-is, see \code{\link[rkwarddev:rk.JS.doc]{rk.JS.doc}}.
+#' @param create A character vector with one or more of these possible entries:
+#'		\describe{
+#'			\item{\code{"pmap"}}{Create the \code{.pluginmap} file.}
+#'			\item{\code{"xml"}}{Create the plugin \code{.xml} XML file skeleton.}
+#'			\item{\code{"js"}}{Create the plugin \code{.js} JavaScript file skeleton.}
+#'			\item{\code{"rkh"}}{Create the plugin \code{.rkh} help file skeleton.}
+#'			\item{\code{"desc"}}{Create the \code{DESCRIPTION} file.}
+#'		}
+#'		Default is to create all of these files. Existing files will only be overwritten if \code{overwrite=TRUE}.
+#' @param edit Logical, if \code{TRUE} RKWard will automatically open the created files for editing, by calling \code{rk.edit.files}.
+#'		This applies to all files defined in \code{create}.
 #' @export
 #' @examples
 #' \dontrun{
@@ -86,7 +97,7 @@
 
 rk.plugin.skeleton <- function(name, about, path=tempdir(), dialog=list(), wiz.dialog=list(),
 	dial.require=c(), overwrite=FALSE, wizard=FALSE, tests=TRUE, lazyLoad=TRUE,
-	JS.prep=NULL, JS.calc=NULL, JS.prnt=NULL){
+	JS.prep=NULL, JS.calc=NULL, JS.prnt=NULL, create=c("pmap", "xml", "js", "rkh", "desc"), edit=FALSE){
 	# to besure, remove all non-character symbols from name
 	name.orig <- name
 	name <- gsub("[[:space:]]*[^[:alnum:]]*", "", name)
@@ -107,10 +118,16 @@
 	description.file <- file.path(main.dir, "DESCRIPTION")
 	rkward.dir <- file.path(main.dir, "inst", "rkward")
 	plugin.dir <- file.path(rkward.dir, "plugins")
-	plugin.pluginmap <- file.path(rkward.dir, paste(name, ".pluginmap", sep=""))
-	plugin.xml <- file.path(plugin.dir, paste(name, ".xml", sep=""))
-	plugin.js <- file.path(plugin.dir, paste(name, ".js", sep=""))
-	plugin.rkh <- file.path(plugin.dir, paste(name, ".rkh", sep=""))
+	# the basic file names
+	plugin.fname.pluginmap <- paste(name, ".pluginmap", sep="")
+	plugin.fname.xml <- paste(name, ".xml", sep="")
+	plugin.fname.js <- paste(name, ".js", sep="")
+	plugin.fname.rkh <- paste(name, ".rkh", sep="")
+	# file names with paths
+	plugin.pluginmap <- file.path(rkward.dir, plugin.fname.pluginmap)
+	plugin.xml <- file.path(plugin.dir, plugin.fname.xml)
+	plugin.js <- file.path(plugin.dir, plugin.fname.js)
+	plugin.rkh <- file.path(plugin.dir, plugin.fname.rkh)
 	tests.main.dir <- file.path(rkward.dir, "tests")
 	tests.dir <- file.path(rkward.dir, "tests", name)
 	testsuite.file <- file.path(tests.main.dir, "testsuite.R")
@@ -142,7 +159,7 @@
 	} else {}
 
 	## create plugin.xml
-	if(isTRUE(checkCreateFiles(plugin.xml))){
+	if("xml" %in% create & isTRUE(checkCreateFiles(plugin.xml))){
 		if(isTRUE(wizard))
 			plugin.provides <- c("dialog","wizard")
 		else {
@@ -156,10 +173,13 @@
 			provides=plugin.provides,
 			pluginmap=paste("../", name, ".pluginmap", sep=""))
 		cat(pasteXMLTree(XML.plugin, shine=1), file=plugin.xml)
+		if(isTRUE(edit)){
+			rk.edit.files(plugin.xml, title=plugin.fname.xml, prompt=FALSE)
+		} else {}
 	} else {}
 
 	## create plugin.js
-	if(isTRUE(checkCreateFiles(plugin.js))){
+	if("js" %in% create & isTRUE(checkCreateFiles(plugin.js))){
 		JS.code <- rk.JS.doc(
 			require=dial.require,
 			variables=rk.JS.scan(XML.plugin),
@@ -168,16 +188,22 @@
 			calculate=JS.calc,
 			printout=JS.prnt)
 		cat(JS.code, file=plugin.js)
+		if(isTRUE(edit)){
+			rk.edit.files(plugin.js, title=plugin.fname.js, prompt=FALSE)
+		} else {}
 	} else {}
 
 	## create plugin.rkh
-	if(isTRUE(checkCreateFiles(plugin.rkh))){
+	if("rkh" %in% create & isTRUE(checkCreateFiles(plugin.rkh))){
 		rkh.doc <- rk.rkh.doc(settings=rk.rkh.scan(XML.plugin))
 		cat(pasteXMLTree(rkh.doc, shine=1), file=plugin.rkh)
+		if(isTRUE(edit)){
+			rk.edit.files(plugin.rkh, title=plugin.fname.rkh, prompt=FALSE)
+		} else {}
 	} else {}
 
 	## create plugin.pluginmap
-	if(isTRUE(checkCreateFiles(plugin.pluginmap))){
+	if("pmap" %in% create & isTRUE(checkCreateFiles(plugin.pluginmap))){
 		XML.pluginmap <- rk.XML.pluginmap(
 			name=name.orig,
 			about=about,
@@ -185,6 +211,9 @@
 			plugin.dir="plugins",
 			hierarchy="analysis")
 		cat(pasteXMLTree(XML.pluginmap), file=plugin.pluginmap)
+		if(isTRUE(edit)){
+			rk.edit.files(plugin.pluginmap, title=plugin.fname.pluginmap, prompt=FALSE)
+		} else {}
 	} else {}
 
 	## create testsuite.R
@@ -194,7 +223,7 @@
 	} else {}
 
 	# create DESCRIPTION file
-	if(isTRUE(checkCreateFiles(description.file))){
+	if("desc" %in% create & isTRUE(checkCreateFiles(description.file))){
 		all.authors <- format(get.by.role(about[["author"]], role="aut"),
 			include=c("given", "family", "email"), braces=list(email=c("<", ">")))
 		all.maintainers <- format(get.by.role(about[["author"]], role="cre"),
@@ -208,7 +237,7 @@
 			Version=about.node at attributes[["version"]],
 			Date=about.node at attributes[["releasedate"]],
 			Author=all.authors,
-			AuthorsR=paste(deparse(about.info[["author"]]), collapse=" "),
+			AuthorsR=paste(deparse(about[["author"]]), collapse=" "),
 			Maintainer=all.maintainers,
 #			Depends="R (>= 2.9.0)",
 			Enhances="rkward",
@@ -224,6 +253,9 @@
 		desc <- subset(desc, select=-AuthorsR)
 
 		write.dcf(desc, file=description.file)
+		if(isTRUE(edit)){
+			rk.edit.files(description.file, title="DESCRIPTION", prompt=FALSE)
+		} else {}
 	} else {}
 
 	return(invisible(NULL))

Modified: trunk/rkward/rkward/rbackend/rpackages/rkwarddev/R/rkwarddev-desc-internal.R
===================================================================
--- trunk/rkward/rkward/rbackend/rpackages/rkwarddev/R/rkwarddev-desc-internal.R	2011-09-22 16:21:52 UTC (rev 3818)
+++ trunk/rkward/rkward/rbackend/rpackages/rkwarddev/R/rkwarddev-desc-internal.R	2011-09-22 20:23:53 UTC (rev 3819)
@@ -9,7 +9,7 @@
 		AuthorsR="c(person(given=\"Meik\", family=\"Michalke\", email=\"meik.michalke at hhu.de\",
 			role=c(\"aut\", \"cre\")))",
 		Maintainer="m.eik michalke <meik.michalke at hhu.de>",
-		Depends="R (>= 2.9.0), XiMpLe",
+		Depends="R (>= 2.9.0),XiMpLe,rkward",
 		Enhances="rkward",
 		Description="Provides functions to create plugin skeletons and XML structures for RKWard.",
 		License="GPL (>= 3)",

Modified: trunk/rkward/rkward/rbackend/rpackages/rkwarddev/R/rkwarddev-package.R
===================================================================
--- trunk/rkward/rkward/rbackend/rpackages/rkwarddev/R/rkwarddev-package.R	2011-09-22 16:21:52 UTC (rev 3818)
+++ trunk/rkward/rkward/rbackend/rpackages/rkwarddev/R/rkwarddev-package.R	2011-09-22 20:23:53 UTC (rev 3819)
@@ -5,7 +5,7 @@
 #' Type: \tab Package\cr
 #' Version: \tab 0.01-4\cr
 #' Date: \tab 2011-09-22\cr
-#' Depends: \tab R (>= 2.9.0), XiMpLe\cr
+#' Depends: \tab R (>= 2.9.0),XiMpLe,rkward\cr
 #' Enhances: \tab rkward\cr
 #' Encoding: \tab UTF-8\cr
 #' License: \tab GPL (>= 3)\cr

Modified: trunk/rkward/rkward/rbackend/rpackages/rkwarddev/man/rk.plugin.skeleton.Rd
===================================================================
--- trunk/rkward/rkward/rbackend/rpackages/rkwarddev/man/rk.plugin.skeleton.Rd	2011-09-22 16:21:52 UTC (rev 3818)
+++ trunk/rkward/rkward/rbackend/rpackages/rkwarddev/man/rk.plugin.skeleton.Rd	2011-09-22 20:23:53 UTC (rev 3819)
@@ -5,7 +5,9 @@
   rk.plugin.skeleton(name, about, path = tempdir(), dialog
   = list(), wiz.dialog = list(), dial.require = c(),
   overwrite = FALSE, wizard = FALSE, tests = TRUE, lazyLoad
-  = TRUE, JS.prep = NULL, JS.calc = NULL, JS.prnt = NULL)
+  = TRUE, JS.prep = NULL, JS.calc = NULL, JS.prnt = NULL,
+  create = c("pmap", "xml", "js", "rkh", "desc"), edit =
+  FALSE)
 }
 \arguments{
   \item{name}{Character sting, name of the plugin package.}
@@ -58,6 +60,23 @@
   be included in the \code{printout()} function. This
   string will be pasted as-is, see
   \code{\link[rkwarddev:rk.JS.doc]{rk.JS.doc}}.}
+
+  \item{create}{A character vector with one or more of
+  these possible entries: \describe{
+  \item{\code{"pmap"}}{Create the \code{.pluginmap} file.}
+  \item{\code{"xml"}}{Create the plugin \code{.xml} XML
+  file skeleton.} \item{\code{"js"}}{Create the plugin
+  \code{.js} JavaScript file skeleton.}
+  \item{\code{"rkh"}}{Create the plugin \code{.rkh} help
+  file skeleton.} \item{\code{"desc"}}{Create the
+  \code{DESCRIPTION} file.} } Default is to create all of
+  these files. Existing files will only be overwritten if
+  \code{overwrite=TRUE}.}
+
+  \item{edit}{Logical, if \code{TRUE} RKWard will
+  automatically open the created files for editing, by
+  calling \code{rk.edit.files}. This applies to all files
+  defined in \code{create}.}
 }
 \description{
   Create skeleton for RKWard plugins

Modified: trunk/rkward/rkward/rbackend/rpackages/rkwarddev/man/rkwarddev-package.Rd
===================================================================
--- trunk/rkward/rkward/rbackend/rpackages/rkwarddev/man/rkwarddev-package.Rd	2011-09-22 16:21:52 UTC (rev 3818)
+++ trunk/rkward/rkward/rbackend/rpackages/rkwarddev/man/rkwarddev-package.Rd	2011-09-22 20:23:53 UTC (rev 3819)
@@ -9,7 +9,7 @@
 \details{
   \tabular{ll}{ Package: \tab rkwarddev\cr Type: \tab
   Package\cr Version: \tab 0.01-4\cr Date: \tab
-  2011-09-22\cr Depends: \tab R (>= 2.9.0), XiMpLe\cr
+  2011-09-22\cr Depends: \tab R (>= 2.9.0),XiMpLe,rkward\cr
   Enhances: \tab rkward\cr Encoding: \tab UTF-8\cr License:
   \tab GPL (>= 3)\cr LazyLoad: \tab yes\cr URL: \tab
   http://rkward.sourceforge.net\cr }

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.





More information about the rkward-tracker mailing list