url_canonicalize 0.2.1 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9cc361f6fdfb5137149371de473d9188bb56a69b93b1cc1f234a1dc9d9cefd79
4
- data.tar.gz: d3074abf07ec9ff566a71b15d261fa2333ad19448788276a81f406942649da68
3
+ metadata.gz: 660347135be60bf3324f23f796121f9d82b7a8ab44924d2a03f8b1d4d5bff2cf
4
+ data.tar.gz: 0fd6bf4532334bbd631fe4b829cddac92d1780d679dbb77bff6b4a95b5475eb6
5
5
  SHA512:
6
- metadata.gz: df734b09b21540b1146a105545f6d840c29dca4cb699f290785329b752ea31bee55c014f8defcef725c93254c20586921f1822581242695a278361c90540aa91
7
- data.tar.gz: 4f07815fa2f1c140cc272999229e5f1b3c03c2639d0a9050d6f47bb1cfb6821ac73f5bf38bf14b2b497b2e9c8a227126c9e9fb68e9d642e672f4ce04fea5f158
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
@@ -49,3 +49,5 @@ build-iPhoneSimulator/
49
49
 
50
50
  # unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
51
51
  .rvmrc
52
+
53
+ .vscode/
data/.rubocop.yml CHANGED
@@ -2,7 +2,7 @@
2
2
  AllCops:
3
3
  DisplayStyleGuide: true
4
4
  DisplayCopNames: true
5
- TargetRubyVersion: 2.6
5
+ TargetRubyVersion: 3.1
6
6
  NewCops: enable
7
7
 
8
8
  Layout/DotPosition:
data/.travis.yml CHANGED
@@ -1,9 +1,8 @@
1
1
  ---
2
2
  language: ruby
3
3
  rvm:
4
- - 2.6
5
- - 2.7
6
- - 3.0
7
4
  - 3.1
5
+ - 3.2
6
+ - 3.3
8
7
  script:
9
8
  - rspec
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', '~> 0.13'
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.2.1)
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.0)
12
- public_suffix (>= 2.0.2, < 5.0)
11
+ addressable (2.8.6)
12
+ public_suffix (>= 2.0.2, < 6.0)
13
13
  ast (2.4.2)
14
- coveralls (0.7.2)
15
- multi_json (~> 1.3)
16
- rest-client (= 1.6.7)
17
- simplecov (>= 0.7)
18
- term-ansicolor (= 1.2.2)
19
- thor (= 0.18.1)
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.1)
26
- mime-types (3.4.1)
27
- mime-types-data (~> 3.2015)
28
- mime-types-data (3.2022.0105)
29
- multi_json (1.15.0)
30
- nokogiri (1.13.1-x86_64-linux)
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.21.0)
33
- parser (3.1.0.0)
32
+ parallel (1.24.0)
33
+ parser (3.3.0.5)
34
34
  ast (~> 2.4.1)
35
- public_suffix (4.0.6)
36
- racc (1.6.0)
35
+ racc
36
+ public_suffix (4.0.7)
37
+ racc (1.6.1)
37
38
  rainbow (3.1.1)
38
- regexp_parser (2.2.0)
39
- rest-client (1.6.7)
40
- mime-types (>= 1.16)
41
- rexml (3.2.5)
42
- rspec (3.10.0)
43
- rspec-core (~> 3.10.0)
44
- rspec-expectations (~> 3.10.0)
45
- rspec-mocks (~> 3.10.0)
46
- rspec-core (3.10.2)
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.10.0)
51
- rspec-mocks (3.10.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.10.0)
54
- rspec-support (3.10.3)
55
- rspec_junit_formatter (0.5.1)
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.25.0)
56
+ rubocop (1.60.2)
57
+ json (~> 2.3)
58
+ language_server-protocol (>= 3.17.0)
58
59
  parallel (~> 1.10)
59
- parser (>= 3.1.0.0)
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.15.1, < 2.0)
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 (>= 1.4.0, < 3.0)
66
- rubocop-ast (1.15.1)
67
- parser (>= 3.0.1.1)
68
- rubocop-rspec (2.8.0)
69
- rubocop (~> 1.19)
70
- ruby-progressbar (1.11.0)
71
- simplecov (0.21.2)
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
- simplecov-html (~> 0.11)
74
- simplecov_json_formatter (~> 0.1)
75
- simplecov-html (0.12.3)
76
- simplecov_json_formatter (0.1.3)
77
- term-ansicolor (1.2.2)
78
- tins (~> 0.8)
79
- thor (0.18.1)
80
- tins (0.13.2)
81
- unicode-display_width (2.1.0)
82
- webmock (3.14.0)
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 (~> 0.13)
105
+ simplecov
98
106
  url_canonicalize!
99
107
  webmock
100
108
 
101
109
  BUNDLED WITH
102
- 2.3.6
110
+ 2.5.5
data/circle.yml CHANGED
@@ -26,4 +26,4 @@ workflows:
26
26
  # cribbed from http://mikebian.co/running-tests-against-multiple-ruby-versions-using-circleci/
27
27
  matrix:
28
28
  parameters:
29
- ruby-version: ["2.6", "2.7", "3.0", "3.1"]
29
+ ruby-version: ["3.1", "3.2", "3.3"]
@@ -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 url
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 url
43
+ super(url)
44
44
  end
45
45
  end
46
46
 
@@ -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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module URLCanonicalize
4
- VERSION = '0.2.1'
4
+ VERSION = '1.0.0'
5
5
  end
data/renovate.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "$schema": "https://docs.renovatebot.com/renovate-schema.json",
3
+ "extends": [
4
+ "config:recommended"
5
+ ]
6
+ }
@@ -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 = '>= 2.6.0'
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.2.1
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: 2022-02-01 00:00:00.000000000 Z
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: 2.6.0
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.3.6
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: []