@@ -92,7 +92,7 @@ exposeClass <- function(class, constructors, fields, methods,
92
92
}
93
93
if (is.character(file )) {
94
94
# # are we in a package directory? Writable, searchable src subdirectory:
95
- if (file.access(" src" ,3 )== 0 )
95
+ if (file.access(" src" ,3 )== 0 && (basename( file ) == file ) )
96
96
cfile <- file.path(" src" , file )
97
97
else
98
98
cfile <- file
@@ -107,7 +107,7 @@ exposeClass <- function(class, constructors, fields, methods,
107
107
if (identical(Rfile , TRUE ))
108
108
Rfile <- sprintf(" %sClass.R" ,class )
109
109
if (is.character(Rfile )) {
110
- if (file.access(" R" ,3 )== 0 ) # in a package directory
110
+ if (file.access(" R" ,3 )== 0 && (basename( file ) == file ) ) # in a package directory
111
111
Rfile <- file.path(" R" , Rfile )
112
112
Rcon <- file(Rfile , " w" )
113
113
msg <- sprintf(" Wrote R file \" %s\" " ,Rfile )
@@ -200,11 +200,11 @@ exposeClass <- function(class, constructors, fields, methods,
200
200
if (missing(CppClass ))
201
201
CppString <- " "
202
202
else
203
- CppString <- paste (" ," ,dQuote( CppClass ) )
203
+ CppString <- paste0 (" , \" " , CppClass , " \" " )
204
204
if (missing(module ))
205
205
ModString <- " "
206
206
else
207
- ModString <- paste (" , module =" , dQuote( module ) )
207
+ ModString <- paste0 (" , module = \" " , module , " \" " )
208
208
writeLines(sprintf(" %s <- setRcppClass(\" %s\" %s%s)" ,
209
209
class , class , CppString ,ModString ), Rcon )
210
210
}
0 commit comments