diff --git a/DESCRIPTION b/DESCRIPTION index 4b44777..545d453 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -3,8 +3,7 @@ Depends: R(>= 3.1.0) Imports: abind, - transformeR, - RCurl, + transformeR(>= 0.0.7), parallel Suggests: visualizeR, @@ -18,8 +17,8 @@ Suggests: VignetteBuilder: knitr Type: Package Title: Fire weather index calculation from station and model data -Version: 1.0.1 -Date: 2017-04-04 +Version: 1.0.2 +Date: 2017-04-07 Authors@R: as.person(c( "Santander Meteorology Group [aut]", "Joaquin Bedia [ctb, cre]", diff --git a/NAMESPACE b/NAMESPACE index 48447f7..9d1e56d 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -2,7 +2,6 @@ export(fwi1D) export(fwiGrid) -importFrom(RCurl,getURL) importFrom(abind,abind) importFrom(abind,asub) importFrom(parallel,parLapply) diff --git a/R/onAttach.R b/R/onAttach.R index d09b665..82bfc72 100644 --- a/R/onAttach.R +++ b/R/onAttach.R @@ -1,30 +1,27 @@ #' @importFrom utils packageDescription -#' @importFrom RCurl getURL .onAttach <- function(...) { - pkgname <- "fireDanger" - lib <- system.file(package = pkgname) - ver <- packageDescription(pkgname)$Version - builddate <- packageDescription(pkgname)$Date - mess <- paste(pkgname, " version ", ver, " (", builddate,") is loaded", sep = "") - packageStartupMessage(mess) - url <- paste0("https://raw.githubusercontent.com/SantanderMetGroup/", pkgname, "/master/DESCRIPTION") - con <- tryCatch(getURL(url, ssl.verifypeer = FALSE), error = function(er) { - er <- NULL - return(er) - }) - if (!is.null(con)) { - b <- readLines(textConnection(con)) - latest.ver <- package_version(gsub("Version: ", "", b[grep("Version", b)])) - if (ver < latest.ver) { - ver.mess1 <- paste0("WARNING: Your current version of ", pkgname, " (v", ver, ") is not up-to-date") - ver.mess <- paste0("Get the latest stable version (", latest.ver, - ") using ") - packageStartupMessage(ver.mess1) - packageStartupMessage(ver.mess) - } - } - packageStartupMessage("Type 'vignette(\"Climate_Services_2017\", package = \"fireDanger\")' for a package overview and worked examples") + pkgname <- "fireDanger" + ver <- packageDescription(pkgname)$Version + builddate <- packageDescription(pkgname)$Date + mess <- paste(pkgname, " version ", ver, " (", builddate,") is loaded", sep = "") + packageStartupMessage(mess) + url <- paste0("https://raw.githubusercontent.com/SantanderMetGroup/", pkgname, "/master/DESCRIPTION") + b <- tryCatch(suppressWarnings(readLines(url)), error = function(er) { + er <- NULL + return(er) + }) + if (!is.null(b)) { + latest.ver <- package_version(gsub("Version: ", "", b[grep("^Version", b)])) + if (ver < latest.ver) { + ver.mess1 <- paste0("WARNING: Your current version of ", pkgname, " (v", ver, ") is not up-to-date") + ver.mess <- paste0("Get the latest stable version (", latest.ver, + ") using ") + packageStartupMessage(ver.mess1) + packageStartupMessage(ver.mess) + } + } + packageStartupMessage("Type 'vignette(\"Climate_Services_2017\", package = \"fireDanger\")' for package overview and examples") } # End