searchlink 2.3.63 → 2.3.64
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/searchlink/curl/html.rb +3 -4
- data/lib/searchlink/version.rb +10 -5
- data/lib/tokens.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c19b349c222ba84795f47cc03fc5039efb3ea3f0c7ae305ad1e125c2763d33e3
|
4
|
+
data.tar.gz: 7be23e30bcee8c3dd2dbffe05dc06c345ffa7d65f64b20cf10e33b6a57f1b6fe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e27d21134df20d7b7721375899a62fedcd0fa0f9ac7378a2c3bf8e54dbd1f302bdc899b4d1edc89e25d2652229a980639ffe8a906e687848fbbdd60ca5129771
|
7
|
+
data.tar.gz: fd1f793c0031421d5525c78ae7b173119eb45b203ca7966db09e3991d420ab078f81a92c51280cd369a1fe5ee66a75c77df2bb4f99c9c1eeb73fc2e5c65ccbf8
|
data/lib/searchlink/curl/html.rb
CHANGED
@@ -107,6 +107,7 @@ module Curl
|
|
107
107
|
## @param tag The tag
|
108
108
|
## @param source [Boolean] Return full tag instead of contents
|
109
109
|
##
|
110
|
+
## @return [Array] array of tag matches/contents
|
110
111
|
def extract_tag_contents(tag, source: false)
|
111
112
|
return @body.scan(%r{<#{tag}.*?>(?:.*?</#{tag}>)?}) if source
|
112
113
|
|
@@ -452,13 +453,11 @@ module Curl
|
|
452
453
|
end
|
453
454
|
|
454
455
|
# look for a charset in a content-encoding header
|
455
|
-
if content_type
|
456
|
-
encoding ||= content_type[/charset=["']?(.*?)($|["';\s])/i, 1]
|
457
|
-
end
|
456
|
+
encoding ||= content_type[/charset=["']?(.*?)($|["';\s])/i, 1] if content_type
|
458
457
|
|
459
458
|
# look for a charset in a meta tag in the first 1024 bytes
|
460
459
|
unless encoding
|
461
|
-
data = body[0..1023].gsub(/<!--.*?(-->|\Z)/m,
|
460
|
+
data = body[0..1023].gsub(/<!--.*?(-->|\Z)/m, '')
|
462
461
|
data.scan(/<meta.*?>/im).each do |meta|
|
463
462
|
encoding ||= meta[/charset=["']?([^>]*?)($|["'\s>])/im, 1]
|
464
463
|
end
|
data/lib/searchlink/version.rb
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
module SL
|
2
|
-
VERSION = '2.3.
|
2
|
+
VERSION = '2.3.64'
|
3
3
|
end
|
4
4
|
|
5
5
|
module SL
|
6
6
|
class << self
|
7
7
|
def version_check
|
8
|
-
cachefile = File.expand_path('~/.
|
8
|
+
cachefile = File.expand_path('~/.config/cache/update.txt')
|
9
9
|
if File.exist?(cachefile)
|
10
10
|
last_check, latest_tag = IO.read(cachefile).strip.split(/\|/)
|
11
11
|
last_time = Time.parse(last_check)
|
@@ -22,12 +22,12 @@ module SL
|
|
22
22
|
latest_tag ||= SL::VERSION
|
23
23
|
latest = SemVer.new(latest_tag)
|
24
24
|
current = SemVer.new(SL::VERSION)
|
25
|
-
|
25
|
+
|
26
26
|
File.open(cachefile, 'w') { |f| f.puts("#{last_time.strftime('%c')}|#{latest.to_s}") }
|
27
27
|
|
28
|
-
return "SearchLink v#{current
|
28
|
+
return "SearchLink v#{current}, #{latest} available. Run 'update' to download." if latest_tag && current.older_than(latest)
|
29
29
|
|
30
|
-
"SearchLink v#{current
|
30
|
+
"SearchLink v#{current}"
|
31
31
|
end
|
32
32
|
|
33
33
|
# Check for a newer version than local copy using GitHub release tag
|
@@ -63,6 +63,11 @@ module SL
|
|
63
63
|
end
|
64
64
|
|
65
65
|
def update_searchlink
|
66
|
+
if %x{uname}.strip !~ /Darwin/
|
67
|
+
add_output('Auto updating only available on macOS')
|
68
|
+
return
|
69
|
+
end
|
70
|
+
|
66
71
|
new_version = SL.new_version?
|
67
72
|
if new_version
|
68
73
|
folder = File.expand_path('~/Downloads')
|
data/lib/tokens.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: searchlink
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.3.
|
4
|
+
version: 2.3.64
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brett Terpstra
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-01-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|