Skip to content

Commit 3df05ed

Browse files
authored
Merge pull request #631 from RcppCore/feature/bib_file
Feature/bib file
2 parents 5625a23 + 8a17a21 commit 3df05ed

File tree

12 files changed

+54
-33
lines changed

12 files changed

+54
-33
lines changed

ChangeLog

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
2017-01-12 Dirk Eddelbuettel <[email protected]>
2+
3+
* inst/bib/Rcpp.bib: Moved from vignettes/ directory
4+
* R/bib.R (bib): Idem
5+
6+
* vignettes/Rcpp-FAQ.Rnw: Evaluate \Sexpr{Rcpp:::bib()}
7+
* vignettes/Rcpp-attributes.Rnw: Idem
8+
* vignettes/Rcpp-extending.Rnw: Idem
9+
* vignettes/Rcpp-introduction.Rnw: Idem
10+
* vignettes/Rcpp-modules.Rnw: Idem
11+
* vignettes/Rcpp-packages.Rnw: Idem
12+
* vignettes/Rcpp-sugar.Rnw: Idem
13+
14+
* inst/unitTests/runit.misc.R (test.bib): New test
15+
116
2017-01-11 Dirk Eddelbuettel <[email protected]>
217

318
* vignettes/Rcpp.bib: Updated references

R/bib.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (C) 2010 - 2012 Dirk Eddelbuettel and Romain Francois
1+
# Copyright (C) 2010 - 2017 Dirk Eddelbuettel and Romain Francois
22
#
33
# This file is part of Rcpp.
44
#
@@ -16,5 +16,5 @@
1616
# along with Rcpp. If not, see <http://www.gnu.org/licenses/>.
1717

1818
bib <- function() {
19-
sub("\\.bib$", "", system.file( "doc", "Rcpp.bib", package = "Rcpp" ) )
19+
sub("\\.bib$", "", system.file("bib", "Rcpp.bib", package = "Rcpp"))
2020
}

inst/NEWS.Rd

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@
3232
\itemize{
3333
\item Exposed pointers macros were included in the Rcpp Extending vignette
3434
(MathurinD; James Balamuta in \ghpr{592} addressing \ghit{418}).
35+
\item The file \code{Rcpp.bib} move to directory \code{bib} which is
36+
guaranteed to be present.
3537
}
3638
\item Changes in Rcpp build system
3739
\itemize{
File renamed without changes.

inst/unitTests/runit.misc.R

Lines changed: 28 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env r
22
#
3-
# Copyright (C) 2010 - 2015 Dirk Eddelbuettel and Romain Francois
3+
# Copyright (C) 2010 - 2017 Dirk Eddelbuettel and Romain Francois
44
#
55
# This file is part of Rcpp.
66
#
@@ -98,78 +98,78 @@ if (.runThisTest) {
9898
}
9999

100100
test.AreMacrosDefined <- function(){
101-
checkTrue( Rcpp:::areMacrosDefined( "__cplusplus" ) )
101+
checkTrue( Rcpp:::areMacrosDefined( "__cplusplus" ) )
102102
}
103-
103+
104104
test.rcout <- function(){
105105
## define test string that is written to two files
106106
teststr <- "First line.\nSecond line."
107107

108108
rcppfile <- tempfile()
109109
rfile <- tempfile()
110-
110+
111111
## write to test_rcpp.txt from Rcpp
112112
test_rcout(rcppfile, teststr )
113-
113+
114114
## write to test_r.txt from R
115115
cat( teststr, file=rfile, sep='\n' )
116-
116+
117117
## compare whether the two files have the same data
118-
checkEquals( readLines(rcppfile), readLines(rfile), msg="Rcout output")
118+
checkEquals( readLines(rcppfile), readLines(rfile), msg="Rcout output")
119119
}
120120

121121
test.rcout.complex <- function(){
122122

123123
rcppfile <- tempfile()
124124
rfile <- tempfile()
125-
125+
126126
z <- complex(real=sample(1:10, 1), imaginary=sample(1:10, 1))
127-
127+
128128
## write to test_rcpp.txt from Rcpp
129129
test_rcout_rcomplex(rcppfile, z )
130-
130+
131131
## write to test_r.txt from R
132132
cat( z, file=rfile, sep='\n' )
133-
133+
134134
## compare whether the two files have the same data
135-
checkEquals( readLines(rcppfile), readLines(rfile), msg="Rcout Rcomplex")
135+
checkEquals( readLines(rcppfile), readLines(rfile), msg="Rcout Rcomplex")
136136
}
137137

138138
test.na_proxy <- function(){
139-
checkEquals(
140-
na_proxy(),
141-
rep(c(TRUE,TRUE,TRUE,FALSE,FALSE,FALSE,FALSE,FALSE,FALSE) , 2),
139+
checkEquals(
140+
na_proxy(),
141+
rep(c(TRUE,TRUE,TRUE,FALSE,FALSE,FALSE,FALSE,FALSE,FALSE) , 2),
142142
msg = "Na_Proxy NA == handling"
143-
)
143+
)
144144
}
145145

146146
test.StretchyList <- function(){
147-
checkEquals(
147+
checkEquals(
148148
stretchy_list(),
149149
pairlist( "foo", 1L, 3.2 )
150150
)
151151
}
152152

153153
test.named_StretchyList <- function(){
154-
checkEquals(
154+
checkEquals(
155155
named_stretchy_list(),
156156
pairlist( a = "foo", b = 1L, c = 3.2 )
157157
)
158158
}
159-
159+
160160
test.stop.variadic <- function(){
161161
m <- tryCatch( test_stop_variadic(), error = function(e){
162-
conditionMessage(e)
162+
conditionMessage(e)
163163
})
164-
checkEquals( m, "foo 3" )
164+
checkEquals( m, "foo 3" )
165165
}
166166

167167
test.NullableForNull <- function() {
168168
M <- matrix(1:4, 2, 2)
169169
checkTrue( testNullableForNull(NULL) )
170170
checkTrue( ! testNullableForNull(M) )
171171
}
172-
172+
173173
test.NullableForNotNull <- function() {
174174
M <- matrix(1:4, 2, 2)
175175
checkTrue( ! testNullableForNotNull(NULL) )
@@ -180,7 +180,7 @@ if (.runThisTest) {
180180
M <- matrix(1:4, 2, 2)
181181
checkEquals( testNullableOperator(M), M )
182182
}
183-
183+
184184
test.NullableAccessGet <- function() {
185185
M <- matrix(1:4, 2, 2)
186186
checkEquals( testNullableGet(M), M )
@@ -209,4 +209,9 @@ if (.runThisTest) {
209209
checkEquals(testNullableString(), "")
210210
checkEquals(testNullableString("blah"), "blah")
211211
}
212+
213+
test.bib <- function() {
214+
checkTrue(nchar(Rcpp:::bib()) > 0, msg="bib file")
215+
}
216+
212217
}

vignettes/Rcpp-FAQ.Rnw

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1329,7 +1329,6 @@ We have since switched to a \href{http://github.com/RcppCore/Rcpp}{Git
13291329
\pkg{RcppEigen}).
13301330

13311331
\bibliographystyle{plainnat}
1332-
\bibliography{Rcpp}
1333-
1332+
\bibliography{\Sexpr{Rcpp:::bib()}}
13341333
\end{document}
13351334

vignettes/Rcpp-attributes.Rnw

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -823,7 +823,7 @@ when headers in \texttt{inst/include} change, so you should be sure to perform a
823823
full rebuild of the package after making changes to these headers.
824824

825825
\bibliographystyle{plainnat}
826-
\bibliography{Rcpp}
826+
\bibliography{\Sexpr{Rcpp:::bib()}}
827827

828828
\end{document}
829829

vignettes/Rcpp-extending.Rnw

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ to either user-defined or third-party classes via the \texttt{Rcpp::as} and
367367
approaches were discussed.
368368

369369
\bibliographystyle{plainnat}
370-
\bibliography{Rcpp}
370+
\bibliography{\Sexpr{Rcpp:::bib()}}
371371

372372
\end{document}
373373

vignettes/Rcpp-introduction.Rnw

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1064,7 +1064,7 @@ Ligges, Brian Ripley and Simon Urbanek concerning the build systems for differen
10641064
platforms. Last but not least, several users provided very fruitful
10651065
ideas for new or extended features via the \code{rcpp-devel} mailing list.
10661066

1067-
\bibliography{Rcpp}
1067+
\bibliography{\Sexpr{Rcpp:::bib()}}
10681068

10691069
\vspace*{-0.35cm}
10701070

vignettes/Rcpp-modules.Rnw

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1047,7 +1047,7 @@ We hope that \proglang{R} and \proglang{C++} programmers
10471047
find \textsl{Rcpp modules} useful.
10481048

10491049
\bibliographystyle{plainnat}
1050-
\bibliography{Rcpp}
1050+
\bibliography{\Sexpr{Rcpp:::bib()}}
10511051

10521052
\end{document}
10531053

0 commit comments

Comments
 (0)