Skip to content

Commit

Permalink
Merge 8c62900 into bb0f91a
Browse files Browse the repository at this point in the history
  • Loading branch information
robertzk committed Jan 1, 2016
2 parents bb0f91a + 8c62900 commit 9de35a5
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 5 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,8 @@
## 0.3.0.5.9000

* Started development version and fixed issue with modification
tracking on virtual resources.

## 0.3.0.5

* Fix an issue where sourcing a virtual resource with a preprocessor
Expand Down
2 changes: 1 addition & 1 deletion DESCRIPTION
Expand Up @@ -5,7 +5,7 @@ Description: Director is responsible for managing and loading resources in
consecutive loads of resources (so that we can tell if a script was modified
since we last ran it) and defining parsers that allow us to generalize from
the pernicious simple linear execution that is common to R.
Version: 0.3.0.5
Version: 0.3.0.5.9000
Authors@R: c(person("Robert", "Krzyzanowski",
email = "technoguyrob@gmail.com", role = c("aut", "cre")))
Depends:
Expand Down
12 changes: 9 additions & 3 deletions R/resource-modification_tracker.R
Expand Up @@ -107,10 +107,16 @@ modification_tracker <- function(object, ..., modification_tracker.return = "obj
## We injected `virtual` in the previous layer, `virtual_checker`, using
## `object$injects %<<% list(virtual = virtual)`
if (isTRUE(object$injects$virtual)) {
## Virtual resources are always considered to be modified, since we have
## Virtual resources are never considered to be modified, since we have
## have no corresponding file and we have no way to tell.
object$injects %<<% list(modified = TRUE)
yield()
if (identical(modification_tracker.return, "modified")) {
FALSE
} else if (identical(modification_tracker.return, "mtime")) {
NULL
} else {
object$injects %<<% list(modified = FALSE)
yield()
}
} else {
## In order to keep track of whether the resource has been modified,
## we will need to store the previous and current modification time
Expand Down
3 changes: 2 additions & 1 deletion R/resource-parser.R
Expand Up @@ -44,7 +44,8 @@ apply_parser <- function(active_resource, route, args) {
environment(parser_function)

environment(parser_function) <-
new.env(parent = sourcing_env) %<<% list(
new.env(parent = sourcing_env) %<<%
active_resource$injects %<<% list(
# TODO: (RK) Intersect with parser formals.
# TODO: (RK) Use alist so these aren't evaluated right away.
resource = active_resource$resource$name,
Expand Down

0 comments on commit 9de35a5

Please sign in to comment.