nokogiri-html-ext 0.4.2 → 1.1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a1e8ccc895065ee004f1a9af49239a904bd8502c3ab04de7d3847c3853e00fc7
4
- data.tar.gz: a3dad0ed90b2c1e9c21495fb8bf5c5a1657347141fb314c8c8c74c63d5a897ca
3
+ metadata.gz: 9b8892736803e577e871a87e8d2e51ba8c061b8a7ae3be4e4d991587ba460cef
4
+ data.tar.gz: 2016820adf0b31271ef8da9351db33d5a158599c1c9cf5aa5712fc611ad52cf6
5
5
  SHA512:
6
- metadata.gz: 67f1cdaa630087d202ac0cd4b524a4f125755cac8f727dcece8d8a13b8d352b4ee100a0fa4e045b1da87ef5a709e147410b34a2bb7aebbb7d152357536837324
7
- data.tar.gz: bb27e089de5d905bafb9f4f8c129a474686b487585fd745c094abe0d623e8499748af76cc7bb63a669b207aad2b71fd51e4695cb81eb1cab38e0c1fb259c20e9
6
+ metadata.gz: 8ee0db07a2cbd705d4361891d574ca569f4020dfb89a748305e595cdcf09ddbb37797686db4406767e42345ac918c91c7426e994dd95b7e8718ec26334e11fe3
7
+ data.tar.gz: e730cac3f1271240ae3afc8c7af1b0a5773c103c909a66826cf9117660c86bd5bd7180ba82c7e3ea25c7b828a7c1817ae30405e5d12f19624c31eefa9b828ff5
data/CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # Changelog
2
2
 
3
+ > [!NOTE]
4
+ > From v1.0.0, changes are documented using [Codeberg Releases](https://codeberg.org/jgarber/nokogiri-html-ext/releases). For a given release, metadata on RubyGems.org will link to that version's Release page.
5
+
3
6
  ## 0.4.2 / 2023-12-30
4
7
 
5
8
  - Add `source_code_uri` to metadata (fd29f7c)
data/README.md CHANGED
@@ -4,7 +4,6 @@
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/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
7
 
9
8
  ## Key features
10
9
 
@@ -16,7 +15,7 @@
16
15
 
17
16
  Before installing and using nokogiri-html-ext, you'll want to have [Ruby](https://www.ruby-lang.org) 2.7 (or newer) installed. Using 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) is recommended.
18
17
 
19
- nokogiri-html-ext is developed using Ruby 2.7.8 and is tested against additional Ruby versions using [GitHub Actions](https://github.com/jgarber623/nokogiri-html-ext/actions).
18
+ nokogiri-html-ext is developed using Ruby 2.7.8 and is tested against additional Ruby versions using [Forgejo Actions](https://codeberg.org/jgarber/nokogiri-html-ext/actions).
20
19
 
21
20
  ## Installation
22
21
 
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative "html_ext/version"
3
+ require "nokogiri"
4
+ require "uri"
4
5
 
5
6
  require_relative "html_ext/document"
@@ -1,7 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "nokogiri"
4
-
5
3
  module Nokogiri
6
4
  module HTML4
7
5
  class Document < Nokogiri::XML::Document
@@ -11,7 +9,7 @@ module Nokogiri
11
9
  # @see https://html.spec.whatwg.org/#attributes-3
12
10
  IMAGE_CANDIDATE_STRINGS_ATTRIBUTES_MAP = {
13
11
  "imagesrcset" => ["link"],
14
- "srcset" => ["img", "source"]
12
+ "srcset" => ["img", "source"],
15
13
  }.freeze
16
14
 
17
15
  private_constant :IMAGE_CANDIDATE_STRINGS_ATTRIBUTES_MAP
@@ -27,7 +25,7 @@ module Nokogiri
27
25
  "href" => ["a", "area", "base", "link"],
28
26
  "ping" => ["a", "area"],
29
27
  "poster" => ["video"],
30
- "src" => ["audio", "embed", "iframe", "img", "input", "script", "source", "track", "video"]
28
+ "src" => ["audio", "embed", "iframe", "img", "input", "script", "source", "track", "video"],
31
29
  }.freeze
32
30
 
33
31
  private_constant :URL_ATTRIBUTES_MAP
@@ -50,17 +48,11 @@ module Nokogiri
50
48
  #
51
49
  # @return [String]
52
50
  def base_href=(url)
53
- url_str = url.to_s
51
+ base = at_xpath("//base") || XML::Node.new("base", self)
54
52
 
55
- if (base = at_xpath("//base"))
56
- base["href"] = url_str
57
- url_str
58
- else
59
- base = XML::Node.new("base", self)
60
- base["href"] = url_str
53
+ set_metadata_element(base)
61
54
 
62
- set_metadata_element(base)
63
- end
55
+ base["href"] = url.to_s
64
56
  end
65
57
 
66
58
  # Convert a relative URL to an absolute URL.
@@ -122,7 +114,7 @@ module Nokogiri
122
114
  end
123
115
 
124
116
  def uri_parser
125
- @uri_parser ||= URI::DEFAULT_PARSER
117
+ @uri_parser ||= URI::RFC2396_PARSER
126
118
  end
127
119
  end
128
120
  end
@@ -1,18 +1,16 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative "lib/nokogiri/html_ext/version"
4
-
5
3
  Gem::Specification.new do |spec|
6
- spec.required_ruby_version = ">= 2.7"
4
+ spec.required_ruby_version = ">= 3.1"
7
5
 
8
6
  spec.name = "nokogiri-html-ext"
9
- spec.version = Nokogiri::HTMLExt::VERSION
7
+ spec.version = "1.1.0"
10
8
  spec.authors = ["Jason Garber"]
11
9
  spec.email = ["jason@sixtwothree.org"]
12
10
 
13
11
  spec.summary = "Extend Nokogiri with several useful HTML-centric features."
14
12
  spec.description = spec.summary
15
- spec.homepage = "https://github.com/jgarber623/nokogiri-html-ext"
13
+ spec.homepage = "https://codeberg.org/jgarber/nokogiri-html-ext"
16
14
  spec.license = "MIT"
17
15
 
18
16
  spec.files = Dir["lib/**/*"].reject { |f| File.directory?(f) }
@@ -23,10 +21,10 @@ Gem::Specification.new do |spec|
23
21
 
24
22
  spec.metadata = {
25
23
  "bug_tracker_uri" => "#{spec.homepage}/issues",
26
- "changelog_uri" => "#{spec.homepage}/blob/v#{spec.version}/CHANGELOG.md",
24
+ "changelog_uri" => "#{spec.homepage}/releases/tag/v#{spec.version}",
27
25
  "rubygems_mfa_required" => "true",
28
- "source_code_uri" => "#{spec.homepage}/tree/v#{spec.version}"
26
+ "source_code_uri" => "#{spec.homepage}/src/tag/v#{spec.version}",
29
27
  }
30
28
 
31
- spec.add_runtime_dependency "nokogiri", ">= 1.14"
29
+ spec.add_dependency "nokogiri", "~> 1.18"
32
30
  end
metadata CHANGED
@@ -1,29 +1,28 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nokogiri-html-ext
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jason Garber
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2023-12-30 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: nokogiri
15
14
  requirement: !ruby/object:Gem::Requirement
16
15
  requirements:
17
- - - ">="
16
+ - - "~>"
18
17
  - !ruby/object:Gem::Version
19
- version: '1.14'
18
+ version: '1.18'
20
19
  type: :runtime
21
20
  prerelease: false
22
21
  version_requirements: !ruby/object:Gem::Requirement
23
22
  requirements:
24
- - - ">="
23
+ - - "~>"
25
24
  - !ruby/object:Gem::Version
26
- version: '1.14'
25
+ version: '1.18'
27
26
  description: Extend Nokogiri with several useful HTML-centric features.
28
27
  email:
29
28
  - jason@sixtwothree.org
@@ -36,17 +35,15 @@ files:
36
35
  - README.md
37
36
  - lib/nokogiri/html-ext.rb
38
37
  - lib/nokogiri/html_ext/document.rb
39
- - lib/nokogiri/html_ext/version.rb
40
38
  - nokogiri-html-ext.gemspec
41
- homepage: https://github.com/jgarber623/nokogiri-html-ext
39
+ homepage: https://codeberg.org/jgarber/nokogiri-html-ext
42
40
  licenses:
43
41
  - MIT
44
42
  metadata:
45
- bug_tracker_uri: https://github.com/jgarber623/nokogiri-html-ext/issues
46
- changelog_uri: https://github.com/jgarber623/nokogiri-html-ext/blob/v0.4.2/CHANGELOG.md
43
+ bug_tracker_uri: https://codeberg.org/jgarber/nokogiri-html-ext/issues
44
+ changelog_uri: https://codeberg.org/jgarber/nokogiri-html-ext/releases/tag/v1.1.0
47
45
  rubygems_mfa_required: 'true'
48
- source_code_uri: https://github.com/jgarber623/nokogiri-html-ext/tree/v0.4.2
49
- post_install_message:
46
+ source_code_uri: https://codeberg.org/jgarber/nokogiri-html-ext/src/tag/v1.1.0
50
47
  rdoc_options: []
51
48
  require_paths:
52
49
  - lib
@@ -54,15 +51,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
54
51
  requirements:
55
52
  - - ">="
56
53
  - !ruby/object:Gem::Version
57
- version: '2.7'
54
+ version: '3.1'
58
55
  required_rubygems_version: !ruby/object:Gem::Requirement
59
56
  requirements:
60
57
  - - ">="
61
58
  - !ruby/object:Gem::Version
62
59
  version: '0'
63
60
  requirements: []
64
- rubygems_version: 3.1.6
65
- signing_key:
61
+ rubygems_version: 3.6.8
66
62
  specification_version: 4
67
63
  summary: Extend Nokogiri with several useful HTML-centric features.
68
64
  test_files: []
@@ -1,7 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Nokogiri
4
- module HTMLExt
5
- VERSION = "0.4.2"
6
- end
7
- end