Skip to content

Commit a3f9ddb

Browse files
author
ironholds
committed
1.2.0 release
1 parent 78df7cd commit a3f9ddb

File tree

16 files changed

+127
-49
lines changed

16 files changed

+127
-49
lines changed

DESCRIPTION

Lines changed: 3 additions & 4 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.1.1
5-
Date: 2015-04-11
4+
Version: 1.2.0
5+
Date: 2015-06-18
66
Author: Oliver Keyes [aut, cre], Jay Jacobs [aut, cre], Mark Greenaway [ctb]
77
Maintainer: Oliver Keyes <[email protected]>
88
Description: A toolkit for handling URLs that so far includes functions for URL
@@ -13,8 +13,7 @@ Description: A toolkit for handling URLs that so far includes functions for URL
1313
URLs.
1414
License: MIT + file LICENSE
1515
LinkingTo:
16-
Rcpp,
17-
rope
16+
Rcpp
1817
Imports:
1918
Rcpp,
2019
methods

NAMESPACE

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22

33
export("domain<-")
44
export("fragment<-")
5+
export("parameters<-")
56
export("path<-")
67
export("port<-")
7-
export("query<-")
88
export("scheme<-")
99
export(domain)
1010
export(fragment)
11+
export(parameters)
1112
export(path)
1213
export(port)
13-
export(query)
1414
export(scheme)
1515
export(suffix_extract)
1616
export(url_compose)

NEWS

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
Version 1.2.0 [WIP]
1+
Version 1.2.0
22
-------------------------------------------------------------------------
33

44
NEW FEATURES
55
* Jay Jacobs' "tldextract" functionality has been merged with urltools, and can be accessed
66
with "suffix_extract"
7-
87
* At Nicolas Coutin's suggestion, url_compose - url_parse in reverse - has been introduced.
98

109
BUG FIXES
1110

11+
* To adhere to RfC standards, "query" functions have been renamed "parameter"
1212
* A bug in which fragments could not be retrieved (and were incorrectly identified as parameters)
1313
has been fixed. Thanks to Nicolas Coutin for reporting it and providing a reproducible example.
1414

R/accessors.R

Lines changed: 38 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
#'@param x a URL, or vector of URLs
99
#'
1010
#'@param value a replacement value for x's scheme.
11+
#'
12+
#'@seealso \code{\link{domain}}, \code{\link{port}}, \code{\link{path}},
13+
#'\code{\link{parameters}} and \code{\link{fragment}} for other accessors.
14+
#'
1115
#'@examples
1216
#'#Get a component
1317
#'example_url <- "http://cran.r-project.org/submit.html"
@@ -20,6 +24,7 @@
2024
scheme <- function(x){
2125
return(get_component_(x,0))
2226
}
27+
2328
"scheme<-" <- function(x, value) standardGeneric("scheme<-")
2429
#'@rdname scheme
2530
#'@export
@@ -38,6 +43,9 @@ setGeneric("scheme<-", useAsDefault = function(x, value){
3843
#'
3944
#'@param value a replacement value for x's scheme.
4045
#'
46+
#'@seealso \code{\link{scheme}}, \code{\link{port}}, \code{\link{path}},
47+
#'\code{\link{parameters}} and \code{\link{fragment}} for other accessors.
48+
#'
4149
#'@examples
4250
#'#Get a component
4351
#'example_url <- "http://cran.r-project.org/submit.html"
@@ -60,12 +68,16 @@ setGeneric("domain<-", useAsDefault = function(x, value){
6068
#'@description as in the lubridate package, individual components of a URL
6169
#'can be both extracted or set using the relevant function call - see the
6270
#'examples.
71+
#'
6372
#'@aliases port
6473
#'@rdname port
6574
#'
6675
#'@param x a URL, or vector of URLs
6776
#'
68-
#'@param value a replacement value for x's scheme.
77+
#'@param value a replacement value for x's port.
78+
#'
79+
#'@seealso \code{\link{scheme}}, \code{\link{domain}}, \code{\link{path}},
80+
#'\code{\link{parameters}} and \code{\link{fragment}} for other accessors.
6981
#'
7082
#'@examples
7183
#'#Get a component
@@ -94,7 +106,10 @@ setGeneric("port<-", useAsDefault = function(x, value){
94106
#'
95107
#'@param x a URL, or vector of URLs
96108
#'
97-
#'@param value a replacement value for x's scheme.
109+
#'@param value a replacement value for x's path
110+
#'
111+
#'@seealso \code{\link{scheme}}, \code{\link{domain}}, \code{\link{port}},
112+
#'\code{\link{parameters}} and \code{\link{fragment}} for other accessors.
98113
#'
99114
#'@examples
100115
#'#Get a component
@@ -114,36 +129,41 @@ setGeneric("path<-", useAsDefault = function(x, value){
114129
return(set_component_(x, 3, value))
115130
})
116131

117-
#'@title Get or set a URL's query string
132+
#'@title Get or set a URL's parameters
118133
#'@description as in the lubridate package, individual components of a URL
119134
#'can be both extracted or set using the relevant function call - see the
120135
#'examples.
121-
#'@aliases query
122-
#'@rdname query
136+
#'
137+
#'@aliases parameters
138+
#'@rdname parameters
123139
#'
124140
#'@param x a URL, or vector of URLs
125141
#'
126-
#'@param value a replacement value for x's scheme.
142+
#'@param value a replacement value for x's parameters.
143+
#'
144+
#'@seealso \code{\link{scheme}}, \code{\link{domain}}, \code{\link{port}},
145+
#'\code{\link{path}} and \code{\link{fragment}} for other accessors.
127146
#'
128147
#'@examples
129148
#'#Get a component
130149
#'example_url <- "http://en.wikipedia.org/wiki/Aaron_Halfaker?debug=true"
131-
#'query(example_url)
150+
#'parameters(example_url)
151+
#'#[1] "debug=true"
132152
#'
133153
#'#Set a component
134-
#'query(example_url) <- "debug=false"
154+
#'parameters(example_url) <- "debug=false"
135155
#'@export
136-
query <- function(x){
156+
parameters <- function(x){
137157
return(get_component_(x,4))
138158
}
139-
"query<-" <- function(x, value) standardGeneric("query<-")
140-
#'@rdname query
159+
"parameters<-" <- function(x, value) standardGeneric("parameters<-")
160+
#'@rdname parameters
141161
#'@export
142-
setGeneric("query<-", useAsDefault = function(x, value){
162+
setGeneric("parameters<-", useAsDefault = function(x, value){
143163
return(set_component_(x, 4, value))
144164
})
145165

146-
#'@title Get or set a URL's fragment identifier
166+
#'@title Get or set a URL's fragment
147167
#'@description as in the lubridate package, individual components of a URL
148168
#'can be both extracted or set using the relevant function call - see the
149169
#'examples.
@@ -152,7 +172,10 @@ setGeneric("query<-", useAsDefault = function(x, value){
152172
#'
153173
#'@param x a URL, or vector of URLs
154174
#'
155-
#'@param value a replacement value for x's scheme.
175+
#'@param value a replacement value for x's fragment.
176+
#'
177+
#'@seealso \code{\link{scheme}}, \code{\link{domain}}, \code{\link{port}},
178+
#'\code{\link{path}} and \code{\link{parameters}} for other accessors.
156179
#'
157180
#'@examples
158181
#'#Get a component
@@ -167,6 +190,7 @@ setGeneric("query<-", useAsDefault = function(x, value){
167190
fragment <- function(x){
168191
return(get_component_(x,5))
169192
}
193+
170194
"fragment<-" <- function(x, value) standardGeneric("fragment<-")
171195
#'@rdname fragment
172196
#'@export

README.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,12 @@ The latest CRAN version can be obtained via:
3232

3333
The latest maintenance version:
3434

35-
devtools::install_github("ironholds/urltools", ref = "1.1.1")
35+
devtools::install_github("ironholds/urltools", ref = "1.2.0")
3636

3737
To get the development version:
3838

3939
devtools::install_github("ironholds/urltools")
4040

41-
Please note that the development version depends on the experimental [rope](https://github.com/Ironholds/rope)
42-
package.
43-
4441
###Dependencies
4542
* R. Doy.
4643
* [Rcpp](http://cran.rstudio.com/web/packages/Rcpp/)

man/domain.Rd

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,8 @@ domain(example_url)
2727
#Set a component
2828
domain(example_url) <- "en.wikipedia.org"
2929
}
30+
\seealso{
31+
\code{\link{scheme}}, \code{\link{port}}, \code{\link{path}},
32+
\code{\link{parameters}} and \code{\link{fragment}} for other accessors.
33+
}
3034

man/fragment.Rd

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
\name{fragment}
44
\alias{fragment}
55
\alias{fragment<-}
6-
\title{Get or set a URL's fragment identifier}
6+
\title{Get or set a URL's fragment}
77
\usage{
88
fragment(x)
99
@@ -12,7 +12,7 @@ fragment(x) <- value
1212
\arguments{
1313
\item{x}{a URL, or vector of URLs}
1414
15-
\item{value}{a replacement value for x's scheme.}
15+
\item{value}{a replacement value for x's fragment.}
1616
}
1717
\description{
1818
as in the lubridate package, individual components of a URL
@@ -27,4 +27,8 @@ fragment(example_url)
2727
#Set a component
2828
fragment(example_url) <- "production"
2929
}
30+
\seealso{
31+
\code{\link{scheme}}, \code{\link{domain}}, \code{\link{port}},
32+
\code{\link{path}} and \code{\link{parameters}} for other accessors.
33+
}
3034

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
% Generated by roxygen2 (4.1.1): do not edit by hand
22
% Please edit documentation in R/accessors.R
3-
\name{query}
4-
\alias{query}
5-
\alias{query<-}
6-
\title{Get or set a URL's query string}
3+
\name{parameters}
4+
\alias{parameters}
5+
\alias{parameters<-}
6+
\title{Get or set a URL's parameters}
77
\usage{
8-
query(x)
8+
parameters(x)
99
10-
query(x) <- value
10+
parameters(x) <- value
1111
}
1212
\arguments{
1313
\item{x}{a URL, or vector of URLs}
1414
15-
\item{value}{a replacement value for x's scheme.}
15+
\item{value}{a replacement value for x's parameters.}
1616
}
1717
\description{
1818
as in the lubridate package, individual components of a URL
@@ -22,9 +22,14 @@ examples.
2222
\examples{
2323
#Get a component
2424
example_url <- "http://en.wikipedia.org/wiki/Aaron_Halfaker?debug=true"
25-
query(example_url)
25+
parameters(example_url)
26+
#[1] "debug=true"
2627

2728
#Set a component
28-
query(example_url) <- "debug=false"
29+
parameters(example_url) <- "debug=false"
30+
}
31+
\seealso{
32+
\code{\link{scheme}}, \code{\link{domain}}, \code{\link{port}},
33+
\code{\link{path}} and \code{\link{fragment}} for other accessors.
2934
}
3035

man/path.Rd

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ path(x) <- value
1212
\arguments{
1313
\item{x}{a URL, or vector of URLs}
1414
15-
\item{value}{a replacement value for x's scheme.}
15+
\item{value}{a replacement value for x's path}
1616
}
1717
\description{
1818
as in the lubridate package, individual components of a URL
@@ -27,4 +27,8 @@ path(example_url)
2727
#Set a component
2828
path(example_url) <- "bin/windows/"
2929
}
30+
\seealso{
31+
\code{\link{scheme}}, \code{\link{domain}}, \code{\link{port}},
32+
\code{\link{parameters}} and \code{\link{fragment}} for other accessors.
33+
}
3034

man/port.Rd

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ port(x) <- value
1212
\arguments{
1313
\item{x}{a URL, or vector of URLs}
1414
15-
\item{value}{a replacement value for x's scheme.}
15+
\item{value}{a replacement value for x's port.}
1616
}
1717
\description{
1818
as in the lubridate package, individual components of a URL
@@ -27,4 +27,8 @@ port(example_url)
2727
#Set a component
2828
port(example_url) <- "12"
2929
}
30+
\seealso{
31+
\code{\link{scheme}}, \code{\link{domain}}, \code{\link{path}},
32+
\code{\link{parameters}} and \code{\link{fragment}} for other accessors.
33+
}
3034

0 commit comments

Comments
 (0)