url_canonicalize 0.2.1 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/codeql-analysis.yml +70 -0
- data/.gitignore +2 -0
- data/.rubocop.yml +1 -1
- data/.travis.yml +2 -3
- data/Gemfile +2 -2
- data/Gemfile.lock +67 -59
- data/circle.yml +1 -1
- data/lib/url_canonicalize/request.rb +2 -2
- data/lib/url_canonicalize/response.rb +2 -2
- data/lib/url_canonicalize/uri.rb +1 -0
- data/lib/url_canonicalize/version.rb +1 -1
- data/renovate.json +6 -0
- data/url_canonicalize.gemspec +3 -4
- metadata +9 -7
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 660347135be60bf3324f23f796121f9d82b7a8ab44924d2a03f8b1d4d5bff2cf
|
|
4
|
+
data.tar.gz: 0fd6bf4532334bbd631fe4b829cddac92d1780d679dbb77bff6b4a95b5475eb6
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d9e654dcd8bf45a3261b5a7f9e2d1ce3f4e0f4dab80b48162cc8d9ae59493831060216b084b669820344414c4879557223faaabffc83f8003ca61f1a760c0d94
|
|
7
|
+
data.tar.gz: bb8f6459c22401e47fa050e367a9a3f7e719ac38f25758e6ecce4a30f6973c1b6e5753818127c215254cef8d9858356cd7b5c47ab55b882a1ba70b8971bcad82
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# For most projects, this workflow file will not need changing; you simply need
|
|
2
|
+
# to commit it to your repository.
|
|
3
|
+
#
|
|
4
|
+
# You may wish to alter this file to override the set of languages analyzed,
|
|
5
|
+
# or to provide custom queries or build logic.
|
|
6
|
+
#
|
|
7
|
+
# ******** NOTE ********
|
|
8
|
+
# We have attempted to detect the languages in your repository. Please check
|
|
9
|
+
# the `language` matrix defined below to confirm you have the correct set of
|
|
10
|
+
# supported CodeQL languages.
|
|
11
|
+
#
|
|
12
|
+
name: "CodeQL"
|
|
13
|
+
|
|
14
|
+
on:
|
|
15
|
+
push:
|
|
16
|
+
branches: [ main ]
|
|
17
|
+
pull_request:
|
|
18
|
+
# The branches below must be a subset of the branches above
|
|
19
|
+
branches: [ main ]
|
|
20
|
+
schedule:
|
|
21
|
+
- cron: '28 12 * * 5'
|
|
22
|
+
|
|
23
|
+
jobs:
|
|
24
|
+
analyze:
|
|
25
|
+
name: Analyze
|
|
26
|
+
runs-on: ubuntu-latest
|
|
27
|
+
permissions:
|
|
28
|
+
actions: read
|
|
29
|
+
contents: read
|
|
30
|
+
security-events: write
|
|
31
|
+
|
|
32
|
+
strategy:
|
|
33
|
+
fail-fast: false
|
|
34
|
+
matrix:
|
|
35
|
+
language: [ 'ruby' ]
|
|
36
|
+
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
|
|
37
|
+
# Learn more about CodeQL language support at https://git.io/codeql-language-support
|
|
38
|
+
|
|
39
|
+
steps:
|
|
40
|
+
- name: Checkout repository
|
|
41
|
+
uses: actions/checkout@v4
|
|
42
|
+
|
|
43
|
+
# Initializes the CodeQL tools for scanning.
|
|
44
|
+
- name: Initialize CodeQL
|
|
45
|
+
uses: github/codeql-action/init@v3
|
|
46
|
+
with:
|
|
47
|
+
languages: ${{ matrix.language }}
|
|
48
|
+
# If you wish to specify custom queries, you can do so here or in a config file.
|
|
49
|
+
# By default, queries listed here will override any specified in a config file.
|
|
50
|
+
# Prefix the list here with "+" to use these queries and those in the config file.
|
|
51
|
+
# queries: ./path/to/local/query, your-org/your-repo/queries@main
|
|
52
|
+
|
|
53
|
+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
|
|
54
|
+
# If this step fails, then you should remove it and run the build manually (see below)
|
|
55
|
+
- name: Autobuild
|
|
56
|
+
uses: github/codeql-action/autobuild@v3
|
|
57
|
+
|
|
58
|
+
# ℹ️ Command-line programs to run using the OS shell.
|
|
59
|
+
# 📚 https://git.io/JvXDl
|
|
60
|
+
|
|
61
|
+
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
|
|
62
|
+
# and modify them (or add more) to build your code if your project
|
|
63
|
+
# uses a compiled language
|
|
64
|
+
|
|
65
|
+
#- run: |
|
|
66
|
+
# make bootstrap
|
|
67
|
+
# make release
|
|
68
|
+
|
|
69
|
+
- name: Perform CodeQL Analysis
|
|
70
|
+
uses: github/codeql-action/analyze@v3
|
data/.gitignore
CHANGED
data/.rubocop.yml
CHANGED
data/.travis.yml
CHANGED
data/Gemfile
CHANGED
|
@@ -10,10 +10,10 @@ group :static_code_analysis do
|
|
|
10
10
|
end
|
|
11
11
|
|
|
12
12
|
group :test do
|
|
13
|
-
gem 'coveralls', require: false
|
|
13
|
+
gem 'coveralls-ruby', require: false
|
|
14
14
|
gem 'rspec'
|
|
15
15
|
gem 'rspec_junit_formatter'
|
|
16
|
-
gem 'simplecov'
|
|
16
|
+
gem 'simplecov'
|
|
17
17
|
gem 'webmock'
|
|
18
18
|
end
|
|
19
19
|
|
data/Gemfile.lock
CHANGED
|
@@ -1,85 +1,93 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
url_canonicalize (0.
|
|
4
|
+
url_canonicalize (1.0.0)
|
|
5
5
|
addressable (~> 2)
|
|
6
6
|
nokogiri (>= 1.13)
|
|
7
7
|
|
|
8
8
|
GEM
|
|
9
9
|
remote: https://rubygems.org/
|
|
10
10
|
specs:
|
|
11
|
-
addressable (2.8.
|
|
12
|
-
public_suffix (>= 2.0.2, <
|
|
11
|
+
addressable (2.8.6)
|
|
12
|
+
public_suffix (>= 2.0.2, < 6.0)
|
|
13
13
|
ast (2.4.2)
|
|
14
|
-
coveralls (0.
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
14
|
+
coveralls-ruby (0.2.0)
|
|
15
|
+
json (>= 1.8, < 3)
|
|
16
|
+
simplecov (~> 0.16.1)
|
|
17
|
+
term-ansicolor (~> 1.3)
|
|
18
|
+
thor (>= 0.19.4, < 2.0)
|
|
19
|
+
tins (~> 1.6)
|
|
20
20
|
crack (0.4.5)
|
|
21
21
|
rexml
|
|
22
22
|
diff-lcs (1.5.0)
|
|
23
23
|
docile (1.4.0)
|
|
24
24
|
gem-release (2.2.2)
|
|
25
|
-
hashdiff (1.0
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
25
|
+
hashdiff (1.1.0)
|
|
26
|
+
json (2.7.1)
|
|
27
|
+
language_server-protocol (3.17.0.3)
|
|
28
|
+
mini_portile2 (2.8.5)
|
|
29
|
+
nokogiri (1.13.10)
|
|
30
|
+
mini_portile2 (~> 2.8.0)
|
|
31
31
|
racc (~> 1.4)
|
|
32
|
-
parallel (1.
|
|
33
|
-
parser (3.
|
|
32
|
+
parallel (1.24.0)
|
|
33
|
+
parser (3.3.0.5)
|
|
34
34
|
ast (~> 2.4.1)
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
racc
|
|
36
|
+
public_suffix (4.0.7)
|
|
37
|
+
racc (1.6.1)
|
|
37
38
|
rainbow (3.1.1)
|
|
38
|
-
regexp_parser (2.
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
rspec-
|
|
44
|
-
|
|
45
|
-
rspec-
|
|
46
|
-
rspec-
|
|
47
|
-
rspec-support (~> 3.10.0)
|
|
48
|
-
rspec-expectations (3.10.2)
|
|
39
|
+
regexp_parser (2.9.0)
|
|
40
|
+
rexml (3.2.6)
|
|
41
|
+
rspec (3.12.0)
|
|
42
|
+
rspec-core (~> 3.12.0)
|
|
43
|
+
rspec-expectations (~> 3.12.0)
|
|
44
|
+
rspec-mocks (~> 3.12.0)
|
|
45
|
+
rspec-core (3.12.2)
|
|
46
|
+
rspec-support (~> 3.12.0)
|
|
47
|
+
rspec-expectations (3.12.3)
|
|
49
48
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
50
|
-
rspec-support (~> 3.
|
|
51
|
-
rspec-mocks (3.
|
|
49
|
+
rspec-support (~> 3.12.0)
|
|
50
|
+
rspec-mocks (3.12.6)
|
|
52
51
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
53
|
-
rspec-support (~> 3.
|
|
54
|
-
rspec-support (3.
|
|
55
|
-
rspec_junit_formatter (0.
|
|
52
|
+
rspec-support (~> 3.12.0)
|
|
53
|
+
rspec-support (3.12.1)
|
|
54
|
+
rspec_junit_formatter (0.6.0)
|
|
56
55
|
rspec-core (>= 2, < 4, != 2.12.0)
|
|
57
|
-
rubocop (1.
|
|
56
|
+
rubocop (1.60.2)
|
|
57
|
+
json (~> 2.3)
|
|
58
|
+
language_server-protocol (>= 3.17.0)
|
|
58
59
|
parallel (~> 1.10)
|
|
59
|
-
parser (>= 3.
|
|
60
|
+
parser (>= 3.3.0.2)
|
|
60
61
|
rainbow (>= 2.2.2, < 4.0)
|
|
61
62
|
regexp_parser (>= 1.8, < 3.0)
|
|
62
|
-
rexml
|
|
63
|
-
rubocop-ast (>= 1.
|
|
63
|
+
rexml (>= 3.2.5, < 4.0)
|
|
64
|
+
rubocop-ast (>= 1.30.0, < 2.0)
|
|
64
65
|
ruby-progressbar (~> 1.7)
|
|
65
|
-
unicode-display_width (>=
|
|
66
|
-
rubocop-ast (1.
|
|
67
|
-
parser (>= 3.
|
|
68
|
-
rubocop-
|
|
69
|
-
rubocop (~> 1.
|
|
70
|
-
|
|
71
|
-
|
|
66
|
+
unicode-display_width (>= 2.4.0, < 3.0)
|
|
67
|
+
rubocop-ast (1.30.0)
|
|
68
|
+
parser (>= 3.2.1.0)
|
|
69
|
+
rubocop-capybara (2.20.0)
|
|
70
|
+
rubocop (~> 1.41)
|
|
71
|
+
rubocop-factory_bot (2.25.1)
|
|
72
|
+
rubocop (~> 1.41)
|
|
73
|
+
rubocop-rspec (2.26.1)
|
|
74
|
+
rubocop (~> 1.40)
|
|
75
|
+
rubocop-capybara (~> 2.17)
|
|
76
|
+
rubocop-factory_bot (~> 2.22)
|
|
77
|
+
ruby-progressbar (1.13.0)
|
|
78
|
+
simplecov (0.16.1)
|
|
72
79
|
docile (~> 1.1)
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
simplecov-html (0.
|
|
76
|
-
|
|
77
|
-
term-ansicolor (1.
|
|
78
|
-
tins (~> 0
|
|
79
|
-
thor (
|
|
80
|
-
tins (
|
|
81
|
-
|
|
82
|
-
|
|
80
|
+
json (>= 1.8, < 3)
|
|
81
|
+
simplecov-html (~> 0.10.0)
|
|
82
|
+
simplecov-html (0.10.2)
|
|
83
|
+
sync (0.5.0)
|
|
84
|
+
term-ansicolor (1.7.1)
|
|
85
|
+
tins (~> 1.0)
|
|
86
|
+
thor (1.2.1)
|
|
87
|
+
tins (1.31.0)
|
|
88
|
+
sync
|
|
89
|
+
unicode-display_width (2.5.0)
|
|
90
|
+
webmock (3.19.1)
|
|
83
91
|
addressable (>= 2.8.0)
|
|
84
92
|
crack (>= 0.3.2)
|
|
85
93
|
hashdiff (>= 0.4.0, < 2.0.0)
|
|
@@ -88,15 +96,15 @@ PLATFORMS
|
|
|
88
96
|
x86_64-linux
|
|
89
97
|
|
|
90
98
|
DEPENDENCIES
|
|
91
|
-
coveralls
|
|
99
|
+
coveralls-ruby
|
|
92
100
|
gem-release
|
|
93
101
|
rspec
|
|
94
102
|
rspec_junit_formatter
|
|
95
103
|
rubocop
|
|
96
104
|
rubocop-rspec
|
|
97
|
-
simplecov
|
|
105
|
+
simplecov
|
|
98
106
|
url_canonicalize!
|
|
99
107
|
webmock
|
|
100
108
|
|
|
101
109
|
BUNDLED WITH
|
|
102
|
-
2.
|
|
110
|
+
2.5.5
|
data/circle.yml
CHANGED
|
@@ -147,8 +147,8 @@ module URLCanonicalize
|
|
|
147
147
|
def headers
|
|
148
148
|
@headers ||= {
|
|
149
149
|
'Accept-Language' => 'en-US,en;q=0.8',
|
|
150
|
-
'User-Agent' => 'Mozilla/5.0 (Windows NT 10.0; WOW64) '\
|
|
151
|
-
'AppleWebKit/537.36 (KHTML, like Gecko) '\
|
|
150
|
+
'User-Agent' => 'Mozilla/5.0 (Windows NT 10.0; WOW64) ' \
|
|
151
|
+
'AppleWebKit/537.36 (KHTML, like Gecko) ' \
|
|
152
152
|
'Chrome/51.0.2704.103 Safari/537.36'
|
|
153
153
|
}
|
|
154
154
|
end
|
|
@@ -28,7 +28,7 @@ module URLCanonicalize
|
|
|
28
28
|
def initialize(url, response, html)
|
|
29
29
|
@response = response
|
|
30
30
|
@html = html
|
|
31
|
-
super
|
|
31
|
+
super(url)
|
|
32
32
|
end
|
|
33
33
|
end
|
|
34
34
|
|
|
@@ -40,7 +40,7 @@ module URLCanonicalize
|
|
|
40
40
|
|
|
41
41
|
def initialize(url, response)
|
|
42
42
|
@response = response
|
|
43
|
-
super
|
|
43
|
+
super(url)
|
|
44
44
|
end
|
|
45
45
|
end
|
|
46
46
|
|
data/lib/url_canonicalize/uri.rb
CHANGED
|
@@ -18,6 +18,7 @@ module URLCanonicalize
|
|
|
18
18
|
def valid?(uri)
|
|
19
19
|
raise URLCanonicalize::Exception::URI, "#{uri} must be http or https" unless VALID_CLASSES.include?(uri.class)
|
|
20
20
|
raise URLCanonicalize::Exception::URI, "Missing host name in #{uri}" unless uri.host
|
|
21
|
+
raise URLCanonicalize::Exception::URI, "Empty host name in #{uri}" if uri.host.empty?
|
|
21
22
|
|
|
22
23
|
true
|
|
23
24
|
end
|
data/renovate.json
ADDED
data/url_canonicalize.gemspec
CHANGED
|
@@ -10,17 +10,16 @@ Gem::Specification.new do |s|
|
|
|
10
10
|
s.authors = ['Dominic Sayers']
|
|
11
11
|
s.email = ['dominic@sayers.cc']
|
|
12
12
|
s.summary = 'Finds the canonical version of a URL'
|
|
13
|
-
s.description = 'Rubygem that finds the canonical version of a URL by '\
|
|
14
|
-
'providing #canonicalize methods for the String, URI::HTTP'\
|
|
13
|
+
s.description = 'Rubygem that finds the canonical version of a URL by ' \
|
|
14
|
+
'providing #canonicalize methods for the String, URI::HTTP' \
|
|
15
15
|
', URI::HTTPS and Addressable::URI classes'
|
|
16
16
|
s.homepage = 'https://github.com/dominicsayers/url_canonicalize'
|
|
17
17
|
s.license = 'MIT'
|
|
18
18
|
|
|
19
|
-
s.required_ruby_version = '>=
|
|
19
|
+
s.required_ruby_version = '>= 3.1.0'
|
|
20
20
|
|
|
21
21
|
s.files = `git ls-files`.split($RS).grep_v(%r{^spec/})
|
|
22
22
|
|
|
23
|
-
s.test_files = []
|
|
24
23
|
s.executables = s.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
|
25
24
|
s.require_paths = ['lib']
|
|
26
25
|
|
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: 1.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Dominic Sayers
|
|
8
|
-
autorequire:
|
|
8
|
+
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2024-01-27 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: addressable
|
|
@@ -47,6 +47,7 @@ extensions: []
|
|
|
47
47
|
extra_rdoc_files: []
|
|
48
48
|
files:
|
|
49
49
|
- ".codeclimate.yml"
|
|
50
|
+
- ".github/workflows/codeql-analysis.yml"
|
|
50
51
|
- ".gitignore"
|
|
51
52
|
- ".hound.yml"
|
|
52
53
|
- ".rspec"
|
|
@@ -71,13 +72,14 @@ files:
|
|
|
71
72
|
- lib/url_canonicalize/response.rb
|
|
72
73
|
- lib/url_canonicalize/uri.rb
|
|
73
74
|
- lib/url_canonicalize/version.rb
|
|
75
|
+
- renovate.json
|
|
74
76
|
- url_canonicalize.gemspec
|
|
75
77
|
homepage: https://github.com/dominicsayers/url_canonicalize
|
|
76
78
|
licenses:
|
|
77
79
|
- MIT
|
|
78
80
|
metadata:
|
|
79
81
|
rubygems_mfa_required: 'true'
|
|
80
|
-
post_install_message:
|
|
82
|
+
post_install_message:
|
|
81
83
|
rdoc_options: []
|
|
82
84
|
require_paths:
|
|
83
85
|
- lib
|
|
@@ -85,15 +87,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
85
87
|
requirements:
|
|
86
88
|
- - ">="
|
|
87
89
|
- !ruby/object:Gem::Version
|
|
88
|
-
version:
|
|
90
|
+
version: 3.1.0
|
|
89
91
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
90
92
|
requirements:
|
|
91
93
|
- - ">="
|
|
92
94
|
- !ruby/object:Gem::Version
|
|
93
95
|
version: '0'
|
|
94
96
|
requirements: []
|
|
95
|
-
rubygems_version: 3.
|
|
96
|
-
signing_key:
|
|
97
|
+
rubygems_version: 3.4.6
|
|
98
|
+
signing_key:
|
|
97
99
|
specification_version: 4
|
|
98
100
|
summary: Finds the canonical version of a URL
|
|
99
101
|
test_files: []
|