Skip to content

Commit

Permalink
Fixed URLs in fishR()
Browse files Browse the repository at this point in the history
  • Loading branch information
droglenc committed Mar 9, 2020
1 parent 556ba04 commit c4547fd
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 13 deletions.
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# FSA 0.8.30 9-Mar-20
* Started using `rhub::check_for_cran()` for checking before sending to CRAN.
* Updated tests for `Summarize()` and `ksTest()` that used `data.frame()`. This should have been done with v0.8.28.
* Fixed errors for tests in `ksTest()` that were identified using R-hub.
* Removed all links to documentation in non-dependent or non-suggested packages. This removes a note from R-hub.
* `fishR()`: Modified. Changed base URL to `https:` (from `http:`). Added `open=`, primarily to allow not opening a browser during testing.

# FSA 0.8.29 8-Mar-20
* Removed dependency on `epitools` package as it may soon be orphaned. See changes to `binCI()` and `poiCI()` outlined below.
Expand Down
10 changes: 6 additions & 4 deletions R/FSAUtils.R
Original file line number Diff line number Diff line change
Expand Up @@ -315,9 +315,10 @@ fact2num <- function(object) {

#' @title Opens web pages associated with the fishR website.
#'
#' @description Opens web pages associated with the \href{http://derekogle.com/fishR/}{fishR website} in a browser. The user can open the main page or choose a specific page to open.
#' @description Opens web pages associated with the \href{https://derekogle.com/fishR/}{fishR website} in a browser. The user can open the main page or choose a specific page to open.
#'
#' @param where A string that indicates a particular page on the fishR website to open.
#' @param open A logical that indicates whether the webpage should be opened in the default browser. Defaults to \code{TRUE}; \code{FALSE} is used for unit testing.
#'
#' @return None, but a webpage will be opened in the default browser.
#'
Expand All @@ -338,9 +339,10 @@ fact2num <- function(object) {
#'
#' @export
fishR <- function(where=c("home","IFAR","general","books",
"AIFFD","posts","news")) {
"AIFFD","posts","news"),
open=TRUE) {
where <- match.arg(where)
tmp <- "http://derekogle.com/"
tmp <- "https://derekogle.com/"
switch(where,
home= { tmp <- paste0(tmp,"fishR") },
IFAR= { tmp <- paste0(tmp,"IFAR") },
Expand All @@ -349,7 +351,7 @@ fishR <- function(where=c("home","IFAR","general","books",
AIFFD= { tmp <- paste0(tmp,"aiffd2007") },
posts=,news= { tmp <- paste0(tmp,"fishR/blog") }
)
utils::browseURL(tmp)
if (open) utils::browseURL(tmp)
invisible(tmp)
}

Expand Down
9 changes: 7 additions & 2 deletions man/fishR.Rd

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

21 changes: 14 additions & 7 deletions tests/testthat/testthat_FSAUtils.R
Original file line number Diff line number Diff line change
Expand Up @@ -425,13 +425,20 @@ test_that("Subset() results",{
})

test_that("fishR() return values",{
expect_equal(fishR(),"http://derekogle.com/fishR")
expect_equal(fishR("IFAR"),"http://derekogle.com/IFAR")
expect_equal(fishR("general"),"http://derekogle.com/fishR/examples")
expect_equal(fishR("AIFFD"),"http://derekogle.com/aiffd2007")
expect_equal(fishR("posts"),"http://derekogle.com/fishR/blog")
expect_equal(fishR("books"),"http://derekogle.com/fishR/examples")
expect_equal(fishR("news"),"http://derekogle.com/fishR/blog")
expect_equal(fishR(open=FALSE),
"https://derekogle.com/fishR")
expect_equal(fishR("IFAR",open=FALSE),
"https://derekogle.com/IFAR")
expect_equal(fishR("general",open=FALSE),
"https://derekogle.com/fishR/examples")
expect_equal(fishR("AIFFD",open=FALSE),
"https://derekogle.com/aiffd2007")
expect_equal(fishR("posts",open=FALSE),
"https://derekogle.com/fishR/blog")
expect_equal(fishR("books",open=FALSE),
"https://derekogle.com/fishR/examples")
expect_equal(fishR("news",open=FALSE),
"https://derekogle.com/fishR/blog")
})

test_that("geomean() / geosd() results",{
Expand Down

0 comments on commit c4547fd

Please sign in to comment.