nokogiri-html-ext 0.2.1 → 0.3.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: 63aafc92d00db444d3e8d3ec92817ef8246bd8dd7d66d7d3540d9aac2f55f96b
4
- data.tar.gz: 904f44d50a9fb46c6383abb3e902c1a4166763778c1fe469696cff96c9d1c8a6
3
+ metadata.gz: 67354c8dbf65774b9c418bc69722ba7f97c9f852913784e9227c0bc9f9a5dff7
4
+ data.tar.gz: f4ba45c896400d9dc5a8e5b84365f8b4238b456b01a4311ef962ff8353db6c8d
5
5
  SHA512:
6
- metadata.gz: 932fbeed6638155ec3033405ea43bf33f9b513e4e2b129ed62c8ef86b483e942ad894421de908e0a1077dd118383faf609b9da4c974a7a4c8a9ef2678ce3436e
7
- data.tar.gz: 073d5a3983516d0bdfd68347ec42474d5c128cef1d7cf5170340d4eea24d334b10dbe5d39acd2fd5462ea1ac3da9b79031d2731db6ea5ad2c8b2fdadcba221b3
6
+ metadata.gz: d7b8edd22d5545c56e2564e255d87ac894691541efdb6e15e284b9194ea5078ac5b3a6b0cb477900491562884c56fe6246b371c8ad8def23c6a6bea92365bc32
7
+ data.tar.gz: 6a5a6d1e19c1e1380012152b59a9a0baf68512c36a880b3810713edb98ea6830ef006ca67f03a0e15e98b813b8e23baed72d25c2a5b2b98d0d6c58460ca4e29c
data/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # Changelog
2
2
 
3
+ ## v0.3.0 / 2023-01-19
4
+
5
+ - Remove escaping/unescaping code in relative URL resolution (2de6c5b)
6
+ - Remove code-scanning-rubocop and rspec-github gems (3b3e625)
7
+ - Update development Ruby to v2.7.7 (bd328f5)
8
+
9
+ ## v0.2.2 / 2022-08-20
10
+
11
+ - Improve handling of escaped and invalid URLs (b0d6c75)
12
+
3
13
  ## v0.2.1 / 2022-08-20
4
14
 
5
15
  - Handle escaped URLs and invalid URLs (af78837)
data/CONTRIBUTING.md CHANGED
@@ -8,9 +8,9 @@ There are a couple ways you can help improve nokogiri-html-ext:
8
8
 
9
9
  ## Getting Started
10
10
 
11
- nokogiri-html-ext is developed using Ruby 2.7.6 and is additionally tested against Ruby 3.0 and 3.1 using [GitHub Actions](https://github.com/jgarber623/nokogiri-html-ext/actions).
11
+ nokogiri-html-ext is developed using Ruby 2.7.7 and is additionally tested against Ruby 3.0, 3.1, and 3.2 using [GitHub Actions](https://github.com/jgarber623/nokogiri-html-ext/actions).
12
12
 
13
- Before making changes to nokogiri-html-ext, you'll want to install Ruby 2.7.6. It's recommended that you use a Ruby version managment tool like [rbenv](https://github.com/rbenv/rbenv), [chruby](https://github.com/postmodern/chruby), or [rvm](https://github.com/rvm/rvm). Once you've installed Ruby 2.7.6 using your method of choice, install the project's gems by running:
13
+ Before making changes to nokogiri-html-ext, you'll want to install Ruby 2.7.7. It's recommended that you use a Ruby version managment tool like [rbenv](https://github.com/rbenv/rbenv), [chruby](https://github.com/postmodern/chruby), or [rvm](https://github.com/rvm/rvm). Once you've installed Ruby 2.7.7 using your method of choice, install the project's gems by running:
14
14
 
15
15
  ```sh
16
16
  bundle install
data/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  [![Gem](https://img.shields.io/gem/v/nokogiri-html-ext.svg?logo=rubygems&style=for-the-badge)](https://rubygems.org/gems/nokogiri-html-ext)
6
6
  [![Downloads](https://img.shields.io/gem/dt/nokogiri-html-ext.svg?logo=rubygems&style=for-the-badge)](https://rubygems.org/gems/nokogiri-html-ext)
7
- [![Build](https://img.shields.io/github/workflow/status/jgarber623/nokogiri-html-ext/CI?logo=github&style=for-the-badge)](https://github.com/jgarber623/nokogiri-html-ext/actions/workflows/ci.yml)
7
+ [![Build](https://img.shields.io/github/actions/workflow/status/jgarber623/nokogiri-html-ext/ci.yml?branch=main&logo=github&style=for-the-badge)](https://github.com/jgarber623/nokogiri-html-ext/actions/workflows/ci.yml)
8
8
  [![Maintainability](https://img.shields.io/codeclimate/maintainability/jgarber623/nokogiri-html-ext.svg?logo=code-climate&style=for-the-badge)](https://codeclimate.com/github/jgarber623/nokogiri-html-ext)
9
9
  [![Coverage](https://img.shields.io/codeclimate/c/jgarber623/nokogiri-html-ext.svg?logo=code-climate&style=for-the-badge)](https://codeclimate.com/github/jgarber623/nokogiri-html-ext/code)
10
10
 
@@ -18,7 +18,7 @@
18
18
 
19
19
  Before installing and using nokogiri-html-ext, you'll want to have [Ruby](https://www.ruby-lang.org) 2.7 (or newer) installed. It's recommended that you use a Ruby version managment tool like [rbenv](https://github.com/rbenv/rbenv), [chruby](https://github.com/postmodern/chruby), or [rvm](https://github.com/rvm/rvm).
20
20
 
21
- nokogiri-html-ext is developed using Ruby 2.7.6 and is additionally tested against Ruby 3.0 and 3.1 using [GitHub Actions](https://github.com/jgarber623/nokogiri-html-ext/actions).
21
+ nokogiri-html-ext is developed using Ruby 2.7.7 and is additionally tested against Ruby 3.0, 3.1, and 3.2 using [GitHub Actions](https://github.com/jgarber623/nokogiri-html-ext/actions).
22
22
 
23
23
  ## Installation
24
24
 
@@ -69,13 +69,11 @@ module Nokogiri
69
69
  #
70
70
  # @return [String]
71
71
  def resolve_relative_url(url)
72
- unescape(
73
- uri_parser.join(*[document.url.strip, base_href, unescape(url)].compact.map { |u| escape(u) })
74
- .normalize
75
- .to_s
76
- )
72
+ URI::DEFAULT_PARSER.join(*[document.url.strip, base_href, url.to_s].compact)
73
+ .normalize
74
+ .to_s
77
75
  rescue URI::InvalidComponentError, URI::InvalidURIError
78
- unescape(url)
76
+ url
79
77
  end
80
78
 
81
79
  # Convert the document's relative URLs to absolute URLs.
@@ -99,10 +97,6 @@ module Nokogiri
99
97
 
100
98
  private
101
99
 
102
- def escape(url)
103
- uri_parser.escape(url.to_s)
104
- end
105
-
106
100
  def resolve_relative_urls_for(attributes_map)
107
101
  attributes_map.each do |attribute, names|
108
102
  xpaths = names.map { |name| "//#{name}[@#{attribute}]" }
@@ -112,14 +106,6 @@ module Nokogiri
112
106
  end
113
107
  end
114
108
  end
115
-
116
- def unescape(url)
117
- uri_parser.unescape(url.to_s)
118
- end
119
-
120
- def uri_parser
121
- @uri_parser ||= URI::DEFAULT_PARSER
122
- end
123
109
  end
124
110
  end
125
111
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Nokogiri
4
4
  module HTMLExt
5
- VERSION = '0.2.1'
5
+ VERSION = '0.3.0'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nokogiri-html-ext
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jason Garber
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-08-21 00:00:00.000000000 Z
11
+ date: 2023-01-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -44,7 +44,7 @@ licenses:
44
44
  - MIT
45
45
  metadata:
46
46
  bug_tracker_uri: https://github.com/jgarber623/nokogiri-html-ext/issues
47
- changelog_uri: https://github.com/jgarber623/nokogiri-html-ext/blob/v0.2.1/CHANGELOG.md
47
+ changelog_uri: https://github.com/jgarber623/nokogiri-html-ext/blob/v0.3.0/CHANGELOG.md
48
48
  rubygems_mfa_required: 'true'
49
49
  post_install_message:
50
50
  rdoc_options: []
@@ -61,7 +61,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
61
61
  - !ruby/object:Gem::Version
62
62
  version: '0'
63
63
  requirements: []
64
- rubygems_version: 3.3.16
64
+ rubygems_version: 3.3.26
65
65
  signing_key:
66
66
  specification_version: 4
67
67
  summary: Extend Nokogiri with several useful HTML-centric features.