Skip to content

Commit d418007

Browse files
spgarbetcran-robot
authored andcommitted
version 2.3.8
1 parent 31d9bbd commit d418007

File tree

9 files changed

+65
-19
lines changed

9 files changed

+65
-19
lines changed

DESCRIPTION

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
Package: yaml
22
Type: Package
33
Title: Methods to Convert R Data to YAML and Back
4-
Date: 2023-01-18
5-
Version: 2.3.7
4+
Date: 2023-11-28
5+
Version: 2.3.8
66
Suggests: RUnit
77
Author: Shawn P Garbett [aut], Jeremy Stephens [aut, cre], Kirill Simonov [aut], Yihui Xie [ctb],
88
Zhuoer Dong [ctb], Hadley Wickham [ctb], Jeffrey Horner [ctb], reikoch [ctb],
@@ -15,6 +15,6 @@ Description: Implements the 'libyaml' 'YAML' 1.1 parser and emitter
1515
URL: https://github.com/vubiostat/r-yaml/
1616
BugReports: https://github.com/vubiostat/r-yaml/issues
1717
NeedsCompilation: yes
18-
Packaged: 2023-01-18 17:20:16 UTC; garbetsp
18+
Packaged: 2023-12-11 16:46:09 UTC; garbetsp
1919
Repository: CRAN
20-
Date/Publication: 2023-01-23 18:40:02 UTC
20+
Date/Publication: 2023-12-11 18:50:02 UTC

MD5

+8-6
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
bbba10d958545e3425cc20f316d9da75 *COPYING
2-
f1de57ea2406878a414eeff439a66ecb *DESCRIPTION
2+
eceb0a0787e1e53016d4650fb3a4599e *DESCRIPTION
33
59797fdd34baf532ba0e4c97bc5e3cf8 *LICENSE
4-
17a16244d43d0cfe5439535f4695dd7f *NAMESPACE
4+
84e3c05130718b3c373f57fbb809cb86 *NAMESPACE
55
b901a42735294b31cf1d91b526714858 *R/as.yaml.R
66
0bb1cc5151f96c8da86eb7080d697e52 *R/read_yaml.R
7+
70f4ab72b534ebb247efbce07d407c83 *R/verbatim_logical.R
78
41bba07a114c49bbdfe2b025403c89c0 *R/write_yaml.R
89
29e454510ffb615b4391eb999ba99670 *R/yaml.load.R
910
58bb803b31e71d93b9279a3c74fc1552 *R/yaml.load_file.R
1011
59d3ef441a03e63a67784ef7d111f8fe *R/zzz.R
11-
d80709e9248820ed1455ad21562b95ad *inst/CHANGELOG
12+
76a8e161e6b42aba2ffd2d3f1777a8f1 *inst/CHANGELOG
1213
616265f0a9f5aacfdec8802f2e82d5ff *inst/THANKS
1314
39a3d6c0eded3941e7ca0d3c1b26f8a5 *inst/implicit.re
1415
0625a433dcef8def801ea9ed2a7396c9 *inst/tests/files/merge.yml
@@ -18,8 +19,9 @@ b70b0ade3126a031e5bf77d8aa9af4f2 *inst/tests/files/test.yml
1819
f0258adf12eff3e4ef781d06ed5ca659 *inst/tests/test_write_yaml.R
1920
244044b994ffb7c56925020516202720 *inst/tests/test_yaml_load.R
2021
f6e8413262b60d2b926f4cbad12b1bed *inst/tests/test_yaml_load_file.R
21-
b28b3dca8fb45d671bf003f30de49879 *man/as.yaml.Rd
22+
303be7867757feba4aad55b866e01946 *man/as.yaml.Rd
2223
11563d3fabb3788f025131444aa35e8b *man/read_yaml.Rd
24+
0b2030532868feea28c54a3600fddaa9 *man/verbatim_logical.Rd
2325
466b1a01bd0eead68a25633559e01ad3 *man/write_yaml.Rd
2426
baab030c01a0f2f7eeb99c8d7355c014 *man/yaml.load.Rd
2527
6b0576349be43cf3d872205b41aff77d *src/Makevars
@@ -29,10 +31,10 @@ a085415195f7814d2bbca52ec4e517d1 *src/emitter.c
2931
9cfda206be239794d470b8148bbc9a69 *src/implicit.c
3032
adea9625fc3b724041e4a5e3947392f8 *src/loader.c
3133
9c4f0181665c37d4bcdd05535e6a2130 *src/parser.c
32-
4ff87409bae3d51bab6f037372f23f56 *src/r_emit.c
34+
d6194640ed6d599c41f297906c68533f *src/r_emit.c
3335
54485eec23a3e3416821863f93d97753 *src/r_ext.c
3436
acc43ebc0942c7ec36f4f13ef2fc4747 *src/r_ext.h
35-
a983155ff509eead126ee27042771709 *src/r_parse.c
37+
d12dfca0fc247f8cc9e48e60bef17429 *src/r_parse.c
3638
efcea8b4a8bcfbc96ae32abd0f18e472 *src/reader.c
3739
830f57f176e768c7fa97d086de18050d *src/scanner.c
3840
7b2e815cfd48dbfd462f3bd317059e3f *src/writer.c

NAMESPACE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
useDynLib(yaml, .registration = TRUE, .fixes = "C_")
2-
export(as.yaml, yaml.load_file, yaml.load, read_yaml, write_yaml)
2+
export(as.yaml, yaml.load_file, yaml.load, read_yaml, write_yaml, verbatim_logical)

R/verbatim_logical.R

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
verbatim_logical <- function(x) {
2+
result <- tolower(as.logical(x))
3+
class(result) <- "verbatim"
4+
return(result)
5+
}

inst/CHANGELOG

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
### Release Notes
2+
v2.3.8 added verbatim_logical helper function
23

34
v2.3.7 clang deprecated sprintf. Changed in included clib to snprintf
45

man/as.yaml.Rd

+1-6
Original file line numberDiff line numberDiff line change
@@ -88,12 +88,7 @@
8888
# custom handler with verbatim output to change how logical vectors are
8989
# emitted
9090
as.yaml(c(TRUE, FALSE), handlers = list(
91-
logical = function(x) {
92-
result <- ifelse(x, "true", "false")
93-
class(result) <- "verbatim"
94-
return(result)
95-
}
96-
))
91+
logical = verbatim_logical))
9792
9893
# force quotes around a string
9994
port_def <- "80:80"

man/verbatim_logical.Rd

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
\name{verbatim_logical}
2+
\alias{verbatim_logical}
3+
%- Also NEED an '\alias' for EACH other topic documented here.
4+
\title{
5+
Alternalte logical handler
6+
}
7+
\description{
8+
A yaml handler function that will cause logical vectors to emit true/false value
9+
instead of yes/no value
10+
}
11+
\usage{
12+
verbatim_logical(x)
13+
}
14+
%- maybe also 'usage' for other objects documented here.
15+
\arguments{
16+
\item{x}{
17+
logical values to convert to \code{true} or \code{false}.
18+
}
19+
}
20+
\details{
21+
To use pass into as.yaml as part of a handler arguement list like
22+
\code{list(logical=verbatim_logical)}.
23+
}
24+
\value{
25+
Returns a vector of strings of either \code{true} or \code{false} of class
26+
\code{verbatim}.
27+
}
28+
\author{
29+
Charles Dupont and James Goldie (jimjam-slam)
30+
}
31+
32+
%% ~Make other sections like Warning with \section{Warning }{....} ~
33+
34+
\seealso{
35+
\code{\link{as.yaml}}
36+
}
37+
\examples{
38+
vector <- c(TRUE, FALSE, TRUE)
39+
40+
as.yaml(vector, handlers=list(logical=verbatim_logical))
41+
}
42+
\keyword{ data }
43+
\keyword{ manip }

src/r_emit.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -954,7 +954,7 @@ SEXP Ryaml_serialize_to_yaml(
954954
free(output.buffer);
955955
}
956956
else {
957-
error(Ryaml_error_msg);
957+
error("%s", Ryaml_error_msg);
958958
}
959959

960960
return s_retval;

src/r_parse.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1340,7 +1340,7 @@ SEXP Ryaml_unserialize_from_yaml(
13401340
free(error_msg_copy);
13411341
}
13421342
}
1343-
error(Ryaml_error_msg);
1343+
error("%s", Ryaml_error_msg);
13441344
}
13451345

13461346
UNPROTECT(3); /* s_stack_head, s_aliases_head, s_handlers */

0 commit comments

Comments
 (0)