Skip to content

Commit

Permalink
prep for release
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan Fleck authored and s-fleck committed Jun 17, 2019
1 parent 18bd82e commit ce5dc7b
Show file tree
Hide file tree
Showing 20 changed files with 119 additions and 102 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@
^CRAN-RELEASE$
^codecov\.yml$
^vignettes/benchmarks\.Rmd$
^revdep$
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Type: Package
Package: rotor
Title: Log Rotation and Conditional Backups
Version: 0.2.2.9000
Version: 0.2.3
Authors@R:
person(given = "Stefan",
family = "Fleck",
Expand Down
2 changes: 1 addition & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# rotor 0.2.2.9000
# rotor 0.2.3

* Changed default behaviour of `rotate_date()`, `rotate_time()`, etc...: If
no backups exist of target file, use the "created" timestamp
Expand Down
5 changes: 3 additions & 2 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ backup_info(tf)
```
If we examine the "timestamp" column in the example above, we see that missing
date information is always interpreted as the start of the period; i.e. so
`"2019-01"` is equivalent to `"2019-01-01--00--00--00"` for all intentds and
`"2019-01"` is equivalent to `"2019-01-01--00--00--00"` for all intents and
purposes.

```{r}
Expand Down Expand Up @@ -173,7 +173,8 @@ non-base dependencies:
encapsulated object-oriented programming.
* [dint](https://github.com/s-fleck/dint): A toolkit for working year-quarter
and year-month dates that I am also the author of. It is used by
`rotate_date()` and `rotate_time()` to deal with calendar periods.
`rotate_date()` and `rotate_time()` to deal with calendar periods (such as
weeks or months).

Both packages have no transitive dependencies (i.e they do not depend on
anything outside of base R)
62 changes: 31 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ backup(tf, compression = TRUE)

# display backups of a file
list_backups(tf)
#> [1] "/tmp/RtmpT5fN3W/rotor/mylogfile.1.log.zip"
#> [2] "/tmp/RtmpT5fN3W/rotor/mylogfile.2.log"
#> [1] "/tmp/RtmpOyN1LN/rotor/mylogfile.1.log.zip"
#> [2] "/tmp/RtmpOyN1LN/rotor/mylogfile.2.log"
```

`rotate()` also backs up a file, but replaces the original file with an
Expand All @@ -93,9 +93,9 @@ empty one.
``` r
rotate(tf)
list_backups(tf)
#> [1] "/tmp/RtmpT5fN3W/rotor/mylogfile.1.log"
#> [2] "/tmp/RtmpT5fN3W/rotor/mylogfile.2.log.zip"
#> [3] "/tmp/RtmpT5fN3W/rotor/mylogfile.3.log"
#> [1] "/tmp/RtmpOyN1LN/rotor/mylogfile.1.log"
#> [2] "/tmp/RtmpOyN1LN/rotor/mylogfile.2.log.zip"
#> [3] "/tmp/RtmpOyN1LN/rotor/mylogfile.3.log"

# the original file is now empty
readLines(tf)
Expand All @@ -118,10 +118,10 @@ backup(tf, max_backups = 4)
backup(tf, max_backups = 4)

list_backups(tf)
#> [1] "/tmp/RtmpT5fN3W/rotor/mylogfile.1.log"
#> [2] "/tmp/RtmpT5fN3W/rotor/mylogfile.2.log"
#> [3] "/tmp/RtmpT5fN3W/rotor/mylogfile.3.log"
#> [4] "/tmp/RtmpT5fN3W/rotor/mylogfile.4.log.zip"
#> [1] "/tmp/RtmpOyN1LN/rotor/mylogfile.1.log"
#> [2] "/tmp/RtmpOyN1LN/rotor/mylogfile.2.log"
#> [3] "/tmp/RtmpOyN1LN/rotor/mylogfile.3.log"
#> [4] "/tmp/RtmpOyN1LN/rotor/mylogfile.4.log.zip"
```

We can also use `prune_backups()` to delete old backups. Other than
Expand Down Expand Up @@ -155,35 +155,35 @@ backup_time(tf, format = "%Y%m%dT%H%M%S") # ISO 8601 compatible

backup_info(tf)
#> path name
#> 1 /tmp/RtmpT5fN3W/rotor/mylogfile.2019-05-31_06-48-27.log mylogfile
#> 2 /tmp/RtmpT5fN3W/rotor/mylogfile.2019-05-31--06-48-27.log mylogfile
#> 5 /tmp/RtmpT5fN3W/rotor/mylogfile.20190531T064827.log mylogfile
#> 3 /tmp/RtmpT5fN3W/rotor/mylogfile.2019-05-31.log mylogfile
#> 4 /tmp/RtmpT5fN3W/rotor/mylogfile.2019-05.log mylogfile
#> 1 /tmp/RtmpOyN1LN/rotor/mylogfile.2019-06-17_09-55-44.log mylogfile
#> 2 /tmp/RtmpOyN1LN/rotor/mylogfile.2019-06-17--09-55-44.log mylogfile
#> 5 /tmp/RtmpOyN1LN/rotor/mylogfile.20190617T095544.log mylogfile
#> 3 /tmp/RtmpOyN1LN/rotor/mylogfile.2019-06-17.log mylogfile
#> 4 /tmp/RtmpOyN1LN/rotor/mylogfile.2019-06.log mylogfile
#> sfx ext size isdir mode mtime
#> 1 2019-05-31_06-48-27 log 26 FALSE 664 2019-05-31 06:48:27
#> 2 2019-05-31--06-48-27 log 26 FALSE 664 2019-05-31 06:48:27
#> 5 20190531T064827 log 26 FALSE 664 2019-05-31 06:48:27
#> 3 2019-05-31 log 26 FALSE 664 2019-05-31 06:48:26
#> 4 2019-05 log 26 FALSE 664 2019-05-31 06:48:26
#> 1 2019-06-17_09-55-44 log 26 FALSE 664 2019-06-17 09:55:44
#> 2 2019-06-17--09-55-44 log 26 FALSE 664 2019-06-17 09:55:44
#> 5 20190617T095544 log 26 FALSE 664 2019-06-17 09:55:44
#> 3 2019-06-17 log 26 FALSE 664 2019-06-17 09:55:44
#> 4 2019-06 log 26 FALSE 664 2019-06-17 09:55:44
#> ctime atime uid gid uname grname
#> 1 2019-05-31 06:48:27 2019-05-31 06:48:27 1000 1000 hoelk hoelk
#> 2 2019-05-31 06:48:27 2019-05-31 06:48:27 1000 1000 hoelk hoelk
#> 5 2019-05-31 06:48:27 2019-05-31 06:48:27 1000 1000 hoelk hoelk
#> 3 2019-05-31 06:48:26 2019-05-31 06:48:26 1000 1000 hoelk hoelk
#> 4 2019-05-31 06:48:26 2019-05-31 06:48:26 1000 1000 hoelk hoelk
#> 1 2019-06-17 09:55:44 2019-06-17 09:55:44 1000 1000 hoelk hoelk
#> 2 2019-06-17 09:55:44 2019-06-17 09:55:44 1000 1000 hoelk hoelk
#> 5 2019-06-17 09:55:44 2019-06-17 09:55:44 1000 1000 hoelk hoelk
#> 3 2019-06-17 09:55:44 2019-06-17 09:55:44 1000 1000 hoelk hoelk
#> 4 2019-06-17 09:55:44 2019-06-17 09:55:44 1000 1000 hoelk hoelk
#> timestamp
#> 1 2019-05-31 06:48:27
#> 2 2019-05-31 06:48:27
#> 5 2019-05-31 06:48:27
#> 3 2019-05-31 00:00:00
#> 4 2019-05-01 00:00:00
#> 1 2019-06-17 09:55:44
#> 2 2019-06-17 09:55:44
#> 5 2019-06-17 09:55:44
#> 3 2019-06-17 00:00:00
#> 4 2019-06-01 00:00:00
```

If we examine the “timestamp” column in the example above, we see that
missing date information is always interpreted as the start of the
period; i.e. so `"2019-01"` is equivalent to `"2019-01-01--00--00--00"`
for all intentds and purposes.
for all intents and purposes.

``` r
prune_backups(tf, max_backups = 0) # cleanup
Expand Down Expand Up @@ -212,7 +212,7 @@ two non-base dependencies:
- [dint](https://github.com/s-fleck/dint): A toolkit for working
year-quarter and year-month dates that I am also the author of. It
is used by `rotate_date()` and `rotate_time()` to deal with calendar
periods.
periods (such as weeks or months).

Both packages have no transitive dependencies (i.e they do not depend on
anything outside of base R)
7 changes: 3 additions & 4 deletions cran-comments.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@

## R CMD check results

0 errors | 0 warnings | 1 note
0 errors | 0 warnings | 0 notes

* fleshed out R6 API
* fixed edge-case bug on macOS related to timezones
* new features and bugfixes
maintenance release with saner default behaviour for rotate() and backup() if
no backups exist yet
2 changes: 1 addition & 1 deletion docs/404.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/LICENSE-text.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/LICENSE.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/authors.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit ce5dc7b

Please sign in to comment.