Skip to content

Commit

Permalink
Use package 'rutils' in place of 'gutils'
Browse files Browse the repository at this point in the history
  • Loading branch information
danielvartan committed Sep 26, 2023
1 parent 5b4e6e8 commit 71d0d50
Show file tree
Hide file tree
Showing 20 changed files with 64 additions and 96 deletions.
32 changes: 0 additions & 32 deletions .github/workflows/lint.yaml

This file was deleted.

55 changes: 29 additions & 26 deletions CITATION.cff
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -----------------------------------------------------------
# CITATION file created with {cffr} R package, v0.4.1
# CITATION file created with {cffr} R package, v0.5.0
# See also: https://docs.ropensci.org/cffr/
# -----------------------------------------------------------

Expand Down Expand Up @@ -46,7 +46,7 @@ references:
year: '2023'
institution:
name: R Foundation for Statistical Computing
version: '>= 4.1'
version: '>= 4.2'
- type: software
title: checkmate
abstract: 'checkmate: Fast and Versatile Argument Checks'
Expand Down Expand Up @@ -97,17 +97,6 @@ references:
orcid: https://orcid.org/0000-0003-4777-038X
year: '2023'
version: '>= 1.1.0'
- type: software
title: gutils
abstract: 'gutils: Utility Functions Created by the GIPERBIO Developer Team'
notes: Imports
url: https://giperbio.github.io/gutils/
authors:
- family-names: Vartanian
given-names: Daniel
email: [email protected]
orcid: https://orcid.org/0000-0001-7782-759X
year: '2023'
- type: software
title: lifecycle
abstract: 'lifecycle: Manage the Life Cycle of your Package Functions'
Expand All @@ -129,7 +118,7 @@ references:
abstract: 'openssl: Toolkit for Encryption, Signatures and Certificates Based on
OpenSSL'
notes: Imports
url: https://github.com/jeroen/openssl
url: https://jeroen.r-universe.dev/openssl
repository: https://CRAN.R-project.org/package=openssl
authors:
- family-names: Ooms
Expand All @@ -138,11 +127,22 @@ references:
orcid: https://orcid.org/0000-0002-4035-0289
year: '2023'
version: '>= 2.0.6'
- type: software
title: rutils
abstract: 'rutils: Utility Functions for R'
notes: Imports
url: https://danielvartan.github.io/rutils/
authors:
- family-names: Vartanian
given-names: Daniel
email: [email protected]
orcid: https://orcid.org/0000-0001-7782-759X
year: '2023'
- type: software
title: askpass
abstract: 'askpass: Safe Password Entry for R, Git, and SSH'
abstract: 'askpass: Password Entry Utilities for R, Git, and SSH'
notes: Suggests
url: https://github.com/jeroen/askpass#readme
url: https://github.com/r-lib/askpass
repository: https://CRAN.R-project.org/package=askpass
authors:
- family-names: Ooms
Expand Down Expand Up @@ -197,35 +197,38 @@ references:
authors:
- family-names: Allaire
given-names: JJ
email: jj@rstudio.com
email: jj@posit.co
- family-names: Xie
given-names: Yihui
email: [email protected]
orcid: https://orcid.org/0000-0003-0645-5666
- family-names: Dervieux
given-names: Christophe
email: [email protected]
orcid: https://orcid.org/0000-0003-4474-2498
- family-names: McPherson
given-names: Jonathan
email: jonathan@rstudio.com
email: jonathan@posit.co
- family-names: Luraschi
given-names: Javier
email: [email protected]
- family-names: Ushey
given-names: Kevin
email: kevin@rstudio.com
email: kevin@posit.co
- family-names: Atkins
given-names: Aron
email: aron@rstudio.com
email: aron@posit.co
- family-names: Wickham
given-names: Hadley
email: hadley@rstudio.com
email: hadley@posit.co
- family-names: Cheng
given-names: Joe
email: joe@rstudio.com
email: joe@posit.co
- family-names: Chang
given-names: Winston
email: winston@rstudio.com
email: winston@posit.co
- family-names: Iannone
given-names: Richard
email: rich@rstudio.com
email: rich@posit.co
orcid: https://orcid.org/0000-0003-3925-190X
year: '2023'
version: '>= 2.20'
Expand Down Expand Up @@ -254,7 +257,7 @@ references:
authors:
- family-names: Wickham
given-names: Hadley
email: hadley@rstudio.com
email: hadley@posit.co
year: '2023'
version: '>= 3.1.7'
identifiers:
Expand Down
6 changes: 3 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ License: MIT + file LICENSE
URL: https://giperbio.github.io/lockr/, https://github.com/giperbio/lockr/
BugReports: https://github.com/giperbio/lockr/issues/
Depends:
R (>= 4.1)
R (>= 4.2)
Imports:
checkmate (>= 2.1.0),
cli (>= 3.6.0),
dplyr (>= 1.1.0),
gutils,
lifecycle (>= 1.0.3),
openssl (>= 2.0.6),
rutils
Suggests:
askpass (>= 1.1),
covr (>= 3.6.1),
Expand All @@ -33,7 +33,7 @@ Suggests:
spelling (>= 2.2),
testthat (>= 3.1.7)
Remotes:
github::giperbio/gutils
github::danielvartan/rutils
VignetteBuilder:
knitr
Config/testthat/edition: 3
Expand Down
2 changes: 0 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

# lockr (development version)



# lockr 0.3.0 (2023-03-20)

* `encryptrpak` was renamed to `lockr`.
Expand Down
4 changes: 2 additions & 2 deletions R/lock_dir.R
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ lock_dir <- function(dir = "./inst/extdata",
silent = TRUE
)

if (grepl(paste0(gutils:::escape_regex(suffix), "$"), file)) {
if (grepl(paste0(rutils:::escape_regex(suffix), "$"), file)) {
"Next"
} else if (!inherits(out, "try-error")) {
out
Expand Down Expand Up @@ -105,7 +105,7 @@ unlock_dir <- function(dir = "./inst/extdata",
silent = TRUE
)

if (!grepl(paste0(gutils:::escape_regex(suffix), "$"), file)) {
if (!grepl(paste0(rutils:::escape_regex(suffix), "$"), file)) {
"Next"
} else if (!inherits(out, "try-error")) {
out
Expand Down
4 changes: 2 additions & 2 deletions R/lock_file.R
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ lock_file <- function(file, public_key = "./inst/ssh/id_rsa.pub",

locked_file_name <- paste0(file, suffix)

if (grepl(paste0(gutils:::escape_regex(suffix), "$"), file)) {
if (grepl(paste0(rutils:::escape_regex(suffix), "$"), file)) {
cli::cli_abort(paste0(
"The file ",
"'{.strong {cli::col_red(basename(file))}}' ",
Expand Down Expand Up @@ -107,7 +107,7 @@ unlock_file <- function(file, private_key = "./inst/ssh/id_rsa",
suffix = ".lockr", remove_file = TRUE,
password = NULL) {
checkmate::assert_string(suffix, pattern = "^\\.")
pattern <- paste0(gutils:::escape_regex(suffix), "$")
pattern <- paste0(rutils:::escape_regex(suffix), "$")

checkmate::assert_string(file)
checkmate::assert_string(file, pattern = pattern)
Expand Down
2 changes: 1 addition & 1 deletion _pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@ authors:
href: https://github.com/danielvartan

development:
mode: release
mode: unreleased
version_label: warning
22 changes: 11 additions & 11 deletions codemeta.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"name": "R",
"url": "https://r-project.org"
},
"runtimePlatform": "R version 4.2.2 (2022-10-31 ucrt)",
"runtimePlatform": "R version 4.3.1 (2023-06-16 ucrt)",
"author": [
{
"@type": "Person",
Expand Down Expand Up @@ -140,7 +140,7 @@
"@type": "SoftwareApplication",
"identifier": "R",
"name": "R",
"version": ">= 4.1"
"version": ">= 4.2"
},
"2": {
"@type": "SoftwareApplication",
Expand Down Expand Up @@ -182,12 +182,6 @@
"sameAs": "https://CRAN.R-project.org/package=dplyr"
},
"5": {
"@type": "SoftwareApplication",
"identifier": "gutils",
"name": "gutils",
"sameAs": "https://github.com/giperbio/gutils"
},
"6": {
"@type": "SoftwareApplication",
"identifier": "lifecycle",
"name": "lifecycle",
Expand All @@ -200,7 +194,7 @@
},
"sameAs": "https://CRAN.R-project.org/package=lifecycle"
},
"7": {
"6": {
"@type": "SoftwareApplication",
"identifier": "openssl",
"name": "openssl",
Expand All @@ -213,9 +207,15 @@
},
"sameAs": "https://CRAN.R-project.org/package=openssl"
},
"7": {
"@type": "SoftwareApplication",
"identifier": "rutils",
"name": "rutils",
"sameAs": "https://github.com/danielvartan/rutils"
},
"SystemRequirements": null
},
"fileSize": "48.838KB",
"fileSize": "50.113KB",
"citation": [
{
"@type": "CreativeWork",
Expand All @@ -235,7 +235,7 @@
}
],
"releaseNotes": "https://github.com/giperbio/lockr/blob/master/NEWS.md",
"readme": "https://github.com/giperbio/lockr/blob/main/README.md",
"readme": "https://github.com/danielvartan/lockr/blob/main/README.md",
"contIntegration": ["https://github.com/giperbio/lockr/actions", "https://app.codecov.io/gh/giperbio/lockr?branch=main"],
"developmentStatus": ["https://www.repostatus.org/#active", "https://lifecycle.r-lib.org/articles/stages.html#maturing"],
"keywords": ["r-package", "encryption", "r", "rstats"]
Expand Down
1 change: 0 additions & 1 deletion inst/extdata/test-1.txt

This file was deleted.

Binary file added inst/extdata/test-1.txt.lockr
Binary file not shown.
1 change: 0 additions & 1 deletion inst/extdata/test/test-2.txt

This file was deleted.

Binary file added inst/extdata/test/test-2.txt.lockr
Binary file not shown.
1 change: 0 additions & 1 deletion inst/extdata/test/test-3.txt

This file was deleted.

Binary file added inst/extdata/test/test-3.txt.lockr
Binary file not shown.
2 changes: 1 addition & 1 deletion lockr.Rproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ AlwaysSaveHistory: Default

EnableCodeIndexing: Yes
UseSpacesForTab: Yes
NumSpacesForTab: 4
NumSpacesForTab: 2
Encoding: UTF-8

RnwWeave: Sweave
Expand Down
2 changes: 2 additions & 0 deletions tests/testthat.R
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,5 @@ test_check("lockr")
# lockr::rsa_keygen()
# lockr::lock_dir(dir = "./inst/extdata")
# lockr::unlock_dir(dir = "./inst/extdata")
# lockr::lock_file(file.choose())
# lockr::unlock_file(file.choose())
10 changes: 5 additions & 5 deletions tests/testthat/test-lock_dir.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
test_that("lock_dir() | general test", {
ssh_dir <- tempfile("ssh")
dir.create(ssh_dir)
rsa_keygen(ssh_dir) %>% gutils:::shush()
rsa_keygen(ssh_dir) %>% rutils:::shush()

temp_dir <- tempfile("dir")
dir.create(temp_dir)
Expand All @@ -11,7 +11,7 @@ test_that("lock_dir() | general test", {
list.files(temp_dir)

lock_dir(temp_dir, public_key = file.path(ssh_dir, "id_rsa.pub")) %>%
gutils:::shush() %>%
rutils:::shush() %>%
expect_null()
})

Expand Down Expand Up @@ -50,7 +50,7 @@ test_that("lock_dir() | assertion test", {
test_that("unlock_dir() | general test", {
ssh_dir <- tempfile("ssh")
dir.create(ssh_dir)
rsa_keygen(ssh_dir) %>% gutils:::shush()
rsa_keygen(ssh_dir) %>% rutils:::shush()

temp_dir <- tempfile("dir")
dir.create(temp_dir)
Expand All @@ -60,10 +60,10 @@ test_that("unlock_dir() | general test", {
list.files(temp_dir)

lock_dir(temp_dir, public_key = file.path(ssh_dir, "id_rsa.pub")) %>%
gutils:::shush()
rutils:::shush()

unlock_dir(temp_dir, private_key = file.path(ssh_dir, "id_rsa")) %>%
gutils:::shush() %>%
rutils:::shush() %>%
expect_null()
})

Expand Down
Loading

0 comments on commit 71d0d50

Please sign in to comment.