Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: use inherits() #249

Merged
merged 6 commits into from
Dec 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: boxr
Type: Package
Title: Interface for the 'Box.com API'
Version: 0.3.6.9002
Version: 0.3.6.9003
Authors@R: c(
person("Brendan", "Rocks", email = "[email protected]",
role = c("aut")),
Expand Down Expand Up @@ -67,7 +67,7 @@ Suggests:
usethis,
covr
VignetteBuilder: knitr
RoxygenNote: 7.1.2
RoxygenNote: 7.2.3
Encoding: UTF-8
Roxygen: list(markdown = TRUE)
RdMacros: lifecycle
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# boxr 0.3.6 (development)

## Internal

* update to use `inherits()` (vs. string-comparison) to determine class-membership. (#246)

* harmonizes the default location for tokens.
Now, `~` resolves to the home directory for all platforms.
A patch is applied offering to move tokens from "old" locations.
Expand Down
2 changes: 1 addition & 1 deletion R/boxr__internal_dir_comparison.R
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@
to_update <- behind <- data.frame()
}

if (class(absent) != "data.frame")
if (!inherits(absent, "data.frame"))

Check warning on line 214 in R/boxr__internal_dir_comparison.R

View check run for this annotation

Codecov / codecov/patch

R/boxr__internal_dir_comparison.R#L214

Added line #L214 was not covered by tests
absent <- data.frame()

# The final list to output
Expand Down
4 changes: 2 additions & 2 deletions R/boxr__internal_get.R
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
handle_file_id <- function(obj) {
if (class(obj) == "boxr_file_reference") {
if (inherits(obj, "boxr_file_reference")) {

Check warning on line 2 in R/boxr__internal_get.R

View check run for this annotation

Codecov / codecov/patch

R/boxr__internal_get.R#L2

Added line #L2 was not covered by tests
# If the user's submitted a file reference object, extract the id for them
file_id <- obj$id
} else if (class(obj) == "boxr_object_list") {
} else if (inherits(obj, "boxr_object_list")) {

Check warning on line 5 in R/boxr__internal_get.R

View check run for this annotation

Codecov / codecov/patch

R/boxr__internal_get.R#L5

Added line #L5 was not covered by tests
# If the user's submitted a list of objects, extract the id from the first,
# and emit a message so they know what's up
if(length(obj) > 1)
Expand Down
4 changes: 3 additions & 1 deletion man/box_auth.Rd

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