url_canonicalize 1.0.0 → 2.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/CHANGELOG.md +148 -113
- data/README.md +234 -9
- data/SECURITY.md +25 -0
- data/lib/url_canonicalize/bounded_body.rb +23 -0
- data/lib/url_canonicalize/client.rb +21 -0
- data/lib/{monkey_patches/addressable/uri.rb → url_canonicalize/core_ext/addressable.rb} +4 -2
- data/lib/{monkey_patches → url_canonicalize/core_ext}/string.rb +2 -2
- data/lib/{monkey_patches → url_canonicalize/core_ext}/uri.rb +4 -2
- data/lib/url_canonicalize/core_ext.rb +6 -0
- data/lib/url_canonicalize/destination.rb +120 -0
- data/lib/url_canonicalize/exception.rb +3 -0
- data/lib/url_canonicalize/http.rb +86 -63
- data/lib/url_canonicalize/link_header.rb +34 -0
- data/lib/url_canonicalize/media_type.rb +23 -0
- data/lib/url_canonicalize/options.rb +112 -0
- data/lib/url_canonicalize/request.rb +86 -77
- data/lib/url_canonicalize/response.rb +7 -4
- data/lib/url_canonicalize/result.rb +28 -0
- data/lib/url_canonicalize/transport.rb +47 -0
- data/lib/url_canonicalize/uri.rb +26 -13
- data/lib/url_canonicalize/version.rb +1 -1
- data/lib/url_canonicalize.rb +13 -9
- metadata +22 -25
- data/.codeclimate.yml +0 -25
- data/.github/workflows/codeql-analysis.yml +0 -70
- data/.gitignore +0 -53
- data/.hound.yml +0 -4
- data/.rspec +0 -5
- data/.rubocop.yml +0 -61
- data/.ruby-gemset +0 -1
- data/.travis.yml +0 -8
- data/Gemfile +0 -22
- data/Gemfile.lock +0 -110
- data/Guardfile +0 -18
- data/Rakefile +0 -3
- data/circle.yml +0 -29
- data/renovate.json +0 -6
- data/url_canonicalize.gemspec +0 -29
data/.gitignore
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
*.local
|
|
2
|
-
*.gem
|
|
3
|
-
*.rbc
|
|
4
|
-
/.config
|
|
5
|
-
/coverage/
|
|
6
|
-
/InstalledFiles
|
|
7
|
-
/pkg/
|
|
8
|
-
/spec/reports/
|
|
9
|
-
/spec/examples.txt
|
|
10
|
-
/test/tmp/
|
|
11
|
-
/test/version_tmp/
|
|
12
|
-
/tmp/
|
|
13
|
-
|
|
14
|
-
# Used by dotenv library to load environment variables.
|
|
15
|
-
# .env
|
|
16
|
-
|
|
17
|
-
## Specific to RubyMotion:
|
|
18
|
-
.dat*
|
|
19
|
-
.repl_history
|
|
20
|
-
build/
|
|
21
|
-
*.bridgesupport
|
|
22
|
-
build-iPhoneOS/
|
|
23
|
-
build-iPhoneSimulator/
|
|
24
|
-
|
|
25
|
-
## Specific to RubyMotion (use of CocoaPods):
|
|
26
|
-
#
|
|
27
|
-
# We recommend against adding the Pods directory to your .gitignore. However
|
|
28
|
-
# you should judge for yourself, the pros and cons are mentioned at:
|
|
29
|
-
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
|
|
30
|
-
#
|
|
31
|
-
# vendor/Pods/
|
|
32
|
-
|
|
33
|
-
## Documentation cache and generated files:
|
|
34
|
-
/.yardoc/
|
|
35
|
-
/_yardoc/
|
|
36
|
-
/doc/
|
|
37
|
-
/rdoc/
|
|
38
|
-
|
|
39
|
-
## Environment normalization:
|
|
40
|
-
/.bundle/
|
|
41
|
-
/vendor/bundle
|
|
42
|
-
/lib/bundler/man/
|
|
43
|
-
|
|
44
|
-
# for a library or gem, you might want to ignore these files since the code is
|
|
45
|
-
# intended to run in multiple environments; otherwise, check them in:
|
|
46
|
-
# Gemfile.lock
|
|
47
|
-
.ruby-version
|
|
48
|
-
.ruby-gemset
|
|
49
|
-
|
|
50
|
-
# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
|
|
51
|
-
.rvmrc
|
|
52
|
-
|
|
53
|
-
.vscode/
|
data/.hound.yml
DELETED
data/.rspec
DELETED
data/.rubocop.yml
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
AllCops:
|
|
3
|
-
DisplayStyleGuide: true
|
|
4
|
-
DisplayCopNames: true
|
|
5
|
-
TargetRubyVersion: 3.1
|
|
6
|
-
NewCops: enable
|
|
7
|
-
|
|
8
|
-
Layout/DotPosition:
|
|
9
|
-
Description: 'Checks the position of the dot in multi-line method calls.'
|
|
10
|
-
EnforcedStyle: leading
|
|
11
|
-
Enabled: true
|
|
12
|
-
|
|
13
|
-
Layout/ExtraSpacing:
|
|
14
|
-
Description: 'Do not use unnecessary spacing.'
|
|
15
|
-
Enabled: true
|
|
16
|
-
|
|
17
|
-
Layout/LineLength:
|
|
18
|
-
Max: 120
|
|
19
|
-
Exclude:
|
|
20
|
-
- spec/**/*
|
|
21
|
-
|
|
22
|
-
Lint/LiteralInInterpolation:
|
|
23
|
-
Description: 'Avoid interpolating literals in strings'
|
|
24
|
-
AutoCorrect: true
|
|
25
|
-
|
|
26
|
-
Metrics/BlockLength:
|
|
27
|
-
Exclude:
|
|
28
|
-
- spec/**/*
|
|
29
|
-
|
|
30
|
-
Metrics/ClassLength:
|
|
31
|
-
CountComments: false # count full line comments?
|
|
32
|
-
Max: 200
|
|
33
|
-
|
|
34
|
-
Metrics/MethodLength:
|
|
35
|
-
Max: 12
|
|
36
|
-
|
|
37
|
-
Naming/FileName:
|
|
38
|
-
Description: 'Use snake_case for source file names.'
|
|
39
|
-
Enabled: true
|
|
40
|
-
|
|
41
|
-
Style/ClassAndModuleChildren:
|
|
42
|
-
Description: 'Checks style of children classes and modules.'
|
|
43
|
-
EnforcedStyle: nested
|
|
44
|
-
Enabled: true
|
|
45
|
-
|
|
46
|
-
Style/Documentation:
|
|
47
|
-
Description: 'Document classes and non-namespace modules.'
|
|
48
|
-
Enabled: false
|
|
49
|
-
|
|
50
|
-
Style/StringLiterals:
|
|
51
|
-
EnforcedStyle: single_quotes
|
|
52
|
-
Enabled: true
|
|
53
|
-
|
|
54
|
-
Style/SymbolArray:
|
|
55
|
-
Description: 'Use %i or %I for arrays of symbols.'
|
|
56
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-i'
|
|
57
|
-
Enabled: false # Only available in Ruby 2.0+
|
|
58
|
-
|
|
59
|
-
Style/TrailingCommaInArguments:
|
|
60
|
-
EnforcedStyleForMultiline: no_comma
|
|
61
|
-
Enabled: true
|
data/.ruby-gemset
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
url_canonicalize
|
data/.travis.yml
DELETED
data/Gemfile
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
source 'https://rubygems.org'
|
|
4
|
-
|
|
5
|
-
gemspec
|
|
6
|
-
|
|
7
|
-
group :static_code_analysis do
|
|
8
|
-
gem 'rubocop', require: false
|
|
9
|
-
gem 'rubocop-rspec', require: false
|
|
10
|
-
end
|
|
11
|
-
|
|
12
|
-
group :test do
|
|
13
|
-
gem 'coveralls-ruby', require: false
|
|
14
|
-
gem 'rspec'
|
|
15
|
-
gem 'rspec_junit_formatter'
|
|
16
|
-
gem 'simplecov'
|
|
17
|
-
gem 'webmock'
|
|
18
|
-
end
|
|
19
|
-
|
|
20
|
-
group :build do
|
|
21
|
-
gem 'gem-release', require: false
|
|
22
|
-
end
|
data/Gemfile.lock
DELETED
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
PATH
|
|
2
|
-
remote: .
|
|
3
|
-
specs:
|
|
4
|
-
url_canonicalize (1.0.0)
|
|
5
|
-
addressable (~> 2)
|
|
6
|
-
nokogiri (>= 1.13)
|
|
7
|
-
|
|
8
|
-
GEM
|
|
9
|
-
remote: https://rubygems.org/
|
|
10
|
-
specs:
|
|
11
|
-
addressable (2.8.6)
|
|
12
|
-
public_suffix (>= 2.0.2, < 6.0)
|
|
13
|
-
ast (2.4.2)
|
|
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
|
-
crack (0.4.5)
|
|
21
|
-
rexml
|
|
22
|
-
diff-lcs (1.5.0)
|
|
23
|
-
docile (1.4.0)
|
|
24
|
-
gem-release (2.2.2)
|
|
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
|
-
racc (~> 1.4)
|
|
32
|
-
parallel (1.24.0)
|
|
33
|
-
parser (3.3.0.5)
|
|
34
|
-
ast (~> 2.4.1)
|
|
35
|
-
racc
|
|
36
|
-
public_suffix (4.0.7)
|
|
37
|
-
racc (1.6.1)
|
|
38
|
-
rainbow (3.1.1)
|
|
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)
|
|
48
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
|
49
|
-
rspec-support (~> 3.12.0)
|
|
50
|
-
rspec-mocks (3.12.6)
|
|
51
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
|
52
|
-
rspec-support (~> 3.12.0)
|
|
53
|
-
rspec-support (3.12.1)
|
|
54
|
-
rspec_junit_formatter (0.6.0)
|
|
55
|
-
rspec-core (>= 2, < 4, != 2.12.0)
|
|
56
|
-
rubocop (1.60.2)
|
|
57
|
-
json (~> 2.3)
|
|
58
|
-
language_server-protocol (>= 3.17.0)
|
|
59
|
-
parallel (~> 1.10)
|
|
60
|
-
parser (>= 3.3.0.2)
|
|
61
|
-
rainbow (>= 2.2.2, < 4.0)
|
|
62
|
-
regexp_parser (>= 1.8, < 3.0)
|
|
63
|
-
rexml (>= 3.2.5, < 4.0)
|
|
64
|
-
rubocop-ast (>= 1.30.0, < 2.0)
|
|
65
|
-
ruby-progressbar (~> 1.7)
|
|
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)
|
|
79
|
-
docile (~> 1.1)
|
|
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)
|
|
91
|
-
addressable (>= 2.8.0)
|
|
92
|
-
crack (>= 0.3.2)
|
|
93
|
-
hashdiff (>= 0.4.0, < 2.0.0)
|
|
94
|
-
|
|
95
|
-
PLATFORMS
|
|
96
|
-
x86_64-linux
|
|
97
|
-
|
|
98
|
-
DEPENDENCIES
|
|
99
|
-
coveralls-ruby
|
|
100
|
-
gem-release
|
|
101
|
-
rspec
|
|
102
|
-
rspec_junit_formatter
|
|
103
|
-
rubocop
|
|
104
|
-
rubocop-rspec
|
|
105
|
-
simplecov
|
|
106
|
-
url_canonicalize!
|
|
107
|
-
webmock
|
|
108
|
-
|
|
109
|
-
BUNDLED WITH
|
|
110
|
-
2.5.5
|
data/Guardfile
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
guard :rubocop do
|
|
4
|
-
watch(/.+\.rb$/)
|
|
5
|
-
watch(%r{(?:.+/)?\.rubocop\.yml$}) { |m| File.dirname(m[0]) }
|
|
6
|
-
end
|
|
7
|
-
|
|
8
|
-
guard(
|
|
9
|
-
:rspec,
|
|
10
|
-
all_after_pass: false,
|
|
11
|
-
all_on_start: false,
|
|
12
|
-
cmd: 'NO_SIMPLECOV=true bundle exec rspec --fail-fast --format documentation'
|
|
13
|
-
) do
|
|
14
|
-
watch(%r{spec/.+_spec\.rb$})
|
|
15
|
-
watch(%r{lib/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
|
|
16
|
-
watch('spec/spec_helper.rb') { 'spec' }
|
|
17
|
-
watch(%r{^spec/support/.+\.rb$}) { 'spec' }
|
|
18
|
-
end
|
data/Rakefile
DELETED
data/circle.yml
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
version: 2.1
|
|
2
|
-
orbs:
|
|
3
|
-
ruby: circleci/ruby@1.1
|
|
4
|
-
jobs:
|
|
5
|
-
check_and_test:
|
|
6
|
-
parameters:
|
|
7
|
-
ruby-version:
|
|
8
|
-
type: string
|
|
9
|
-
docker:
|
|
10
|
-
- image: cimg/ruby:<< parameters.ruby-version >>
|
|
11
|
-
parallelism: 3
|
|
12
|
-
steps:
|
|
13
|
-
- checkout
|
|
14
|
-
- ruby/install-deps
|
|
15
|
-
- run:
|
|
16
|
-
name: Run static code analysis
|
|
17
|
-
command: bundle exec rubocop
|
|
18
|
-
- run:
|
|
19
|
-
name: Run tests
|
|
20
|
-
command: bundle exec rspec
|
|
21
|
-
workflows:
|
|
22
|
-
version: 2
|
|
23
|
-
test:
|
|
24
|
-
jobs:
|
|
25
|
-
- check_and_test:
|
|
26
|
-
# cribbed from http://mikebian.co/running-tests-against-multiple-ruby-versions-using-circleci/
|
|
27
|
-
matrix:
|
|
28
|
-
parameters:
|
|
29
|
-
ruby-version: ["3.1", "3.2", "3.3"]
|
data/renovate.json
DELETED
data/url_canonicalize.gemspec
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
lib = File.expand_path('lib', __dir__)
|
|
4
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
5
|
-
require 'url_canonicalize/version'
|
|
6
|
-
|
|
7
|
-
Gem::Specification.new do |s|
|
|
8
|
-
s.name = 'url_canonicalize'
|
|
9
|
-
s.version = URLCanonicalize::VERSION
|
|
10
|
-
s.authors = ['Dominic Sayers']
|
|
11
|
-
s.email = ['dominic@sayers.cc']
|
|
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' \
|
|
15
|
-
', URI::HTTPS and Addressable::URI classes'
|
|
16
|
-
s.homepage = 'https://github.com/dominicsayers/url_canonicalize'
|
|
17
|
-
s.license = 'MIT'
|
|
18
|
-
|
|
19
|
-
s.required_ruby_version = '>= 3.1.0'
|
|
20
|
-
|
|
21
|
-
s.files = `git ls-files`.split($RS).grep_v(%r{^spec/})
|
|
22
|
-
|
|
23
|
-
s.executables = s.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
|
24
|
-
s.require_paths = ['lib']
|
|
25
|
-
|
|
26
|
-
s.add_runtime_dependency 'addressable', '~> 2' # To normalize URLs
|
|
27
|
-
s.add_runtime_dependency 'nokogiri', '>= 1.13' # To look for <link rel="canonical" ...> in HTML
|
|
28
|
-
s.metadata['rubygems_mfa_required'] = 'true'
|
|
29
|
-
end
|