Skip to content

Commit edeae47

Browse files
author
ironholds
committed
fix #30
1 parent cb20794 commit edeae47

File tree

7 files changed

+10
-86
lines changed

7 files changed

+10
-86
lines changed

DESCRIPTION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
Package: urltools
22
Type: Package
33
Title: Vectorised Tools for URL Handling and Parsing
4-
Version: 1.3.0
5-
Date: 2015-09-20
4+
Version: 1.3.1
5+
Date: 2015-10-07
66
Author: Oliver Keyes [aut, cre], Jay Jacobs [aut, cre], Mark Greenaway [ctb],
77
Bob Rudis [ctb]
88
Maintainer: Oliver Keyes <[email protected]>

NAMESPACE

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ export(path)
1616
export(port)
1717
export(scheme)
1818
export(suffix_extract)
19-
export(suffix_refresh)
2019
export(url_compose)
2120
export(url_decode)
2221
export(url_encode)

NEWS

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
Version 1.3.1 [WIP]
1+
Version 1.3.1
2+
3+
CHANGES
4+
* suffix_refresh has been removed, since LazyData's parameters prevented it from functioning; thanks to
5+
Alex Pinto for the initial bug report and Hadley Wickham for confirming the possible solutions.
26

37
BUG FIXES
48
* the parser was not properly handling ports; thanks to a report from Rich FitzJohn, this is now fixed.

R/suffix.R

Lines changed: 2 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,3 @@
1-
#'@title refresh the stored public suffix dataset
2-
#'
3-
#'@description \code{urltools} comes with an inbuilt
4-
#'dataset of public suffixes, \code{\link{suffix_dataset}}.
5-
#'This is used in \code{\link{suffix_extract}} to identify the top-level domain
6-
#'within a particular domain name.
7-
#'
8-
#'While updates to the dataset will be included in each new package release,
9-
#'there's going to be a gap between changes to TLDs and changes to the package.
10-
#'Accordingly, the package also includes \code{\link{suffix_refresh}}, which refreshes
11-
#'this dataset on the user end. This requires CURL (the library, not the
12-
#'R package) on your system to function.
13-
#'
14-
#'@return TRUE if this worked; an error otherwise.
15-
#'
16-
#'@seealso \code{\link{suffix_extract}} to extract suffixes from domain names,
17-
#'or \code{\link{suffix_dataset}} for the dataset itself.
18-
#'
19-
#'@examples
20-
#'\dontrun{
21-
#'suffix_refresh()
22-
#'}
23-
#'
24-
#'@export
25-
suffix_refresh <- function(){
26-
27-
has_libcurl <- capabilities("libcurl")
28-
if(length(has_libcurl) == 0 || has_libcurl == FALSE){
29-
stop("libcurl support is needed for this function")
30-
}
31-
32-
#Read in and filter
33-
connection <- url("https://www.publicsuffix.org/list/effective_tld_names.dat", method = "libcurl")
34-
results <- readLines(connection)
35-
close(connection)
36-
suffix_dataset <- results[!grepl(x = results, pattern = "//", fixed = TRUE) & !results == ""]
37-
38-
#Return the user-friendly version
39-
save(suffix_dataset, file = system.file("data/suffix_dataset.rda", package = "urltools"))
40-
return(TRUE)
41-
}
42-
431
#' @title Dataset of public suffixes
442
#' @description This dataset contains a registry of public suffixes, as retrieved from
453
#' and defined by the \href{https://publicsuffix.org/}{public suffix list}. It is
@@ -50,8 +8,7 @@ suffix_refresh <- function(){
508
#' @keywords datasets
519
#' @name suffix_dataset
5210
#'
53-
#' @seealso \code{\link{suffix_refresh}} for updating the dataset, and
54-
#' \code{\link{suffix_extract}} for extracting suffixes from domain names.
11+
#' @seealso \code{\link{suffix_extract}} for extracting suffixes from domain names.
5512
#'
5613
#' @usage data(suffix_dataset)
5714
#' @note Last updated 2015-05-06.
@@ -78,8 +35,7 @@ NULL
7835
#' "domain" contains the part of the domain name that came before the matched suffix.
7936
#' "suffix" is, well, the suffix.
8037
#'
81-
#' @seealso \code{\link{suffix_dataset}} for the dataset of suffixes,
82-
#' and \code{\link{suffix_refresh}} for refreshing it.
38+
#' @seealso \code{\link{suffix_dataset}} for the dataset of suffixes.
8339
#'
8440
#' @examples
8541
#'

man/suffix_dataset.Rd

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ sorted by how many periods(".") appear in the suffix, to optimise it for
1818
Last updated 2015-05-06.
1919
}
2020
\seealso{
21-
\code{\link{suffix_refresh}} for updating the dataset, and
2221
\code{\link{suffix_extract}} for extracting suffixes from domain names.
2322
}
2423
\keyword{datasets}

man/suffix_extract.Rd

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ suffix_extract(domain_name)
4141
suffix_extract("http://en.wikipedia.org")
4242
}
4343
\seealso{
44-
\code{\link{suffix_dataset}} for the dataset of suffixes,
45-
and \code{\link{suffix_refresh}} for refreshing it.
44+
\code{\link{suffix_dataset}} for the dataset of suffixes.
4645
}
4746

man/suffix_refresh.Rd

Lines changed: 0 additions & 33 deletions
This file was deleted.

0 commit comments

Comments
 (0)