Skip to content

Commit d46721b

Browse files
committed
prep for release
1 parent f1772fb commit d46721b

23 files changed

+271
-181
lines changed

DESCRIPTION

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,30 @@
11
Type: Package
22
Package: rotor
33
Title: Log Rotation and Conditional Backups
4-
Version: 0.2.1.9005
4+
Version: 0.2.2
55
Authors@R:
66
person(given = "Stefan",
77
family = "Fleck",
88
role = c("aut", "cre"),
99
email = "[email protected]",
1010
comment = c(ORCID = "0000-0003-3344-9851"))
1111
Maintainer: Stefan Fleck <[email protected]>
12-
Description: Conditionally rotate or back-up files based on their size or the
13-
date of the last backup; inspired by the 'Linux' utility 'logrotate'.
12+
Description: Conditionally rotate or back-up files based on
13+
their size or the date of the last backup; inspired by the 'Linux'
14+
utility 'logrotate'.
1415
License: MIT + file LICENSE
1516
Imports:
16-
tools,
17+
dint,
1718
R6,
18-
dint
19+
tools
1920
Suggests:
20-
testthat,
21+
covr,
2122
crayon,
22-
zip,
23+
rmarkdown,
24+
testthat,
2325
withr,
24-
covr,
25-
rmarkdown
26+
zip
2627
Encoding: UTF-8
2728
LazyData: true
28-
RoxygenNote: 6.1.1
2929
Roxygen: list(markdown = TRUE)
30+
RoxygenNote: 6.1.1

NEWS.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
1-
# rotor (development version)
1+
# rotor 0.2.2
22

3-
* Reordered some of the arguments of all `rotate_*()` and `backup_*()`
4-
functions to be more intuitive
3+
* Reordered the arguments of `rotate_*()` and `backup_*()` for more consistency
54
* default `size` for all all `rotate_*()` and `backup_*()` functions is now
6-
consistently `1` (Byte)
7-
* support for `Inf` `size`
5+
`1` (Byte). This means empty files are never rotated by default.
6+
* support for `Inf` `size` and `age`
87
* More robust regex for discovering backups of files
98
* R6 API: BackupQueue subclasses gain a `should_rotate(...)` method that
109
determines whether rotation/backup should take place.
11-
* R6 API: BackupQueueDate and -DateTime now have a caching mechanism for
12-
backups (defaults to `FALSE`).
10+
* R6 API: BackupQueueDate and BackupQueueDateTime now have a caching mechanism
11+
for backups (defaults to `FALSE`).
1312
* R6 API: BackupQueue* now use setters/getters for all fields.
1413

1514

R/BackupQueue.R

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66
#' integrate rotor in one of your package, the `BackupQueue` subclasses give
77
#' you a bit of extra control.
88
#'
9-
#' As of now, **the R6 API is still under development and subject to change**.
10-
#' More documentation will follow in the foreseable future.
9+
#' As of now, **the R6 API is still experimental and subject to change**.
1110
#'
1211
#'
1312
#' @section Methods:
@@ -18,16 +17,16 @@
1817
#' be called manually.
1918
#' }
2019
#'
21-
#' \item{`prune()`}{Delet all backups except `max_backups`. See [prune_backups()]}
20+
#' \item{`prune()`}{Delete all backups except `max_backups`. See [prune_backups()]}
2221
#'
2322
#' \item{`push_backup() <BackupQueueIndex>`}{
2423
#' Create a new backup with index 1, push back all other indices.
2524
#' Always calls `$prune()` before it terminates.
2625
#' }
2726
#'
2827
#' \item{`push_backup(overwrite = FALSE, now = Sys.time()) <BackupQueueDate> <BackupQueueDateteime>`}{
29-
#' Create a new backup with a timestamp. The `now` paramter override the
30-
#' real system time. If `overwrite` is `TRUE` exisiting backups with the
28+
#' Create a new backup with a timestamp. The `now` parameter override the
29+
#' real system time. If `overwrite` is `TRUE` existing backups with the
3130
#' same filename (i.e timestamp) are overwritten. Always calls
3231
#' `$prune()` before it terminates.
3332
#' }
@@ -64,11 +63,11 @@
6463
#' \item{`should_rotate(size, age, now = Sys.time(), last_rotation = self$last_rotation) <BackupQueueDate> <BackupQueueDateteime>`}{
6564
#' Should a file of `size` and `age` be rotated? See `size` and `age`
6665
#' arguments of [`rotate_date()`]. `now` overrides the current system time,
67-
#' `last_rotation`` overrieds the date of the last rotation.
66+
#' `last_rotation`` overrides the date of the last rotation.
6867
#' }
6968
#'
7069
#' \item{`update_backups_cache()`}{
71-
#' Force update of the backups_bache. Only does something if `$cache_backups`
70+
#' Force update of the backups cache. Only does something if `$cache_backups`
7271
#' is `TRUE`.
7372
#' }
7473
#' }

README.Rmd

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,9 @@ knitr::opts_chunk$set(
2323

2424
**rotor** provides a cross platform R reimagination of
2525
[logrotate](https://linux.die.net/man/8/logrotate). It is a companion package to
26-
the logging package [lgr](https://github.com/s-fleck/lgr). In addition to
27-
rotating log files, it can also be used as a (primitive) backup tool. For
28-
conditionally creating and deleting backups, rotor relies solely on information
29-
encoded in a suffix of the backup file names (i.e. a timestamp or index). It
26+
the logging package [lgr](https://github.com/s-fleck/lgr). In
27+
contrast to logrotate, rotor relies solely on information encoded in a suffixes
28+
of file names for conditionally creating backups (i.e. a timestamp or index). It
3029
therefore also works with backups created by other tools, as long as the
3130
filename has a format that rotor can understand.
3231

README.md

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,11 @@ status](https://www.r-pkg.org/badges/version/rotor)](https://cran.r-project.org/
1818
**rotor** provides a cross platform R reimagination of
1919
[logrotate](https://linux.die.net/man/8/logrotate). It is a companion
2020
package to the logging package [lgr](https://github.com/s-fleck/lgr). In
21-
addition to rotating log files, it can also be used as a (primitive)
22-
backup tool. For conditionally creating and deleting backups, rotor
23-
relies solely on information encoded in a suffix of the backup file
24-
names (i.e. a timestamp or index). It therefore also works with backups
25-
created by other tools, as long as the filename has a format that rotor
26-
can understand.
21+
contrast to logrotate, rotor relies solely on information encoded in a
22+
suffixes of file names for conditionally creating backups (i.e. a
23+
timestamp or index). It therefore also works with backups created by
24+
other tools, as long as the filename has a format that rotor can
25+
understand.
2726

2827
`rotate()`, `rotate_date()`, and `rotate_time()` move a file and insert
2928
a suffix (either an integer or a timestamp) into the filename. In
@@ -80,8 +79,8 @@ backup(tf, compression = TRUE)
8079

8180
# display backups of a file
8281
list_backups(tf)
83-
#> [1] "/tmp/RtmplvAoSn/rotor/mylogfile.1.log.zip"
84-
#> [2] "/tmp/RtmplvAoSn/rotor/mylogfile.2.log"
82+
#> [1] "/tmp/RtmplU947x/rotor/mylogfile.1.log.zip"
83+
#> [2] "/tmp/RtmplU947x/rotor/mylogfile.2.log"
8584
```
8685

8786
`rotate()` also backs up a file, but replaces the original file with an
@@ -90,9 +89,9 @@ empty one.
9089
``` r
9190
rotate(tf)
9291
list_backups(tf)
93-
#> [1] "/tmp/RtmplvAoSn/rotor/mylogfile.1.log"
94-
#> [2] "/tmp/RtmplvAoSn/rotor/mylogfile.2.log.zip"
95-
#> [3] "/tmp/RtmplvAoSn/rotor/mylogfile.3.log"
92+
#> [1] "/tmp/RtmplU947x/rotor/mylogfile.1.log"
93+
#> [2] "/tmp/RtmplU947x/rotor/mylogfile.2.log.zip"
94+
#> [3] "/tmp/RtmplU947x/rotor/mylogfile.3.log"
9695

9796
# the original file is now empty
9897
readLines(tf)
@@ -115,10 +114,10 @@ backup(tf, max_backups = 4)
115114
backup(tf, max_backups = 4)
116115

117116
list_backups(tf)
118-
#> [1] "/tmp/RtmplvAoSn/rotor/mylogfile.1.log"
119-
#> [2] "/tmp/RtmplvAoSn/rotor/mylogfile.2.log"
120-
#> [3] "/tmp/RtmplvAoSn/rotor/mylogfile.3.log"
121-
#> [4] "/tmp/RtmplvAoSn/rotor/mylogfile.4.log.zip"
117+
#> [1] "/tmp/RtmplU947x/rotor/mylogfile.1.log"
118+
#> [2] "/tmp/RtmplU947x/rotor/mylogfile.2.log"
119+
#> [3] "/tmp/RtmplU947x/rotor/mylogfile.3.log"
120+
#> [4] "/tmp/RtmplU947x/rotor/mylogfile.4.log.zip"
122121
```
123122

124123
We can also use `prune_backups()` to delete old backups. Other than
@@ -137,8 +136,8 @@ timestamped backups.
137136
backup_date(tf)
138137
rotate_time(tf)
139138
list_backups(tf)
140-
#> [1] "/tmp/RtmplvAoSn/rotor/mylogfile.2019-05-16--14-47-44.log"
141-
#> [2] "/tmp/RtmplvAoSn/rotor/mylogfile.2019-05-16.log"
139+
#> [1] "/tmp/RtmplU947x/rotor/mylogfile.2019-05-28--07-51-44.log"
140+
#> [2] "/tmp/RtmplU947x/rotor/mylogfile.2019-05-28.log"
142141
```
143142

144143
``` r

cran-comments.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@
99

1010
0 errors | 0 warnings | 1 note
1111

12-
* Resubmission
13-
* Added examples to the documentation of rotate() and co.
14-
* This is a new release.
12+
* fleshed out R6 API
13+
* fixed edge-case bug on macOS related to timezones
14+
* new features and bugfixes

docs/404.html

Lines changed: 5 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/LICENSE-text.html

Lines changed: 5 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/LICENSE.html

Lines changed: 5 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/authors.html

Lines changed: 5 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)