forked from jbedia/fireDanger
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
24 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 <http://meteo.unican.es> [aut]", | ||
"Joaquin Bedia <[email protected]> [ctb, cre]", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 <devtools::install_github(c('SantanderMetGroup/transformeR','SantanderMetGroup/", pkgname, "'))>") | ||
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 <devtools::install_github('SantanderMetGroup/", pkgname, "')>") | ||
packageStartupMessage(ver.mess1) | ||
packageStartupMessage(ver.mess) | ||
} | ||
} | ||
packageStartupMessage("Type 'vignette(\"Climate_Services_2017\", package = \"fireDanger\")' for package overview and examples") | ||
} | ||
# End | ||
|