postrank-uri 1.0.20 → 1.0.21
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +15 -0
- data/README.md +2 -0
- data/lib/postrank-uri.rb +1 -1
- data/lib/postrank-uri/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 25f156e4f2a2df514cf537a05b359d510fedc5d7
|
4
|
+
data.tar.gz: 2616681c902aa2b371c8d5e3a256ea15111ae0f8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 47204dad9f8c06a70f477bf1dffcc27b50e2668702f400239034579d1190b5492ad5295823893753d6d28d57843f9786c3265125a1764aba8c3b9f1f55581832
|
7
|
+
data.tar.gz: 6b6a5dd1c1360cdbb1ba32a3a5e34f087b74f5999264b94339c0f26cebfa614471de6c5ca9774532da5b88b12f32996c65068396cac5189f3f8509ddad9447ac
|
data/.travis.yml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
language: ruby
|
2
|
+
cache: bundler
|
3
|
+
rvm:
|
4
|
+
- 2.1
|
5
|
+
- 2.2
|
6
|
+
- 2.3
|
7
|
+
- 2.4.0
|
8
|
+
before_install:
|
9
|
+
- gem install bundler
|
10
|
+
install:
|
11
|
+
- bundle install --jobs=3 --retry=3
|
12
|
+
- bundle exec appraisal install
|
13
|
+
script:
|
14
|
+
- bundle exec rake
|
15
|
+
- bundle exec rake appraisal
|
data/README.md
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
# PostRank URI
|
2
2
|
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/postrank-uri.svg)](https://rubygems.org/gems/postrank-uri) [![Build Status](https://travis-ci.org/postrank-labs/postrank-uri.svg?branch=master)](https://travis-ci.org/postrank-labs/postrank-uri)
|
4
|
+
|
3
5
|
A collection of convenience methods (Ruby 1.8 & Ruby 1.9) for dealing with extracting, (un)escaping, normalization, and canonicalization of URIs. At PostRank we process over 20M URI associated activities each day, and we need to make sure that we can reliably extract the URIs from a variety of text formats, deal with all the numerous and creative ways users like to escape and unescape their URIs, normalize the resulting URIs, and finally apply a set of custom canonicalization rules to make sure that we can cross-reference when the users are talking about the same URL.
|
4
6
|
|
5
7
|
In a nutshell, we need to make sure that creative cases like the ones below all resolve to same URI:
|
data/lib/postrank-uri.rb
CHANGED
@@ -133,7 +133,7 @@ module PostRank
|
|
133
133
|
u = parse(uri)
|
134
134
|
u.query = u.query.tr('+', ' ') if u.query
|
135
135
|
u.to_s.gsub(URIREGEX[:unescape]) do |encoded|
|
136
|
-
if encoded.match
|
136
|
+
if !encoded.match(URIREGEX[:reserved_characters]).nil?
|
137
137
|
encoded
|
138
138
|
else
|
139
139
|
[encoded.delete('%')].pack('H*')
|
data/lib/postrank-uri/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: postrank-uri
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.21
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ilya Grigorik
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-03-
|
11
|
+
date: 2017-03-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|
@@ -127,6 +127,7 @@ extra_rdoc_files: []
|
|
127
127
|
files:
|
128
128
|
- ".gitignore"
|
129
129
|
- ".rspec"
|
130
|
+
- ".travis.yml"
|
130
131
|
- Appraisals
|
131
132
|
- Gemfile
|
132
133
|
- LICENSE
|