Skip to content

Commit

Permalink
add hostname to platform_info()
Browse files Browse the repository at this point in the history
  • Loading branch information
certara-jcraig committed Jun 18, 2024
1 parent 064bc38 commit d9d37a7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions R/platform-info.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
#' * `system`: CPU, and machine readable OS name, separated by a comma.
#' * `ui`: the user interface, e.g. `Rgui`, `RTerm`, etc. see `GUI`
#' in [base::.Platform].
#' * `hostname`: the name of the machine know on the network, see
#' `nodename` in [base::Sys.info()].
#' * `language`: The current language setting. The `LANGUAGE` environment
#' variable, if set, or `(EN)` if unset.
#' * `collate`: Collation rule, from the current locale.
Expand All @@ -30,6 +32,7 @@ platform_info <- function() {
version = R.version.string,
os = os_name(),
system = version$system,
hostname = Sys.info()[["nodename"]],
ui = .Platform$GUI,
language = Sys.getenv("LANGUAGE", "(EN)"),
collate = Sys.getlocale("LC_COLLATE"),
Expand Down
3 changes: 3 additions & 0 deletions man/platform_info.Rd

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

2 changes: 1 addition & 1 deletion tests/testthat/test-platform-info.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ test_that("platform_info", {
pi <- platform_info()
expect_equal(
names(pi),
c("version", "os", "system", "ui", "language", "collate", "ctype",
c("version", "os", "system", "hostname", "ui", "language", "collate", "ctype",
"tz", "date", "pandoc", "quarto")
)

Expand Down

0 comments on commit d9d37a7

Please # to comment.