Permalink
Browse files

Single function for finding Rd files.

Fixes #195
  • Loading branch information...
1 parent d83df73 commit 1527d512d3b01954f3b5f993b27de143ab9f921e @hadley committed Dec 12, 2012
Showing with 10 additions and 7 deletions.
  1. +9 −4 R/run-examples.r
  2. +1 −3 R/topic-index.r
View
@@ -27,10 +27,7 @@ run_examples <- function(pkg = ".", start = NULL, show = TRUE, test = FALSE, run
on.exit(load_all(pkg, reset = TRUE))
document(pkg, reload = FALSE)
- path_man <- file.path(pkg$path, "man")
- files <- dir(path_man, pattern = "\\.[Rr]d$", full.names = TRUE)
- names(files) <- basename(files)
- files <- with_collate("C", sort(files))
+ files <- rd_files(pkg)
if (!is.null(start)) {
start_path <- find_pkg_topic(pkg, start)
@@ -57,3 +54,11 @@ run_examples <- function(pkg = ".", start = NULL, show = TRUE, test = FALSE, run
# * browser
# * rerun example and rerun
# * reload code and rerun
+
+
+rd_files <- function(pkg) {
+ path_man <- file.path(pkg$path, "man")
+ files <- dir(path_man, pattern = "\\.[Rr]d$", full.names = TRUE)
+ names(files) <- basename(files)
+ with_collate("C", sort(files))
+}
View
@@ -61,9 +61,7 @@ clear_topic_index <- function(pkg = ".") {
#' @importFrom tools parse_Rd
build_topic_index <- function(pkg = ".") {
pkg <- as.package(pkg)
-
- rds <- dir(file.path(pkg, "man"), full.names = TRUE)
- names(rds) <- basename(rds)
+ rds <- rd_files(pkg)
aliases <- function(path) {
parsed <- parse_Rd(path)

0 comments on commit 1527d51

Please sign in to comment.