@@ -28,7 +28,7 @@ isBotchedSession <- function()
28
28
assignAs
29
29
}
30
30
31
- .DummyModule <- function (name , what ) {
31
+ .DummyModule <- function (name , what ) { # #nocov start
32
32
value <- new.env()
33
33
storage <- new.env()
34
34
assign(" storage" , storage , envir = value )
@@ -37,7 +37,7 @@ isBotchedSession <- function()
37
37
for (el in allNames )
38
38
assign(el , NULL , envir = storage )
39
39
value
40
- }
40
+ } # #nocov end
41
41
42
42
.moduleMetaName <- function (name )
43
43
methods :: methodsPackageMetaName(" Mod" ,name )
@@ -54,9 +54,9 @@ loadModule <- function( module, what = character(), loadNow,
54
54
if (exists(metaName , envir = env , inherits = FALSE ))
55
55
loadM <- get(metaName , envir = env )
56
56
}
57
- else if (is(module , " Module" )) {
58
- loadM <- as.environment(module )
59
- module <- get(loadM , " moduleName" )
57
+ else if (is(module , " Module" )) {
58
+ loadM <- as.environment(module ) # #nocov
59
+ module <- get(loadM , " moduleName" ) # #nocov
60
60
}
61
61
else
62
62
stop(gettextf(" Argument \" module\" should be a module or the name of a module: got an object of class \" %s\" " , class(module )))
@@ -74,10 +74,10 @@ loadModule <- function( module, what = character(), loadNow,
74
74
loadM <- tryCatch(Module( module , mustStart = TRUE , where = env ),
75
75
error = function (e )e )
76
76
if (is(loadM , " error" )) {
77
- if (.botched )
77
+ if (.botched ) # #nocov start
78
78
return (.DummyModule(module , what ))
79
79
stop(gettextf(" Unable to load module \" %s\" : %s" ,
80
- as(module , " character" ), loadM $ message ))
80
+ as(module , " character" ), loadM $ message )) # #nocov end
81
81
}
82
82
if (! exists(metaName , envir = env , inherits = FALSE ))
83
83
assign(metaName , loadM , envir = env )
@@ -90,7 +90,7 @@ loadModule <- function( module, what = character(), loadNow,
90
90
what <- objects(storage )
91
91
missingObjs <- ! sapply(what , function (symb ) exists(symb , envir = storage , inherits = FALSE ))
92
92
if (any(missingObjs )) {
93
- if (.botched ) {
93
+ if (.botched ) { # #nocov start
94
94
for (el in what [missingObjs ])
95
95
assign(el , NULL , envir = storage )
96
96
}
@@ -99,7 +99,7 @@ loadModule <- function( module, what = character(), loadNow,
99
99
paste0(' "' , what [missingObjs ], ' "' , collapse = " , " ),
100
100
as.character(module )))
101
101
what <- what [! missingObjs ]
102
- }
102
+ } # #nocov end
103
103
}
104
104
assignAs <- .moduleNames(what )
105
105
for ( i in seq_along(what ) ) {
@@ -117,7 +117,7 @@ loadModule <- function( module, what = character(), loadNow,
117
117
myCall $ loadNow <- TRUE
118
118
body(f , envir = env ) <- myCall
119
119
setLoadAction(f , where = env )
120
- invisible (myCall )
120
+ invisible (myCall ) # #nocov
121
121
}
122
122
}
123
123
0 commit comments