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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/gemini_cache.rb +6 -1
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: db225c3f8c93563f2bd4f1c8bd4fec3df644609ca9268bb7eeec996f42eaf48b
4
- data.tar.gz: bb4f2198799740b227c16621396475f171b89806aae3f9644631651c22dfc049
3
+ metadata.gz: 276c3ca26a6767aad15542bae697d58b6f6c546827c668bc922632d391ea0598
4
+ data.tar.gz: 672b16527768229e7d84819b7d2b2844c41fe57c57e1bf1171414c182e8cc101
5
5
  SHA512:
6
- metadata.gz: d5f925f85d3c1bbe71b1b2c44febdce091ca508db753c26bc543613c81fffdefc2a4636f7bdb7ac06152f25d759bb805d6279e4a74d1bcf9452d18e7d0889f5c
7
- data.tar.gz: 228a2728324e5d10210ec3c9691c1ce505cd3b13fa4914ba889bb6348dc24c43ddcf35c6c8821af6c583a3f0893a7d1467ce521bbf8bbec33454cd631e6fc420
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
- def self.read_nokogiri_html(url) = Nokogiri::HTML(URI.open(url))
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gemini_cache
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gedean Dias