nokolexbor 0.6.0-arm64-darwin → 0.6.1-arm64-darwin

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: 241b0e0f45220dcdbb96f8ee9e678b9544c3ee65cbcb8ead4f95bbe5139b7ad0
4
- data.tar.gz: 9f93b9bc02057469e7e97459bf3cba1bb980d0f6cb02bfa5578ea822c3c6dc6b
3
+ metadata.gz: 61e67ac08d02ec6b9ae9deb10775842d21de8b37ab8cf371add847cdd3dabbf5
4
+ data.tar.gz: 88beb8ac75baa6e1722f6c94daa1ce77473844fed14dd24f48c85db963cefb55
5
5
  SHA512:
6
- metadata.gz: be4add95683fca2f63a86da515d6616ceeb140773d56c690337f2b775968c4b9217ff301f4fd6c8709996e199928f63feead75816a5e8e598f59dfd8849fd3f6
7
- data.tar.gz: b8f0246cbb5b81709ae2bb58d81e84acc5d005a76c2f42b15028dadfc69682238483544c2d413ff8f2d1eac7d9ccd28114befe8f2a8f6b6fef048ab1ec153caa
6
+ metadata.gz: dc2270f086a1228b72ba4af37ef27caa974de256b2c4e404549f8688b315972fed78b55a729848e41d0ce454659611ca4c15722915b86095c96b17268f7d487e
7
+ data.tar.gz: 3d987a6ddfc7431f78588909408720c0530961d8e6af56757e1b4e3b8558c004d354c66603c532bfabdfd4c7f253de24fab0d035ba5b827736c2effe6486a574
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -141,6 +141,26 @@ module Nokolexbor
141
141
  end
142
142
  end
143
143
 
144
+ # Parse HTML into a {Document}.
145
+ #
146
+ # @param string_or_io [String, #read]
147
+ # The HTML to be parsed. It may be a String, or any object that
148
+ # responds to #read such as an IO, or StringIO.
149
+ #
150
+ # @return [Document]
151
+ def self.parse(string_or_io)
152
+ html = string_or_io
153
+ if string_or_io.respond_to?(:read)
154
+ html = string_or_io.read
155
+ end
156
+
157
+ if html.respond_to?(:encoding) && html.encoding != Encoding::UTF_8
158
+ html = html.encode(Encoding::UTF_8, invalid: :replace, undef: :replace)
159
+ end
160
+
161
+ parse_native(html)
162
+ end
163
+
144
164
  private
145
165
 
146
166
  IMPLIED_XPATH_CONTEXTS = ["//"].freeze # :nodoc:
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Nokolexbor
4
- VERSION = '0.6.0'
4
+ VERSION = '0.6.1'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nokolexbor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.6.1
5
5
  platform: arm64-darwin
6
6
  authors:
7
7
  - Yicheng Zhou
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-12-31 00:00:00.000000000 Z
11
+ date: 2025-05-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake-compiler