searchlink 2.3.68 → 2.3.70
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 +4 -4
- data/lib/searchlink/exceptions.rb +29 -0
- data/lib/searchlink/number.rb +13 -0
- data/lib/searchlink/output.rb +7 -4
- data/lib/searchlink/parse.rb +221 -197
- data/lib/searchlink/script_plugin.rb +84 -0
- data/lib/searchlink/searches/duckduckgo.rb +3 -3
- data/lib/searchlink/searches/google.rb +2 -2
- data/lib/searchlink/searches/helpers/chromium.rb +207 -50
- data/lib/searchlink/searches/helpers/safari.rb +1 -0
- data/lib/searchlink/searches.rb +32 -7
- data/lib/searchlink/semver.rb +7 -7
- data/lib/searchlink/string.rb +8 -0
- data/lib/searchlink/version.rb +1 -1
- data/lib/searchlink.rb +10 -0
- metadata +5 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 94434b4c63f4188ca00e93ad4c2be7765b61a2fdbccd3b7e706482bf1e09b618
|
|
4
|
+
data.tar.gz: 4af48f283d1a693bed323cdbbb91121ee5b4616225d4ecef46f80302016227ff
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3fa2094dbbf341680baefae73f98aba890ace10c6f6d44198b7902c28810b9e3cc8121199b9ba26a1da0243dcf779c3f018ebaaa6f1e794456d72106fafe5ad6
|
|
7
|
+
data.tar.gz: 7a39a40fbc8e8466c3652e236eee03091b027dd83aebd481b31dcb3acaa3a53124d362887d4cbe33bc22699fadd4e7adfe40f4f40db48cb8f69754584d84ae70
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module SL
|
|
4
|
+
# Custom Semantic Versioning error
|
|
5
|
+
class VersionError < StandardError
|
|
6
|
+
def initialize(msg)
|
|
7
|
+
msg = msg ? ": #{msg}" : ''
|
|
8
|
+
puts "Versioning error#{msg}"
|
|
9
|
+
|
|
10
|
+
super()
|
|
11
|
+
|
|
12
|
+
Process.exit 1
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
# Custom plugin error
|
|
17
|
+
class PluginError < StandardError
|
|
18
|
+
def initialize(msg = nil, plugin: nil)
|
|
19
|
+
plugin = %("#{plugin}") if plugin
|
|
20
|
+
plugin ||= 'plugin'
|
|
21
|
+
msg = ": #{msg}" if msg
|
|
22
|
+
puts "Error in #{plugin}#{msg}"
|
|
23
|
+
|
|
24
|
+
super()
|
|
25
|
+
|
|
26
|
+
Process.exit 1
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
data/lib/searchlink/output.rb
CHANGED
|
@@ -62,13 +62,16 @@ module SL
|
|
|
62
62
|
|
|
63
63
|
# Posts macOS notifications
|
|
64
64
|
#
|
|
65
|
-
# @param
|
|
66
|
-
# @param
|
|
65
|
+
# @param title [String] The title of the notification
|
|
66
|
+
# @param subtitle [String] The text of the notification
|
|
67
67
|
#
|
|
68
|
-
def notify(
|
|
68
|
+
def notify(title, subtitle)
|
|
69
69
|
return unless SL.config['notifications']
|
|
70
70
|
|
|
71
|
-
|
|
71
|
+
title = title.gsub(/"/, '\\"')
|
|
72
|
+
subtitle = subtitle.gsub(/"/, '\\"')
|
|
73
|
+
|
|
74
|
+
`osascript -e 'display notification "SearchLink" with title "#{title}" subtitle "#{subtitle}"'`
|
|
72
75
|
end
|
|
73
76
|
end
|
|
74
77
|
end
|