[rkward-cvs] SF.net SVN: rkward:[4200] trunk/rkward/packages/rkwarddev

m-eik at users.sourceforge.net m-eik at users.sourceforge.net
Sat Apr 7 22:00:35 UTC 2012


Revision: 4200
          http://rkward.svn.sourceforge.net/rkward/?rev=4200&view=rev
Author:   m-eik
Date:     2012-04-07 22:00:34 +0000 (Sat, 07 Apr 2012)
Log Message:
-----------
fixed rk.XML.frame() bug and added generation of initial ChangeLog files

Modified Paths:
--------------
    trunk/rkward/packages/rkwarddev/ChangeLog
    trunk/rkward/packages/rkwarddev/DESCRIPTION
    trunk/rkward/packages/rkwarddev/R/rk-internal.R
    trunk/rkward/packages/rkwarddev/R/rk.XML.frame.R
    trunk/rkward/packages/rkwarddev/R/rk.plugin.skeleton.R
    trunk/rkward/packages/rkwarddev/R/rkwarddev-package.R
    trunk/rkward/packages/rkwarddev/inst/CITATION
    trunk/rkward/packages/rkwarddev/inst/NEWS.Rd
    trunk/rkward/packages/rkwarddev/inst/doc/rkwarddev_vignette.pdf
    trunk/rkward/packages/rkwarddev/man/rk.plugin.skeleton.Rd
    trunk/rkward/packages/rkwarddev/man/rkwarddev-package.Rd

Modified: trunk/rkward/packages/rkwarddev/ChangeLog
===================================================================
--- trunk/rkward/packages/rkwarddev/ChangeLog	2012-03-27 08:39:47 UTC (rev 4199)
+++ trunk/rkward/packages/rkwarddev/ChangeLog	2012-04-07 22:00:34 UTC (rev 4200)
@@ -1,5 +1,16 @@
 ChangeLog for package rkwarddev
 
+changes in version 0.05-5 (2012-04-07)
+added:
+  - rk.plugin.skeleton() can now also generate initial ChangeLog files (but won't overwrite existing ones)
+changed:
+  - if files are being skipped by rk.plugin.skeleton(), the corresponding warning will now include the 'create'
+    actions that these files belong to
+
+changes in version 0.05-4 (2012-04-06)
+fixed:
+  - rk.XML.frame() didn't generate attributes due to a typo
+
 changes in version 0.05-3 (2012-03-18)
   - fixed: rk.XML.text() now preserves XML tags in the text value
   - internally, functions now call XiMpLe::XMLNode() and XiMpLe::XMLTree() constructors instead of new(),

Modified: trunk/rkward/packages/rkwarddev/DESCRIPTION
===================================================================
--- trunk/rkward/packages/rkwarddev/DESCRIPTION	2012-03-27 08:39:47 UTC (rev 4199)
+++ trunk/rkward/packages/rkwarddev/DESCRIPTION	2012-04-07 22:00:34 UTC (rev 4200)
@@ -14,8 +14,8 @@
 URL: http://rkward.sourceforge.net
 Authors at R: c(person(given="Meik", family="Michalke",
     email="meik.michalke at hhu.de", role=c("aut", "cre")))
-Version: 0.05-3
-Date: 2012-03-18
+Version: 0.05-5
+Date: 2012-04-07
 Collate:
     'echo.R'
     'id.R'

Modified: trunk/rkward/packages/rkwarddev/R/rk-internal.R
===================================================================
--- trunk/rkward/packages/rkwarddev/R/rk-internal.R	2012-03-27 08:39:47 UTC (rev 4199)
+++ trunk/rkward/packages/rkwarddev/R/rk-internal.R	2012-04-07 22:00:34 UTC (rev 4200)
@@ -55,11 +55,14 @@
 
 ## function checkCreateFiles()
 # used by rk.plugin.skeleton()
-checkCreateFiles <- function(file.name, ow){
+checkCreateFiles <- function(file.name, ow, action=NULL){
 	if(all(file.exists(file.name), as.logical(ow)) | !file.exists(file.name)){
 		return(TRUE)
 	} else {
-		warning(paste("Skipping existing file ", file.name, ".", sep=""))
+		if(!is.null(action)){
+			action <- paste(action, ": ", sep="")
+		} else {}
+		warning(paste(action, "Skipping existing file ", file.name, ".", sep=""), call.=FALSE)
 		return(FALSE)
 	}
 } ## end function checkCreateFiles()

Modified: trunk/rkward/packages/rkwarddev/R/rk.XML.frame.R
===================================================================
--- trunk/rkward/packages/rkwarddev/R/rk.XML.frame.R	2012-03-27 08:39:47 UTC (rev 4199)
+++ trunk/rkward/packages/rkwarddev/R/rk.XML.frame.R	2012-04-07 22:00:34 UTC (rev 4200)
@@ -46,7 +46,7 @@
 	} else {}
 
 	frame <- XMLNode("frame",
-			attributes=attr.list,
+			attrs=attr.list,
 			.children=child.list(nodes, empty=FALSE)
 		)
 

Modified: trunk/rkward/packages/rkwarddev/R/rk.plugin.skeleton.R
===================================================================
--- trunk/rkward/packages/rkwarddev/R/rk.plugin.skeleton.R	2012-03-27 08:39:47 UTC (rev 4199)
+++ trunk/rkward/packages/rkwarddev/R/rk.plugin.skeleton.R	2012-04-07 22:00:34 UTC (rev 4200)
@@ -50,6 +50,7 @@
 #'			\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.}
+#'			\item{\code{"clog"}}{Create the \code{ChangeLog} file (only if none exists).}
 #'		}
 #'		Default is to create all of these files. Existing files will only be overwritten if \code{overwrite=TRUE}.
 #' @param suggest.required Logical, if \code{TRUE} R package dependencies in \code{about} will be added to the \code{Suggests:}
@@ -131,7 +132,7 @@
 	scan=c("var", "saveobj", "settings"),
 	xml=list(), js=list(), pluginmap=list(), rkh=list(),
 	overwrite=FALSE, tests=TRUE, lazyLoad=TRUE,
-	create=c("pmap", "xml", "js", "rkh", "desc"), suggest.required=TRUE,
+	create=c("pmap", "xml", "js", "rkh", "desc", "clog"), suggest.required=TRUE,
 	components=list(), edit=FALSE, load=FALSE, show=FALSE, gen.info=TRUE, indent.by="\t"){
 
 	if(inherits(about, "XiMpLe.node")){
@@ -147,8 +148,8 @@
 	} else if(is.character(about) & length(about) == 1) {
 		name <- about
 		about.node <- NULL
-		# also stop creation of DESCRIPTION file
-		create <- create[!create %in% "desc"]
+		# also stop creation of DESCRIPTION and ChangeLog files
+		create <- create[!create %in% c("desc", "clog")]
 	} else {
 		stop(simpleError("'about' must be a character string or XiMpLe.node, see ?rk.XML.about()!"))
 	}
@@ -162,6 +163,7 @@
 	R.dir <- file.path(main.dir, "R")
 	description.file <- file.path(main.dir, "DESCRIPTION")
 	namespace.file <- file.path(main.dir, "NAMESPACE")
+	changelog.file <- file.path(main.dir, "ChangeLog")
 	rkward.dir <- file.path(main.dir, "inst", "rkward")
 	plugin.dir <- file.path(rkward.dir, "plugins")
 	# the basic file names
@@ -240,7 +242,7 @@
 
 			## create plugin.xml
 			if("xml" %in% create){
-				if(isTRUE(checkCreateFiles(plugin.xml, ow=overwrite))){
+				if(isTRUE(checkCreateFiles(plugin.xml, ow=overwrite, action="xml"))){
 					cat(pasteXML(XML.plugin, shine=1, indent.by=indent.by), file=plugin.xml)
 				} else {}
 				if(isTRUE(edit)){
@@ -250,7 +252,7 @@
 
 			## create plugin.js
 			if("js" %in% create){
-				if(isTRUE(checkCreateFiles(plugin.js, ow=overwrite))){
+				if(isTRUE(checkCreateFiles(plugin.js, ow=overwrite, action="js"))){
 					cat(JS.code, file=plugin.js)
 				} else {}
 				if(isTRUE(edit)){
@@ -260,7 +262,7 @@
 
 			## create plugin.rkh
 			if("rkh" %in% create){
-				if(isTRUE(checkCreateFiles(plugin.rkh, ow=overwrite))){
+				if(isTRUE(checkCreateFiles(plugin.rkh, ow=overwrite, action="rkh"))){
 					cat(pasteXML(rkh.doc, shine=1, indent.by=indent.by), file=plugin.rkh)
 				} else {}
 				if(isTRUE(edit)){
@@ -272,7 +274,7 @@
 
 	## create plugin.pluginmap
 	if("pmap" %in% create){
-		if(isTRUE(checkCreateFiles(plugin.pluginmap, ow=overwrite))){
+		if(isTRUE(checkCreateFiles(plugin.pluginmap, ow=overwrite, action="pmap"))){
 			if(!"require" %in% got.pm.options) {
 				pluginmap[["require"]] <- eval(formals(rk.XML.pluginmap)[["require"]])
 			} else {}
@@ -320,14 +322,14 @@
 	} else {}
 
 	## create testsuite.R
-	if(isTRUE(tests) & isTRUE(checkCreateFiles(testsuite.file, ow=overwrite))){
+	if(isTRUE(tests) & isTRUE(checkCreateFiles(testsuite.file, ow=overwrite, action="tests"))){
 		testsuite.doc <- rk.testsuite.doc(name=name)
 		cat(testsuite.doc, file=testsuite.file)
 	} else {}
 
 	## create DESCRIPTION file
 	if("desc" %in% create){
-		if(isTRUE(checkCreateFiles(description.file, ow=overwrite))){
+		if(isTRUE(checkCreateFiles(description.file, ow=overwrite, action="desc"))){
 			authors <- XML2person(about.node, eval=TRUE)
 			all.authors <- format(get.by.role(authors, role="aut"),
 				include=c("given", "family", "email"), braces=list(email=c("<", ">")))
@@ -380,5 +382,19 @@
 		} else {}
 	} else {}
 
+	## create ChangeLog file (if none exists)
+	if("clog" %in% create){
+		if(isTRUE(checkCreateFiles(changelog.file, ow=FALSE, action="clog"))){
+			changelog.text <- paste("ChangeLog for package ", name,
+				"\n\nChanges in version ", slot(about.node, "attributes")[["version"]],
+				" (", slot(about.node, "attributes")[["releasedate"]],")",
+				"\nChanges:\n  - initial package build\nAdded:\n  - added a ChangeLog file\nFixed:\n  - ...\n", sep="")
+			cat(changelog.text, file=changelog.file)
+		} else {}
+		if(isTRUE(edit)){
+			rk.edit.files(changelog.file, title="ChangeLog", prompt=FALSE)
+		} else {}
+	} else {}
+
 	return(main.dir)
 }

Modified: trunk/rkward/packages/rkwarddev/R/rkwarddev-package.R
===================================================================
--- trunk/rkward/packages/rkwarddev/R/rkwarddev-package.R	2012-03-27 08:39:47 UTC (rev 4199)
+++ trunk/rkward/packages/rkwarddev/R/rkwarddev-package.R	2012-04-07 22:00:34 UTC (rev 4200)
@@ -3,8 +3,8 @@
 #' \tabular{ll}{
 #' Package: \tab rkwarddev\cr
 #' Type: \tab Package\cr
-#' Version: \tab 0.05-3\cr
-#' Date: \tab 2012-03-18\cr
+#' Version: \tab 0.05-5\cr
+#' Date: \tab 2012-04-07\cr
 #' Depends: \tab R (>= 2.9.0),methods,XiMpLe (>= 0.03-12),rkward (>= 0.5.6)\cr
 #' Enhances: \tab rkward\cr
 #' Encoding: \tab UTF-8\cr

Modified: trunk/rkward/packages/rkwarddev/inst/CITATION
===================================================================
--- trunk/rkward/packages/rkwarddev/inst/CITATION	2012-03-27 08:39:47 UTC (rev 4199)
+++ trunk/rkward/packages/rkwarddev/inst/CITATION	2012-04-07 22:00:34 UTC (rev 4200)
@@ -2,12 +2,12 @@
 		title="rkwarddev: A collection of tools for RKWard plugin development",
 		author="Meik Michalke",
 		year="2012",
-		note="(Version 0.05-3)",
+		note="(Version 0.05-5)",
 		url="http://rkward.sourceforge.net",
 
 		textVersion =
 		paste("Michalke, M. (2012). ",
-				"rkwarddev: A collection of tools for RKWard plugin development (Version 0.05-3). ",
+				"rkwarddev: A collection of tools for RKWard plugin development (Version 0.05-5). ",
 				"Available from http://rkward.sourceforge.net",
 				sep=""),
 

Modified: trunk/rkward/packages/rkwarddev/inst/NEWS.Rd
===================================================================
--- trunk/rkward/packages/rkwarddev/inst/NEWS.Rd	2012-03-27 08:39:47 UTC (rev 4199)
+++ trunk/rkward/packages/rkwarddev/inst/NEWS.Rd	2012-04-07 22:00:34 UTC (rev 4200)
@@ -1,6 +1,26 @@
 \name{NEWS}
 \title{News for Package 'rkwarddev'}
 \encoding{UTF-8}
+\section{Changes in rkwarddev version 0.05-5 (2012-04-07)}{
+  \subsection{added}{
+    \itemize{
+      \item \code{rk.plugin.skeleton()} can now also generate initial ChangeLog files (but won't overwrite existing ones)
+    }
+  }
+  \subsection{changed}{
+    \itemize{
+      \item if files are being skipped by \code{rk.plugin.skeleton()}, the corresponding warning will now include the 'create'
+        actions that these files belong to
+    }
+  }
+}
+\section{Changes in rkwarddev version 0.05-4 (2012-04-06)}{
+  \subsection{fixed}{
+    \itemize{
+      \item \code{rk.XML.frame()} didn't generate attributes due to a typo
+    }
+  }
+}
 \section{Changes in rkwarddev version 0.05-3 (2012-03-18)}{
   \itemize{
     \item fixed: \code{rk.XML.text()} now preserves XML tags in the text value

Modified: trunk/rkward/packages/rkwarddev/inst/doc/rkwarddev_vignette.pdf
===================================================================
(Binary files differ)

Modified: trunk/rkward/packages/rkwarddev/man/rk.plugin.skeleton.Rd
===================================================================
--- trunk/rkward/packages/rkwarddev/man/rk.plugin.skeleton.Rd	2012-03-27 08:39:47 UTC (rev 4199)
+++ trunk/rkward/packages/rkwarddev/man/rk.plugin.skeleton.Rd	2012-04-07 22:00:34 UTC (rev 4200)
@@ -7,7 +7,7 @@
     scan = c("var", "saveobj", "settings"), xml = list(),
     js = list(), pluginmap = list(), rkh = list(),
     overwrite = FALSE, tests = TRUE, lazyLoad = TRUE,
-    create = c("pmap", "xml", "js", "rkh", "desc"),
+    create = c("pmap", "xml", "js", "rkh", "desc", "clog"),
     suggest.required = TRUE, components = list(),
     edit = FALSE, load = FALSE, show = FALSE,
     gen.info = TRUE, indent.by = "\t")
@@ -114,9 +114,10 @@
   \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}.}
+  \code{DESCRIPTION} file.} \item{\code{"clog"}}{Create the
+  \code{ChangeLog} file (only if none exists).} } Default
+  is to create all of these files. Existing files will only
+  be overwritten if \code{overwrite=TRUE}.}
 
   \item{suggest.required}{Logical, if \code{TRUE} R package
   dependencies in \code{about} will be added to the

Modified: trunk/rkward/packages/rkwarddev/man/rkwarddev-package.Rd
===================================================================
--- trunk/rkward/packages/rkwarddev/man/rkwarddev-package.Rd	2012-03-27 08:39:47 UTC (rev 4199)
+++ trunk/rkward/packages/rkwarddev/man/rkwarddev-package.Rd	2012-04-07 22:00:34 UTC (rev 4200)
@@ -8,8 +8,8 @@
 }
 \details{
   \tabular{ll}{ Package: \tab rkwarddev\cr Type: \tab
-  Package\cr Version: \tab 0.05-3\cr Date: \tab
-  2012-03-18\cr Depends: \tab R (>= 2.9.0),methods,XiMpLe
+  Package\cr Version: \tab 0.05-5\cr Date: \tab
+  2012-04-07\cr Depends: \tab R (>= 2.9.0),methods,XiMpLe
   (>= 0.03-12),rkward (>= 0.5.6)\cr Enhances: \tab
   rkward\cr Encoding: \tab UTF-8\cr License: \tab GPL (>=
   3)\cr LazyLoad: \tab yes\cr URL: \tab

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