Skip to content

Commit

Permalink
1.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
ironholds committed May 7, 2015
1 parent d38b08d commit 17fa2dc
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 10 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: urltools
Type: Package
Title: Vectorised Tools for URL Handling and Parsing
Version: 1.1.0
Version: 1.1.1
Date: 2015-04-11
Author: Oliver Keyes [aut, cre], Mark Greenaway [ctb]
Maintainer: Oliver Keyes <ironholds@gmail.com>
Expand Down
7 changes: 6 additions & 1 deletion NEWS
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
Version 1.1.1 [WIP] (maintenance release)
Version 1.1.1
-------------------------------------------------------------------------
BUG FIXES

* Parameter parsing now fixed to require a = after the parameter name, thus solving for scenarios where
the URL would contain the parameter name as part of, say, the domain, and it'd grab the wrong thing. Thanks
to Jacob Barnett for the bug report and example.
* URL encoding no longer encodes the slash between the domain and path (thanks to Peter Meissner for pointing
this bug out).

DEVELOPMENT
*More unit tests

Version 1.1.0
-------------------------------------------------------------------------
Expand Down
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,17 @@ crucial for large datasets. For more information, see the [urltools vignette](ht

###Installation

The latest released version can be obtained via:
The latest CRAN version can be obtained via:

install.packages("urltools")

The latest maintenance version:

devtools::install_github("ironholds/urltools", ref = "1.0.0")

To get the development version:

library(devtools)
install_github("ironholds/urltools")
devtools::install_github("ironholds/urltools")

###Dependencies
* R. Doy.
Expand Down
32 changes: 32 additions & 0 deletions src/parsing.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,22 @@ class parsing{
* part of the URL.
*/
std::vector < std::string > url_to_vector(std::string& url_ptr);

/**
* Take a URL and identify the TLD in use.
*
* @param domain_ptr a reference pointer to the domain name
*
* @param tlds a reference pointer to the vector of
* TLDs
*
* @see identify_multi_tld, the vectorised version.
*
* @return if a match is found, {"remaining_domain_fragment","matched_tld"}.
* If not, {"entire_domain","Not found"}
*/
std::vector < std::string > identify_single_tld (std::string& domain_ptr, std::vector < std::string >& tld_ptr);

public:

/**
Expand Down Expand Up @@ -144,6 +160,22 @@ class parsing{
*
*/
DataFrame parse_to_df(std::vector < std::string >& urls_ptr);

/**
* Take a URL and identify the TLD in use.
*
* @param domains_ptr a reference pointer to a vector of
* domain names.
*
* @param tld_ptr a reference pointer to the vector of
* TLDs
*
* @see identify_multi_tld, the vectorised version.
*
* @return if a match is found, {"remaining_domain_fragment","matched_tld"}.
* If not, {"entire_domain","Not found"}
*/
DataFrame identify_multi_tld_(std::vector < std::string >& domains_ptr, std::vector < std::string >& tld_ptr);

};
#endif
6 changes: 1 addition & 5 deletions tests/testthat/test_encoding.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,7 @@ test_that("Check encoding doesn't encode the scheme", {
expect_that(url_encode("https://"), equals("https://"))
})

test_that("Check encoding does not encode domain-level slashes", {
expect_that(url_encode("https://foo.org/"), equals("https://foo.org/"))
})

test_that("Check encoding does encode post-domain slashes", {
test_that("Check encoding does does not encode pre-path slashes", {
expect_that(url_encode("https://foo.org/bar/"), equals("https://foo.org/bar%2f"))
})

Expand Down

0 comments on commit 17fa2dc

Please sign in to comment.