gemini_cache 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/gemini_cache.rb +6 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 276c3ca26a6767aad15542bae697d58b6f6c546827c668bc922632d391ea0598
|
4
|
+
data.tar.gz: 672b16527768229e7d84819b7d2b2844c41fe57c57e1bf1171414c182e8cc101
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 69700db12b8f6c8e78e3a3577843bc01f6fda112aec173653419c0674dd91baa59aee0a03be37eda62d9f1cf07e8a3892c47f28ec29d7a539d29b0d984988e3e
|
7
|
+
data.tar.gz: 6992ec6e1537b00dc69de4afe0f13457a75758d6327f8c2bafecd9fb868e833d26a499363649e78e08ba9ac680641453fd572aaa52e4075ebac16885897e57a8
|
data/lib/gemini_cache.rb
CHANGED
@@ -146,5 +146,10 @@ module GeminiCache
|
|
146
146
|
|
147
147
|
def self.read_local_file(file_path) = Base64.strict_encode64(File.read(file_path))
|
148
148
|
def self.read_remote_file(file_url) = Base64.strict_encode64(URI.open(file_url).read)
|
149
|
-
|
149
|
+
|
150
|
+
def self.read_nokogiri_html(url, default_remover: true)
|
151
|
+
doc = Nokogiri::HTML(URI.open(url))
|
152
|
+
%w[script style].each { |element| doc.css(element).each(&:remove) } if default_remover
|
153
|
+
doc
|
154
|
+
end
|
150
155
|
end
|