url_canonicalize 0.1.15 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.rubocop.yml +30 -29
- data/.travis.yml +5 -1
- data/CHANGELOG.md +81 -0
- data/Gemfile +1 -0
- data/Gemfile.local.example +4 -3
- data/Guardfile +1 -0
- data/README.md +3 -1
- data/Rakefile +1 -0
- data/lib/monkey_patches/addressable/uri.rb +1 -0
- data/lib/monkey_patches/string.rb +1 -0
- data/lib/monkey_patches/uri.rb +1 -0
- data/lib/url_canonicalize.rb +1 -0
- data/lib/url_canonicalize/exception.rb +1 -0
- data/lib/url_canonicalize/http.rb +1 -0
- data/lib/url_canonicalize/request.rb +1 -0
- data/lib/url_canonicalize/response.rb +5 -0
- data/lib/url_canonicalize/uri.rb +2 -1
- data/lib/url_canonicalize/version.rb +2 -1
- data/url_canonicalize.gemspec +1 -1
- metadata +6 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 510cbc3c33819c97d28ca20d712d18c2ea25ccf29846b5f6f5c35e3e92b67513
|
4
|
+
data.tar.gz: f9ec2c8be1e3d23d2a0011de38452577b0d4978924b77f409229204df6cea2c0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f12b8967b5399aea9cd88642d14c1ed570e158ee62beb6642dd8e3534c42435064659a6ed49aea6f6f0adc3dab38455d83f71919fd1e5407239798579986adf5
|
7
|
+
data.tar.gz: d850c233c28d0d5cef5a7abe670278a69f35c9c4d7fee12886ae77b51030d3bb73fdb00e1b19a2a72558d3dffddcc736c7f374de987f6763e1fda24f875c1124
|
data/.rubocop.yml
CHANGED
@@ -1,44 +1,53 @@
|
|
1
1
|
---
|
2
2
|
AllCops:
|
3
|
+
DisplayStyleGuide: true
|
4
|
+
DisplayCopNames: true
|
5
|
+
TargetRubyVersion: 2.2
|
3
6
|
Exclude:
|
4
7
|
- '*.gemspec'
|
5
|
-
-
|
8
|
+
- spec/**/*
|
6
9
|
|
7
|
-
Performance/RegexpMatch:
|
8
|
-
Enabled: false # match? is only available in Ruby 2.4+
|
9
10
|
|
10
|
-
|
11
|
-
|
11
|
+
Layout/DotPosition:
|
12
|
+
Description: 'Checks the position of the dot in multi-line method calls.'
|
13
|
+
EnforcedStyle: leading
|
12
14
|
Enabled: true
|
13
15
|
|
14
|
-
|
15
|
-
|
16
|
+
Layout/ExtraSpacing:
|
17
|
+
Description: 'Do not use unnecessary spacing.'
|
16
18
|
Enabled: true
|
17
19
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
20
|
+
Lint/LiteralInInterpolation:
|
21
|
+
Description: 'Avoid interpolating literals in strings'
|
22
|
+
AutoCorrect: true
|
23
|
+
|
24
|
+
Metrics/ClassLength:
|
25
|
+
CountComments: false # count full line comments?
|
26
|
+
Max: 200
|
22
27
|
|
23
|
-
MethodLength:
|
28
|
+
Metrics/MethodLength:
|
24
29
|
Max: 12
|
25
30
|
|
26
|
-
|
27
|
-
|
28
|
-
|
31
|
+
Metrics/LineLength:
|
32
|
+
Max: 120
|
33
|
+
Exclude:
|
34
|
+
- spec/**/*
|
35
|
+
|
36
|
+
Naming/FileName:
|
37
|
+
Description: 'Use snake_case for source file names.'
|
29
38
|
Enabled: true
|
30
39
|
|
31
|
-
ClassAndModuleChildren:
|
40
|
+
Style/ClassAndModuleChildren:
|
32
41
|
Description: 'Checks style of children classes and modules.'
|
33
42
|
EnforcedStyle: nested
|
34
43
|
Enabled: true
|
35
44
|
|
36
|
-
Documentation:
|
45
|
+
Style/Documentation:
|
37
46
|
Description: 'Document classes and non-namespace modules.'
|
38
47
|
Enabled: false
|
39
48
|
|
40
|
-
|
41
|
-
|
49
|
+
Style/StringLiterals:
|
50
|
+
EnforcedStyle: single_quotes
|
42
51
|
Enabled: true
|
43
52
|
|
44
53
|
Style/SymbolArray:
|
@@ -46,14 +55,6 @@ Style/SymbolArray:
|
|
46
55
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-i'
|
47
56
|
Enabled: false # Only available in Ruby 2.0+
|
48
57
|
|
49
|
-
Style/
|
50
|
-
|
58
|
+
Style/TrailingCommaInArguments:
|
59
|
+
EnforcedStyleForMultiline: no_comma
|
51
60
|
Enabled: true
|
52
|
-
|
53
|
-
Lint/LiteralInInterpolation:
|
54
|
-
Description: 'Avoid interpolating literals in strings'
|
55
|
-
AutoCorrect: true
|
56
|
-
|
57
|
-
Metrics/ClassLength:
|
58
|
-
CountComments: false # count full line comments?
|
59
|
-
Max: 200
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
ADDED
@@ -0,0 +1,81 @@
|
|
1
|
+
# Change Log
|
2
|
+
|
3
|
+
## [v0.1.15](https://github.com/dominicsayers/url_canonicalize/tree/v0.1.15) (2017-03-14)
|
4
|
+
[Full Changelog](https://github.com/dominicsayers/url_canonicalize/compare/v0.1.14...v0.1.15)
|
5
|
+
|
6
|
+
## [v0.1.14](https://github.com/dominicsayers/url_canonicalize/tree/v0.1.14) (2017-03-13)
|
7
|
+
[Full Changelog](https://github.com/dominicsayers/url_canonicalize/compare/v0.1.13...v0.1.14)
|
8
|
+
|
9
|
+
## [v0.1.13](https://github.com/dominicsayers/url_canonicalize/tree/v0.1.13) (2017-03-13)
|
10
|
+
[Full Changelog](https://github.com/dominicsayers/url_canonicalize/compare/v0.1.12...v0.1.13)
|
11
|
+
|
12
|
+
## [v0.1.12](https://github.com/dominicsayers/url_canonicalize/tree/v0.1.12) (2017-03-13)
|
13
|
+
[Full Changelog](https://github.com/dominicsayers/url_canonicalize/compare/v0.1.11...v0.1.12)
|
14
|
+
|
15
|
+
## [v0.1.11](https://github.com/dominicsayers/url_canonicalize/tree/v0.1.11) (2017-03-13)
|
16
|
+
[Full Changelog](https://github.com/dominicsayers/url_canonicalize/compare/v0.1.10...v0.1.11)
|
17
|
+
|
18
|
+
## [v0.1.10](https://github.com/dominicsayers/url_canonicalize/tree/v0.1.10) (2017-03-13)
|
19
|
+
[Full Changelog](https://github.com/dominicsayers/url_canonicalize/compare/v0.1.9...v0.1.10)
|
20
|
+
|
21
|
+
**Closed issues:**
|
22
|
+
|
23
|
+
- URLCanonicalize doesn't accept host names [\#4](https://github.com/dominicsayers/url_canonicalize/issues/4)
|
24
|
+
|
25
|
+
## [v0.1.9](https://github.com/dominicsayers/url_canonicalize/tree/v0.1.9) (2017-03-06)
|
26
|
+
[Full Changelog](https://github.com/dominicsayers/url_canonicalize/compare/v0.1.8...v0.1.9)
|
27
|
+
|
28
|
+
## [v0.1.8](https://github.com/dominicsayers/url_canonicalize/tree/v0.1.8) (2017-03-06)
|
29
|
+
[Full Changelog](https://github.com/dominicsayers/url_canonicalize/compare/v0.1.7...v0.1.8)
|
30
|
+
|
31
|
+
**Closed issues:**
|
32
|
+
|
33
|
+
- Use a later version of Ruby on CircleCI [\#3](https://github.com/dominicsayers/url_canonicalize/issues/3)
|
34
|
+
|
35
|
+
## [v0.1.7](https://github.com/dominicsayers/url_canonicalize/tree/v0.1.7) (2017-03-06)
|
36
|
+
[Full Changelog](https://github.com/dominicsayers/url_canonicalize/compare/v0.1.6...v0.1.7)
|
37
|
+
|
38
|
+
**Closed issues:**
|
39
|
+
|
40
|
+
- Insecure version of Nokogiri [\#2](https://github.com/dominicsayers/url_canonicalize/issues/2)
|
41
|
+
|
42
|
+
## [v0.1.6](https://github.com/dominicsayers/url_canonicalize/tree/v0.1.6) (2017-03-06)
|
43
|
+
[Full Changelog](https://github.com/dominicsayers/url_canonicalize/compare/v0.1.5...v0.1.6)
|
44
|
+
|
45
|
+
## [v0.1.5](https://github.com/dominicsayers/url_canonicalize/tree/v0.1.5) (2016-10-26)
|
46
|
+
[Full Changelog](https://github.com/dominicsayers/url_canonicalize/compare/v0.1.4...v0.1.5)
|
47
|
+
|
48
|
+
## [v0.1.4](https://github.com/dominicsayers/url_canonicalize/tree/v0.1.4) (2016-10-26)
|
49
|
+
[Full Changelog](https://github.com/dominicsayers/url_canonicalize/compare/v0.1.2...v0.1.4)
|
50
|
+
|
51
|
+
## [v0.1.2](https://github.com/dominicsayers/url_canonicalize/tree/v0.1.2) (2016-10-26)
|
52
|
+
[Full Changelog](https://github.com/dominicsayers/url_canonicalize/compare/v0.1.1...v0.1.2)
|
53
|
+
|
54
|
+
## [v0.1.1](https://github.com/dominicsayers/url_canonicalize/tree/v0.1.1) (2016-10-26)
|
55
|
+
[Full Changelog](https://github.com/dominicsayers/url_canonicalize/compare/v0.1.0...v0.1.1)
|
56
|
+
|
57
|
+
## [v0.1.0](https://github.com/dominicsayers/url_canonicalize/tree/v0.1.0) (2016-10-20)
|
58
|
+
[Full Changelog](https://github.com/dominicsayers/url_canonicalize/compare/v0.0.7...v0.1.0)
|
59
|
+
|
60
|
+
## [v0.0.7](https://github.com/dominicsayers/url_canonicalize/tree/v0.0.7) (2016-10-20)
|
61
|
+
[Full Changelog](https://github.com/dominicsayers/url_canonicalize/compare/v0.0.6...v0.0.7)
|
62
|
+
|
63
|
+
## [v0.0.6](https://github.com/dominicsayers/url_canonicalize/tree/v0.0.6) (2016-10-20)
|
64
|
+
[Full Changelog](https://github.com/dominicsayers/url_canonicalize/compare/v0.0.5...v0.0.6)
|
65
|
+
|
66
|
+
## [v0.0.5](https://github.com/dominicsayers/url_canonicalize/tree/v0.0.5) (2016-10-20)
|
67
|
+
[Full Changelog](https://github.com/dominicsayers/url_canonicalize/compare/v0.0.4...v0.0.5)
|
68
|
+
|
69
|
+
## [v0.0.4](https://github.com/dominicsayers/url_canonicalize/tree/v0.0.4) (2016-10-20)
|
70
|
+
[Full Changelog](https://github.com/dominicsayers/url_canonicalize/compare/v0.0.3...v0.0.4)
|
71
|
+
|
72
|
+
## [v0.0.3](https://github.com/dominicsayers/url_canonicalize/tree/v0.0.3) (2016-10-20)
|
73
|
+
[Full Changelog](https://github.com/dominicsayers/url_canonicalize/compare/v0.0.2...v0.0.3)
|
74
|
+
|
75
|
+
## [v0.0.2](https://github.com/dominicsayers/url_canonicalize/tree/v0.0.2) (2016-10-20)
|
76
|
+
[Full Changelog](https://github.com/dominicsayers/url_canonicalize/compare/v0.0.1...v0.0.2)
|
77
|
+
|
78
|
+
## [v0.0.1](https://github.com/dominicsayers/url_canonicalize/tree/v0.0.1) (2016-10-20)
|
79
|
+
|
80
|
+
|
81
|
+
\* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
|
data/Gemfile
CHANGED
data/Gemfile.local.example
CHANGED
@@ -1,11 +1,12 @@
|
|
1
1
|
# Copy this file to a file named Gemfile.local to add these gems to your dev toolset
|
2
2
|
# Feel free to modify Gemfile.local to suit your own preferences
|
3
3
|
group :development do
|
4
|
-
gem '
|
4
|
+
gem 'github_changelog_generator'
|
5
5
|
gem 'gem-release'
|
6
|
-
gem 'rubocop'
|
7
|
-
gem 'listen', '~> 3.0', '< 3.1' # Dependency of guard, 3.1 requires Ruby 2.2+
|
8
6
|
gem 'guard'
|
9
7
|
gem 'guard-rspec'
|
10
8
|
gem 'guard-rubocop'
|
9
|
+
gem 'listen', '~> 3.0', '< 3.1' # Dependency of guard, 3.1 requires Ruby 2.2+
|
10
|
+
gem 'rake'
|
11
|
+
gem 'rubocop'
|
11
12
|
end
|
data/Guardfile
CHANGED
data/README.md
CHANGED
@@ -2,10 +2,12 @@
|
|
2
2
|
[![Gem Version](https://badge.fury.io/rb/url_canonicalize.svg)](https://rubygems.org/gems/url_canonicalize)
|
3
3
|
[![Gem downloads](https://img.shields.io/gem/dt/url_canonicalize.svg)](https://rubygems.org/gems/url_canonicalize)
|
4
4
|
[![Build status](https://img.shields.io/circleci/project/dominicsayers/url_canonicalize/master.svg)](https://circleci.com/gh/dominicsayers/url_canonicalize)
|
5
|
-
[![
|
5
|
+
[![Maintainability](https://api.codeclimate.com/v1/badges/1f92f784d12741a942ec/maintainability)](https://codeclimate.com/github/dominicsayers/url_canonicalize/maintainability)
|
6
|
+
[![Test Coverage](https://api.codeclimate.com/v1/badges/1f92f784d12741a942ec/test_coverage)](https://codeclimate.com/github/dominicsayers/url_canonicalize/test_coverage)
|
6
7
|
[![Coverage Status](https://coveralls.io/repos/github/dominicsayers/url_canonicalize/badge.svg?branch=master)](https://coveralls.io/github/dominicsayers/url_canonicalize?branch=master)
|
7
8
|
[![Dependency Status](https://dependencyci.com/github/dominicsayers/url_canonicalize/badge)](https://dependencyci.com/github/dominicsayers/url_canonicalize)
|
8
9
|
[![Security](https://hakiri.io/github/dominicsayers/url_canonicalize/master.svg)](https://hakiri.io/github/dominicsayers/url_canonicalize/master)
|
10
|
+
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/1b8d50209b8c41a2b8200e25a63d57b3)](https://www.codacy.com/app/dominicsayers/url_canonicalize)
|
9
11
|
|
10
12
|
URLCanonicalize is a Ruby gem that finds the canonical version of a URL. It
|
11
13
|
provides `canonicalize` methods for the String, URI::HTTP, URI::HTTPS and
|
data/Rakefile
CHANGED
data/lib/monkey_patches/uri.rb
CHANGED
data/lib/url_canonicalize.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
|
2
3
|
module URLCanonicalize
|
3
4
|
# The response from an HTTP request
|
4
5
|
module Response
|
@@ -18,6 +19,10 @@ module URLCanonicalize
|
|
18
19
|
class Success < Generic
|
19
20
|
attr_reader :response, :html
|
20
21
|
|
22
|
+
def xml
|
23
|
+
@xml ||= Nokogiri::XML response.body
|
24
|
+
end
|
25
|
+
|
21
26
|
private
|
22
27
|
|
23
28
|
def initialize(url, response, html)
|
data/lib/url_canonicalize/uri.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
|
2
3
|
module URLCanonicalize
|
3
4
|
# Manage the URL into a URI with local exception handling
|
4
5
|
class URI
|
@@ -26,7 +27,7 @@ module URLCanonicalize
|
|
26
27
|
end
|
27
28
|
|
28
29
|
VALID_CLASSES = [::URI::HTTP, ::URI::HTTPS].freeze
|
29
|
-
COLON = ':'
|
30
|
+
COLON = ':'.freeze
|
30
31
|
end
|
31
32
|
end
|
32
33
|
end
|
data/url_canonicalize.gemspec
CHANGED
@@ -24,5 +24,5 @@ Gem::Specification.new do |s|
|
|
24
24
|
s.require_paths = ['lib']
|
25
25
|
|
26
26
|
s.add_dependency 'addressable', '~> 2' # To normalize URLs
|
27
|
-
s.add_dependency 'nokogiri', '>= 1.
|
27
|
+
s.add_dependency 'nokogiri', '>= 1.8.2' # To look for <link rel="canonical" ...> in HTML
|
28
28
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: url_canonicalize
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dominic Sayers
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-06-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 1.
|
33
|
+
version: 1.8.2
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 1.
|
40
|
+
version: 1.8.2
|
41
41
|
description: 'Rubygem that finds the canonical version of a URL by providing #canonicalize
|
42
42
|
methods for the String, URI::HTTP, URI::HTTPS and Addressable::URI classes'
|
43
43
|
email:
|
@@ -53,6 +53,7 @@ files:
|
|
53
53
|
- ".rubocop.yml"
|
54
54
|
- ".ruby-gemset"
|
55
55
|
- ".travis.yml"
|
56
|
+
- CHANGELOG.md
|
56
57
|
- Gemfile
|
57
58
|
- Gemfile.local.example
|
58
59
|
- Guardfile
|
@@ -91,7 +92,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
91
92
|
version: '0'
|
92
93
|
requirements: []
|
93
94
|
rubyforge_project:
|
94
|
-
rubygems_version: 2.
|
95
|
+
rubygems_version: 2.7.7
|
95
96
|
signing_key:
|
96
97
|
specification_version: 4
|
97
98
|
summary: Finds the canonical version of a URL
|