hookapp 2.0.15 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +1 -1
- data/README.md +2 -2
- data/Rakefile +4 -4
- data/hook.rdoc +1 -1
- data/html/App.html +1 -1
- data/html/GLI/Commands/MarkdownDocumentListener.html +1 -1
- data/html/Hook/PromptSTD.html +1 -1
- data/html/HookApp.html +18 -18
- data/html/README_rdoc.html +1 -1
- data/html/String.html +1 -1
- data/html/created.rid +5 -5
- data/html/index.html +2 -1
- data/html/js/search_index.js +1 -1
- data/html/js/search_index.js.gz +0 -0
- data/html/table_of_contents.html +3 -0
- data/lib/hook/hookapp.rb +16 -16
- data/lib/hook/prompt.rb +1 -1
- data/lib/hook/version.rb +1 -1
- data/lib/hook.rb +1 -0
- 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: d6f20d258c61f15b65d3520c147dbcd2e0b6998fe04e1b75d535de76e0db14bd
|
4
|
+
data.tar.gz: 57db4084be3e26d82496c8f8795aab3b821a29f48dffa9a564bc4526859c95fe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 50e203166e31e5832973dbc927788b726f2e5f2c2a99b2612221d135e68db27ed9e6eef823d1bac2beff9854b04814c35623ab589f83ec592ebc90becd216b94
|
7
|
+
data.tar.gz: e9bf80532aefc5224e86974530f500619a44b1d6a8574732251c76651563609c924d69de3058d0251b07683ed4e578e77370a1e5b2792865c04f94516cb23113
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -6,7 +6,7 @@ CLI interface for Hook.app (macOS)
|
|
6
6
|
|
7
7
|
This gem includes a `hook` binary that allows interaction with the features of Hook.app.
|
8
8
|
|
9
|
-
*v2.0
|
9
|
+
*v2.1.0*
|
10
10
|
|
11
11
|
## Installation
|
12
12
|
|
@@ -366,5 +366,5 @@ This software is licensed under the MIT License.
|
|
366
366
|
THE SOFTWARE.
|
367
367
|
|
368
368
|
|
369
|
-
Documentation generated 2022-
|
369
|
+
Documentation generated 2022-11-10 09:20
|
370
370
|
|
data/Rakefile
CHANGED
@@ -20,9 +20,9 @@ CUKE_RESULTS = 'results.html'
|
|
20
20
|
CLEAN << CUKE_RESULTS
|
21
21
|
desc 'Run features'
|
22
22
|
Cucumber::Rake::Task.new(:features) do |t|
|
23
|
-
opts = "features --format html -o #{CUKE_RESULTS} --format progress -x"
|
24
|
-
opts
|
25
|
-
t.cucumber_opts =
|
23
|
+
opts = ["features", "--format html", "-o #{CUKE_RESULTS}", "--format progress", "-x"]
|
24
|
+
opts.push("--tags #{ENV['TAGS']}") if ENV['TAGS']
|
25
|
+
t.cucumber_opts = opts
|
26
26
|
t.fork = false
|
27
27
|
end
|
28
28
|
|
@@ -30,7 +30,7 @@ desc 'Run features tagged as work-in-progress (@wip)'
|
|
30
30
|
Cucumber::Rake::Task.new('features:wip') do |t|
|
31
31
|
tag_opts = ' --tags ~@pending'
|
32
32
|
tag_opts = ' --tags @wip'
|
33
|
-
t.cucumber_opts = "features --format html -o #{CUKE_RESULTS} --format pretty -x -s#{tag_opts}"
|
33
|
+
t.cucumber_opts = ["features", "--format html", "-o #{CUKE_RESULTS}", "--format pretty", "-x", "-s#{tag_opts}"]
|
34
34
|
t.fork = false
|
35
35
|
end
|
36
36
|
|
data/hook.rdoc
CHANGED
data/html/App.html
CHANGED
data/html/Hook/PromptSTD.html
CHANGED
@@ -109,7 +109,7 @@
|
|
109
109
|
<pre><span class="ruby-comment"># File lib/hook/prompt.rb, line 8</span>
|
110
110
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">clear_screen</span>(<span class="ruby-identifier">msg</span> = <span class="ruby-keyword">nil</span>)
|
111
111
|
<span class="ruby-identifier">puts</span> <span class="ruby-string">"\e[H\e[2J"</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">$stdout</span>.<span class="ruby-identifier">tty?</span>
|
112
|
-
<span class="ruby-identifier">puts</span> <span class="ruby-identifier">msg</span> <span class="ruby-keyword">
|
112
|
+
<span class="ruby-identifier">puts</span> <span class="ruby-identifier">msg</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">msg</span>.<span class="ruby-identifier">nil?</span>
|
113
113
|
<span class="ruby-keyword">end</span></pre>
|
114
114
|
</div>
|
115
115
|
</div>
|
data/html/HookApp.html
CHANGED
@@ -61,7 +61,7 @@
|
|
61
61
|
<div id="parent-class-section" class="nav-section">
|
62
62
|
<h3>Parent</h3>
|
63
63
|
|
64
|
-
<p class="link">Object
|
64
|
+
<p class="link"><a href="Object.html">Object</a>
|
65
65
|
</div>
|
66
66
|
|
67
67
|
|
@@ -186,8 +186,8 @@
|
|
186
186
|
<div class="method-source-code" id="all_bookmarks-source">
|
187
187
|
<pre><span class="ruby-comment"># File lib/hook/hookapp.rb, line 142</span>
|
188
188
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">all_bookmarks</span>
|
189
|
-
<span class="ruby-
|
190
|
-
tell application "
|
189
|
+
<span class="ruby-node">`osascript <<'APPLESCRIPT'
|
190
|
+
tell application "#{HOOK_APP}"
|
191
191
|
set _marks to every bookmark
|
192
192
|
set _out to {}
|
193
193
|
repeat with _hook in _marks
|
@@ -224,7 +224,7 @@
|
|
224
224
|
|
225
225
|
<span class="ruby-keyword">begin</span>
|
226
226
|
<span class="ruby-identifier">mark</span> = <span class="ruby-node">`osascript <<'APPLESCRIPT'
|
227
|
-
tell application "
|
227
|
+
tell application "#{HOOK_APP}"
|
228
228
|
set _hook to make bookmark with data "#{url}"
|
229
229
|
if _hook is missing value
|
230
230
|
return ""
|
@@ -263,7 +263,7 @@
|
|
263
263
|
tell application "System Events" to set front_app to name of first application process whose frontmost is true
|
264
264
|
tell application "#{app}" to activate
|
265
265
|
delay 2
|
266
|
-
tell application "
|
266
|
+
tell application "#{HOOK_APP}"
|
267
267
|
set _hook to (bookmark from active window)
|
268
268
|
set _output to (name of _hook & "||" & address of _hook & "||" & path of _hook)
|
269
269
|
end tell
|
@@ -313,7 +313,7 @@
|
|
313
313
|
<span class="ruby-identifier">args</span> = [<span class="ruby-string">'--layout=reverse-list'</span>,
|
314
314
|
<span class="ruby-string">'--header="esc: cancel, return: browse"'</span>,
|
315
315
|
<span class="ruby-string">'--prompt=" Select file > "'</span>,
|
316
|
-
<span class="ruby-string">%(--preview='hook ls {}')</span>,
|
316
|
+
<span class="ruby-string">%(--preview='hook ls -o m {}')</span>,
|
317
317
|
<span class="ruby-string">'--height=60%'</span>,
|
318
318
|
<span class="ruby-string">'--min-height=10'</span>]
|
319
319
|
|
@@ -407,7 +407,7 @@
|
|
407
407
|
<span class="ruby-identifier">hooks</span> = <span class="ruby-identifier">get_hooks</span>(<span class="ruby-identifier">source</span>)
|
408
408
|
<span class="ruby-identifier">hooks</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">hook</span><span class="ruby-operator">|</span>
|
409
409
|
<span class="ruby-node">`osascript <<'APPLESCRIPT'
|
410
|
-
tell application "
|
410
|
+
tell application "#{HOOK_APP}"
|
411
411
|
set _mark1 to make bookmark with data "#{hook[:url]}"
|
412
412
|
set _mark2 to make bookmark with data "#{target}"
|
413
413
|
hook _mark1 and _mark2
|
@@ -465,7 +465,7 @@
|
|
465
465
|
<pre><span class="ruby-comment"># File lib/hook/hookapp.rb, line 566</span>
|
466
466
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">decode</span>(<span class="ruby-identifier">string</span>)
|
467
467
|
<span class="ruby-identifier">result</span> = <span class="ruby-node">`osascript <<'APPLESCRIPT'
|
468
|
-
tell application "
|
468
|
+
tell application "#{HOOK_APP}"
|
469
469
|
percent decode "#{string.escape_quotes}"
|
470
470
|
end tell
|
471
471
|
APPLESCRIPT`</span>.<span class="ruby-identifier">strip</span>
|
@@ -498,7 +498,7 @@ APPLESCRIPT`</span>.<span class="ruby-identifier">strip</span>
|
|
498
498
|
<span class="ruby-keyword">if</span> <span class="ruby-identifier">res</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp">/^y/i</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">force</span>
|
499
499
|
<span class="ruby-identifier">get_hooks</span>(<span class="ruby-identifier">url</span>).<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">hook</span><span class="ruby-operator">|</span>
|
500
500
|
<span class="ruby-node">`osascript <<'APPLESCRIPT'
|
501
|
-
tell application "
|
501
|
+
tell application "#{HOOK_APP}"
|
502
502
|
set _mark1 to make bookmark with data "#{hook[:url]}"
|
503
503
|
set _mark2 to make bookmark with data "#{url}"
|
504
504
|
unhook _mark1 and _mark2
|
@@ -543,7 +543,7 @@ APPLESCRIPT`</span>.<span class="ruby-identifier">strip</span>
|
|
543
543
|
<span class="ruby-identifier">source</span> = <span class="ruby-identifier">urls</span>[<span class="ruby-value">0</span>]
|
544
544
|
<span class="ruby-identifier">target</span> = <span class="ruby-identifier">urls</span>[<span class="ruby-value">1</span>]
|
545
545
|
<span class="ruby-node">`osascript <<'APPLESCRIPT'
|
546
|
-
tell application "
|
546
|
+
tell application "#{HOOK_APP}"
|
547
547
|
set _mark1 to make bookmark with data "#{source}"
|
548
548
|
set _mark2 to make bookmark with data "#{target}"
|
549
549
|
unhook _mark1 and _mark2
|
@@ -575,7 +575,7 @@ APPLESCRIPT`</span>.<span class="ruby-identifier">strip</span>
|
|
575
575
|
<pre><span class="ruby-comment"># File lib/hook/hookapp.rb, line 557</span>
|
576
576
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">encode</span>(<span class="ruby-identifier">string</span>)
|
577
577
|
<span class="ruby-identifier">result</span> = <span class="ruby-node">`osascript <<'APPLESCRIPT'
|
578
|
-
tell application "
|
578
|
+
tell application "#{HOOK_APP}"
|
579
579
|
percent encode "#{string.escape_quotes}"
|
580
580
|
end tell
|
581
581
|
APPLESCRIPT`</span>.<span class="ruby-identifier">strip</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp">/'/</span>,<span class="ruby-string">'%27'</span>)
|
@@ -627,7 +627,7 @@ APPLESCRIPT`</span>.<span class="ruby-identifier">strip</span>.<span class="ruby
|
|
627
627
|
<span class="ruby-identifier">raise</span> <span class="ruby-node">"Invalid target: #{url}"</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">url</span>
|
628
628
|
|
629
629
|
<span class="ruby-identifier">hooks</span> = <span class="ruby-node">`osascript <<'APPLESCRIPT'
|
630
|
-
tell application "
|
630
|
+
tell application "#{HOOK_APP}"
|
631
631
|
set _mark to make bookmark with data "#{url}"
|
632
632
|
if _mark is missing value
|
633
633
|
return ""
|
@@ -669,7 +669,7 @@ APPLESCRIPT`</span>.<span class="ruby-identifier">strip</span>.<span class="ruby
|
|
669
669
|
<span class="ruby-identifier">link_to</span> = <span class="ruby-identifier">args</span>.<span class="ruby-identifier">dup</span>.<span class="ruby-identifier">map</span>(<span class="ruby-operator">&</span><span class="ruby-value">:valid_hook</span>).<span class="ruby-identifier">reject</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">url</span><span class="ruby-operator">|</span> <span class="ruby-identifier">url</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">source</span> }
|
670
670
|
<span class="ruby-identifier">link_to</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">url</span><span class="ruby-operator">|</span>
|
671
671
|
<span class="ruby-node">`osascript <<'APPLESCRIPT'
|
672
|
-
tell application "
|
672
|
+
tell application "#{HOOK_APP}"
|
673
673
|
set _mark1 to make bookmark with data "#{source}"
|
674
674
|
set _mark2 to make bookmark with data "#{url}"
|
675
675
|
hook _mark1 and _mark2
|
@@ -709,7 +709,7 @@ APPLESCRIPT`</span>.<span class="ruby-identifier">strip</span>.<span class="ruby
|
|
709
709
|
|
710
710
|
<span class="ruby-identifier">puts</span> <span class="ruby-node">"Linking #{file} and #{target}..."</span>
|
711
711
|
<span class="ruby-node">`osascript <<'APPLESCRIPT'
|
712
|
-
tell application "
|
712
|
+
tell application "#{HOOK_APP}"
|
713
713
|
set _mark1 to make bookmark with data "#{file}"
|
714
714
|
set _mark2 to make bookmark with data "#{target}"
|
715
715
|
hook _mark1 and _mark2
|
@@ -802,7 +802,7 @@ APPLESCRIPT`</span>.<span class="ruby-identifier">strip</span>.<span class="ruby
|
|
802
802
|
<pre><span class="ruby-comment"># File lib/hook/hookapp.rb, line 317</span>
|
803
803
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">open_gui</span>(<span class="ruby-identifier">url</span>)
|
804
804
|
<span class="ruby-identifier">result</span> = <span class="ruby-node">`osascript <<'APPLESCRIPT'
|
805
|
-
tell application "
|
805
|
+
tell application "#{HOOK_APP}"
|
806
806
|
set _mark to make bookmark with data "#{url.valid_hook}"
|
807
807
|
if _mark is missing value
|
808
808
|
return "Failed to create bookmark for #{url}"
|
@@ -954,7 +954,7 @@ APPLESCRIPT`</span>.<span class="ruby-identifier">strip</span>.<span class="ruby
|
|
954
954
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">search_name</span>(<span class="ruby-identifier">search</span>)
|
955
955
|
<span class="ruby-node">`osascript <<'APPLESCRIPT'
|
956
956
|
set searchString to "#{search.strip}"
|
957
|
-
tell application "
|
957
|
+
tell application "#{HOOK_APP}"
|
958
958
|
set _marks to every bookmark whose name contains searchString
|
959
959
|
set _out to {}
|
960
960
|
repeat with _hook in _marks
|
@@ -988,7 +988,7 @@ APPLESCRIPT`</span>.<span class="ruby-identifier">strip</span>.<span class="ruby
|
|
988
988
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">search_path_or_address</span>(<span class="ruby-identifier">search</span>)
|
989
989
|
<span class="ruby-node">`osascript <<'APPLESCRIPT'
|
990
990
|
set searchString to "#{search.strip}"
|
991
|
-
tell application "
|
991
|
+
tell application "#{HOOK_APP}"
|
992
992
|
set _marks to every bookmark whose path contains searchString or address contains searchString
|
993
993
|
set _out to {}
|
994
994
|
repeat with _hook in _marks
|
@@ -1046,7 +1046,7 @@ APPLESCRIPT`</span>.<span class="ruby-identifier">strip</span>.<span class="ruby
|
|
1046
1046
|
<span class="ruby-keyword">elsif</span> <span class="ruby-identifier">mark</span>[<span class="ruby-value">:url</span>]
|
1047
1047
|
<span class="ruby-identifier">url</span> = <span class="ruby-constant">URI</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">mark</span>[<span class="ruby-value">:url</span>])
|
1048
1048
|
<span class="ruby-identifier">id</span> = <span class="ruby-identifier">mark</span>[<span class="ruby-value">:url</span>]
|
1049
|
-
<span class="ruby-identifier">loc</span> = <span class="ruby-node">"#{url.scheme} -
|
1049
|
+
<span class="ruby-identifier">loc</span> = <span class="ruby-node">"#{url.scheme} + ' - ' + url.hostname"</span>
|
1050
1050
|
<span class="ruby-keyword">else</span>
|
1051
1051
|
<span class="ruby-identifier">loc</span> = <span class="ruby-string">''</span>
|
1052
1052
|
<span class="ruby-keyword">end</span>
|
data/html/README_rdoc.html
CHANGED
@@ -133,7 +133,7 @@
|
|
133
133
|
|
134
134
|
<p>This gem includes a `hook` binary that allows interaction with the features of Hook.app.</p>
|
135
135
|
|
136
|
-
<p>v2.0
|
136
|
+
<p>v2.1.0</p>
|
137
137
|
|
138
138
|
<h3 id="label-Global+Options">Global Options<span><a href="#label-Global+Options">¶</a> <a href="#top">↑</a></span></h3>
|
139
139
|
|
data/html/String.html
CHANGED
data/html/created.rid
CHANGED
@@ -1,10 +1,10 @@
|
|
1
|
-
|
1
|
+
Thu, 10 Nov 2022 09:20:50 -0600
|
2
2
|
README.rdoc Tue, 07 Jul 2020 16:57:07 -0500
|
3
|
-
lib/hook.rb Thu,
|
4
|
-
lib/hook/hookapp.rb
|
3
|
+
lib/hook.rb Thu, 10 Nov 2022 09:16:41 -0600
|
4
|
+
lib/hook/hookapp.rb Thu, 10 Nov 2022 09:18:33 -0600
|
5
5
|
lib/hook/hooker.rb Sun, 31 Oct 2021 07:54:46 -0500
|
6
6
|
lib/hook/markdown_document_listener.rb Sun, 26 Sep 2021 07:45:59 -0500
|
7
|
-
lib/hook/prompt.rb
|
7
|
+
lib/hook/prompt.rb Tue, 23 Aug 2022 06:17:15 -0500
|
8
8
|
lib/hook/string.rb Sun, 31 Oct 2021 07:03:15 -0500
|
9
|
-
lib/hook/version.rb
|
9
|
+
lib/hook/version.rb Thu, 10 Nov 2022 09:19:48 -0600
|
10
10
|
bin/hook Tue, 19 Jul 2022 14:11:16 -0500
|
data/html/index.html
CHANGED
@@ -79,6 +79,7 @@
|
|
79
79
|
<li><a href="./Hook/PromptSTD.html">Hook::PromptSTD</a>
|
80
80
|
<li><a href="./HookApp.html">HookApp</a>
|
81
81
|
<li><a href="./Hooker.html">Hooker</a>
|
82
|
+
<li><a href="./Object.html">Object</a>
|
82
83
|
<li><a href="./String.html">String</a>
|
83
84
|
</ul>
|
84
85
|
</div>
|
@@ -99,7 +100,7 @@
|
|
99
100
|
|
100
101
|
<p>This gem includes a `hook` binary that allows interaction with the features of Hook.app.</p>
|
101
102
|
|
102
|
-
<p>v2.0
|
103
|
+
<p>v2.1.0</p>
|
103
104
|
|
104
105
|
<h3 id="label-Global+Options">Global Options<span><a href="#label-Global+Options">¶</a> <a href="#top">↑</a></span></h3>
|
105
106
|
|
data/html/js/search_index.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
var search_data = {"index":{"searchIndex":["app","gli","commands","doc","markdowndocumentlistener","hook","prompt","promptfzf","promptstd","hookapp","hooker","string","act_on()","all_bookmarks()","beginning()","bookmark_for()","bookmark_from_app()","browse_bookmarks()","browse_linked()","cap()","cap!()","clear_screen()","clip()","clip_bookmark()","clone_hooks()","command()","commands()","copy_bookmark()","decode()","default_command()","delete_all_hooks()","delete_hooks()","encode()","end_command()","end_commands()","end_options()","ending()","escape_quotes()","flag()","format_regex()","fzf()","get_hooks()","install_fzf()","link_all()","link_files()","linked_bookmarks()","new()","new()","nil_if_missing()","open_gui()","open_linked()","options()","output_array()","program_desc()","program_long_desc()","restore_std()","search_bookmarks()","search_name()","search_path_or_address()","select_hook()","silence_std()","split_hook()","split_hooks()","switch()","uninstall_fzf()","valid_hook()","valid_hook!()","validate_format()","version()","which_fzf()","readme"],"longSearchIndex":["app","gli","gli::commands","gli::commands::doc","gli::commands::markdowndocumentlistener","hook","hook::prompt","hook::promptfzf","hook::promptstd","hookapp","hooker","string","hookapp#act_on()","hookapp#all_bookmarks()","gli::commands::markdowndocumentlistener#beginning()","hookapp#bookmark_for()","hookapp#bookmark_from_app()","hookapp#browse_bookmarks()","hookapp#browse_linked()","string#cap()","string#cap!()","hook::promptstd#clear_screen()","string#clip()","hookapp#clip_bookmark()","hookapp#clone_hooks()","gli::commands::markdowndocumentlistener#command()","gli::commands::markdowndocumentlistener#commands()","hookapp#copy_bookmark()","hookapp#decode()","gli::commands::markdowndocumentlistener#default_command()","hookapp#delete_all_hooks()","hookapp#delete_hooks()","hookapp#encode()","gli::commands::markdowndocumentlistener#end_command()","gli::commands::markdowndocumentlistener#end_commands()","gli::commands::markdowndocumentlistener#end_options()","gli::commands::markdowndocumentlistener#ending()","string#escape_quotes()","gli::commands::markdowndocumentlistener#flag()","hookapp#format_regex()","hook::promptfzf#fzf()","hookapp#get_hooks()","hook::promptfzf#install_fzf()","hookapp#link_all()","hookapp#link_files()","hookapp#linked_bookmarks()","gli::commands::markdowndocumentlistener::new()","hooker::new()","string#nil_if_missing()","hookapp#open_gui()","hookapp#open_linked()","gli::commands::markdowndocumentlistener#options()","hookapp#output_array()","gli::commands::markdowndocumentlistener#program_desc()","gli::commands::markdowndocumentlistener#program_long_desc()","hook::promptstd#restore_std()","hookapp#search_bookmarks()","hookapp#search_name()","hookapp#search_path_or_address()","hookapp#select_hook()","hook::promptstd#silence_std()","string#split_hook()","string#split_hooks()","gli::commands::markdowndocumentlistener#switch()","hook::promptfzf#uninstall_fzf()","string#valid_hook()","string#valid_hook!()","hookapp#validate_format()","gli::commands::markdowndocumentlistener#version()","hook::promptfzf#which_fzf()",""],"info":[["App","","App.html","","<p>Main class for GLI app\n"],["GLI","","GLI.html","",""],["GLI::Commands","","GLI/Commands.html","",""],["GLI::Commands::Doc","","GLI/Commands/Doc.html","",""],["GLI::Commands::MarkdownDocumentListener","","GLI/Commands/MarkdownDocumentListener.html","","<p>DocumentListener class for GLI documentation generator\n"],["Hook","","Hook.html","",""],["Hook::Prompt","","Hook/Prompt.html","",""],["Hook::PromptFZF","","Hook/PromptFZF.html","","<p>Methods for working installing/using FuzzyFileFinder\n"],["Hook::PromptSTD","","Hook/PromptSTD.html","",""],["HookApp","","HookApp.html","","<p>Hook.app functions\n"],["Hooker","","Hooker.html","","<p>Hook.app CLI interface\n"],["String","","String.html","","<p>String helpers\n"],["act_on","HookApp","HookApp.html#method-i-act_on","(url)",""],["all_bookmarks","HookApp","HookApp.html#method-i-all_bookmarks","()","<p>Get all known bookmarks. Return array of bookmark hashes.\n"],["beginning","GLI::Commands::MarkdownDocumentListener","GLI/Commands/MarkdownDocumentListener.html#method-i-beginning","()",""],["bookmark_for","HookApp","HookApp.html#method-i-bookmark_for","(url)","<p>Get a Hook bookmark for file or URL. Return bookmark hash.\n"],["bookmark_from_app","HookApp","HookApp.html#method-i-bookmark_from_app","(app, opts)","<p>Get a bookmark from the foreground document of specified app.\n"],["browse_bookmarks","HookApp","HookApp.html#method-i-browse_bookmarks","(glob)",""],["browse_linked","HookApp","HookApp.html#method-i-browse_linked","(url)","<p>Select from a menu of available hooks and open using macOS `open`.\n"],["cap","String","String.html#method-i-cap","()","<p>Capitalize only if no uppercase\n"],["cap!","String","String.html#method-i-cap-21","()",""],["clear_screen","Hook::PromptSTD","Hook/PromptSTD.html#method-i-clear_screen","(msg = nil)","<p>Clear the terminal screen\n"],["clip","String","String.html#method-i-clip","()",""],["clip_bookmark","HookApp","HookApp.html#method-i-clip_bookmark","(url, opts)","<p>Create a bookmark for specified file/url and copy to the clipboard.\n"],["clone_hooks","HookApp","HookApp.html#method-i-clone_hooks","(args)","<p>Copy all hooks from source file to target file\n"],["command","GLI::Commands::MarkdownDocumentListener","GLI/Commands/MarkdownDocumentListener.html#method-i-command","(name, aliases, desc, long_desc, arg_name, arg_options)","<p>Gives you a command in the current context and creates a new context of this command\n"],["commands","GLI::Commands::MarkdownDocumentListener","GLI/Commands/MarkdownDocumentListener.html#method-i-commands","()",""],["copy_bookmark","HookApp","HookApp.html#method-i-copy_bookmark","(title, url, opts)","<p>Create a bookmark from specified title and url and copy to the clipboard.\n"],["decode","HookApp","HookApp.html#method-i-decode","(string)",""],["default_command","GLI::Commands::MarkdownDocumentListener","GLI/Commands/MarkdownDocumentListener.html#method-i-default_command","(name)","<p>Gives you the name of the current command in the current context\n"],["delete_all_hooks","HookApp","HookApp.html#method-i-delete_all_hooks","(url, force: false)","<p>Delete all hooked files/urls from target file\n"],["delete_hooks","HookApp","HookApp.html#method-i-delete_hooks","(args, opts)","<p>Delete hooks between two files/urls\n"],["encode","HookApp","HookApp.html#method-i-encode","(string)",""],["end_command","GLI::Commands::MarkdownDocumentListener","GLI/Commands/MarkdownDocumentListener.html#method-i-end_command","(_name)","<p>Ends a command, and “pops” you back up one context\n"],["end_commands","GLI::Commands::MarkdownDocumentListener","GLI/Commands/MarkdownDocumentListener.html#method-i-end_commands","()",""],["end_options","GLI::Commands::MarkdownDocumentListener","GLI/Commands/MarkdownDocumentListener.html#method-i-end_options","()",""],["ending","GLI::Commands::MarkdownDocumentListener","GLI/Commands/MarkdownDocumentListener.html#method-i-ending","()","<p>Called when processing has completed\n"],["escape_quotes","String","String.html#method-i-escape_quotes","()",""],["flag","GLI::Commands::MarkdownDocumentListener","GLI/Commands/MarkdownDocumentListener.html#method-i-flag","(name, aliases, desc, long_desc, default_value, arg_name, must_match, _type)","<p>Gives you a flag in the current context\n"],["format_regex","HookApp","HookApp.html#method-i-format_regex","(options)","<p>Create a single regex for validation of an array by first char or full match.\n"],["fzf","Hook::PromptFZF","Hook/PromptFZF.html#method-i-fzf","()","<p>Get path to fzf binary, installing if needed\n<p>@return [String] Path to fzf binary\n"],["get_hooks","HookApp","HookApp.html#method-i-get_hooks","(url)","<p>Get bookmarks hooked to file or URL. Return array of bookmark hashes.\n"],["install_fzf","Hook::PromptFZF","Hook/PromptFZF.html#method-i-install_fzf","(force: false)","<p>Install fzf on the current system. Installs to a subdirectory of the gem\n<p>@param force [Boolean] …\n"],["link_all","HookApp","HookApp.html#method-i-link_all","(args)","<p>Create bi-directional links between every file/url in the list of arguments\n"],["link_files","HookApp","HookApp.html#method-i-link_files","(args)","<p>Link 2 or more files/urls with bi-directional hooks.\n"],["linked_bookmarks","HookApp","HookApp.html#method-i-linked_bookmarks","(args, opts)","<p>Get a list of all hooks on a file/url.\n"],["new","GLI::Commands::MarkdownDocumentListener","GLI/Commands/MarkdownDocumentListener.html#method-c-new","(_global_options, _options, _arguments, app)",""],["new","Hooker","Hooker.html#method-c-new","()",""],["nil_if_missing","String","String.html#method-i-nil_if_missing","()",""],["open_gui","HookApp","HookApp.html#method-i-open_gui","(url)","<p>Open the Hook GUI for browsing/performing actions on a file or url\n"],["open_linked","HookApp","HookApp.html#method-i-open_linked","(url)","<p>Select from a menu of available hooks and open using macOS `open`.\n"],["options","GLI::Commands::MarkdownDocumentListener","GLI/Commands/MarkdownDocumentListener.html#method-i-options","()",""],["output_array","HookApp","HookApp.html#method-i-output_array","(hooks_arr, opts)","<p>Output an array of hooks in the given format.\n"],["program_desc","GLI::Commands::MarkdownDocumentListener","GLI/Commands/MarkdownDocumentListener.html#method-i-program_desc","(desc)","<p>Gives you the program description\n"],["program_long_desc","GLI::Commands::MarkdownDocumentListener","GLI/Commands/MarkdownDocumentListener.html#method-i-program_long_desc","(desc)",""],["restore_std","Hook::PromptSTD","Hook/PromptSTD.html#method-i-restore_std","()","<p>Restore silenced STDOUT and STDERR\n"],["search_bookmarks","HookApp","HookApp.html#method-i-search_bookmarks","(search, opts)","<p>Search bookmarks, using both names and addresses unless options contain “:names_only”. Return …\n"],["search_name","HookApp","HookApp.html#method-i-search_name","(search)","<p>Search boomark names/titles. Return array of bookmark hashes.\n"],["search_path_or_address","HookApp","HookApp.html#method-i-search_path_or_address","(search)","<p>Search bookmark paths and addresses. Return array of bookmark hashes.\n"],["select_hook","HookApp","HookApp.html#method-i-select_hook","(marks)","<p>Generate a menu of available hooks for selecting one or more hooks to operate on. Revamped to use `fzf`, …\n"],["silence_std","Hook::PromptSTD","Hook/PromptSTD.html#method-i-silence_std","(file = '/dev/null')","<p>Redirect STDOUT and STDERR to /dev/null or file\n<p>@param file [String] a file path to redirect to …\n"],["split_hook","String","String.html#method-i-split_hook","()",""],["split_hooks","String","String.html#method-i-split_hooks","()",""],["switch","GLI::Commands::MarkdownDocumentListener","GLI/Commands/MarkdownDocumentListener.html#method-i-switch","(name, aliases, desc, long_desc, negatable)","<p>Gives you a switch in the current context\n"],["uninstall_fzf","Hook::PromptFZF","Hook/PromptFZF.html#method-i-uninstall_fzf","()","<p>Remove fzf binary\n"],["valid_hook","String","String.html#method-i-valid_hook","()",""],["valid_hook!","String","String.html#method-i-valid_hook-21","()",""],["validate_format","HookApp","HookApp.html#method-i-validate_format","(fmt, options)","<p>Check if format fully matches or matches the first character of available options. Return full valid …\n"],["version","GLI::Commands::MarkdownDocumentListener","GLI/Commands/MarkdownDocumentListener.html#method-i-version","(version)","<p>Gives you the program version\n"],["which_fzf","Hook::PromptFZF","Hook/PromptFZF.html#method-i-which_fzf","()","<p>Return the path to the fzf binary\n<p>@return [String] Path to fzf\n"],["README","","README_rdoc.html","","<p>hookapp\n<p>A CLI for Hook.app on macOS.\n<p>hook - CLI interface for Hook.app (macOS)\n"]]}}
|
1
|
+
var search_data = {"index":{"searchIndex":["app","gli","commands","doc","markdowndocumentlistener","hook","prompt","promptfzf","promptstd","hookapp","hooker","object","string","act_on()","all_bookmarks()","beginning()","bookmark_for()","bookmark_from_app()","browse_bookmarks()","browse_linked()","cap()","cap!()","clear_screen()","clip()","clip_bookmark()","clone_hooks()","command()","commands()","copy_bookmark()","decode()","default_command()","delete_all_hooks()","delete_hooks()","encode()","end_command()","end_commands()","end_options()","ending()","escape_quotes()","flag()","format_regex()","fzf()","get_hooks()","install_fzf()","link_all()","link_files()","linked_bookmarks()","new()","new()","nil_if_missing()","open_gui()","open_linked()","options()","output_array()","program_desc()","program_long_desc()","restore_std()","search_bookmarks()","search_name()","search_path_or_address()","select_hook()","silence_std()","split_hook()","split_hooks()","switch()","uninstall_fzf()","valid_hook()","valid_hook!()","validate_format()","version()","which_fzf()","readme"],"longSearchIndex":["app","gli","gli::commands","gli::commands::doc","gli::commands::markdowndocumentlistener","hook","hook::prompt","hook::promptfzf","hook::promptstd","hookapp","hooker","object","string","hookapp#act_on()","hookapp#all_bookmarks()","gli::commands::markdowndocumentlistener#beginning()","hookapp#bookmark_for()","hookapp#bookmark_from_app()","hookapp#browse_bookmarks()","hookapp#browse_linked()","string#cap()","string#cap!()","hook::promptstd#clear_screen()","string#clip()","hookapp#clip_bookmark()","hookapp#clone_hooks()","gli::commands::markdowndocumentlistener#command()","gli::commands::markdowndocumentlistener#commands()","hookapp#copy_bookmark()","hookapp#decode()","gli::commands::markdowndocumentlistener#default_command()","hookapp#delete_all_hooks()","hookapp#delete_hooks()","hookapp#encode()","gli::commands::markdowndocumentlistener#end_command()","gli::commands::markdowndocumentlistener#end_commands()","gli::commands::markdowndocumentlistener#end_options()","gli::commands::markdowndocumentlistener#ending()","string#escape_quotes()","gli::commands::markdowndocumentlistener#flag()","hookapp#format_regex()","hook::promptfzf#fzf()","hookapp#get_hooks()","hook::promptfzf#install_fzf()","hookapp#link_all()","hookapp#link_files()","hookapp#linked_bookmarks()","gli::commands::markdowndocumentlistener::new()","hooker::new()","string#nil_if_missing()","hookapp#open_gui()","hookapp#open_linked()","gli::commands::markdowndocumentlistener#options()","hookapp#output_array()","gli::commands::markdowndocumentlistener#program_desc()","gli::commands::markdowndocumentlistener#program_long_desc()","hook::promptstd#restore_std()","hookapp#search_bookmarks()","hookapp#search_name()","hookapp#search_path_or_address()","hookapp#select_hook()","hook::promptstd#silence_std()","string#split_hook()","string#split_hooks()","gli::commands::markdowndocumentlistener#switch()","hook::promptfzf#uninstall_fzf()","string#valid_hook()","string#valid_hook!()","hookapp#validate_format()","gli::commands::markdowndocumentlistener#version()","hook::promptfzf#which_fzf()",""],"info":[["App","","App.html","","<p>Main class for GLI app\n"],["GLI","","GLI.html","",""],["GLI::Commands","","GLI/Commands.html","",""],["GLI::Commands::Doc","","GLI/Commands/Doc.html","",""],["GLI::Commands::MarkdownDocumentListener","","GLI/Commands/MarkdownDocumentListener.html","","<p>DocumentListener class for GLI documentation generator\n"],["Hook","","Hook.html","",""],["Hook::Prompt","","Hook/Prompt.html","",""],["Hook::PromptFZF","","Hook/PromptFZF.html","","<p>Methods for working installing/using FuzzyFileFinder\n"],["Hook::PromptSTD","","Hook/PromptSTD.html","",""],["HookApp","","HookApp.html","","<p>Hook.app functions\n"],["Hooker","","Hooker.html","","<p>Hook.app CLI interface\n"],["Object","","Object.html","",""],["String","","String.html","","<p>String helpers\n"],["act_on","HookApp","HookApp.html#method-i-act_on","(url)",""],["all_bookmarks","HookApp","HookApp.html#method-i-all_bookmarks","()","<p>Get all known bookmarks. Return array of bookmark hashes.\n"],["beginning","GLI::Commands::MarkdownDocumentListener","GLI/Commands/MarkdownDocumentListener.html#method-i-beginning","()",""],["bookmark_for","HookApp","HookApp.html#method-i-bookmark_for","(url)","<p>Get a Hook bookmark for file or URL. Return bookmark hash.\n"],["bookmark_from_app","HookApp","HookApp.html#method-i-bookmark_from_app","(app, opts)","<p>Get a bookmark from the foreground document of specified app.\n"],["browse_bookmarks","HookApp","HookApp.html#method-i-browse_bookmarks","(glob)",""],["browse_linked","HookApp","HookApp.html#method-i-browse_linked","(url)","<p>Select from a menu of available hooks and open using macOS `open`.\n"],["cap","String","String.html#method-i-cap","()","<p>Capitalize only if no uppercase\n"],["cap!","String","String.html#method-i-cap-21","()",""],["clear_screen","Hook::PromptSTD","Hook/PromptSTD.html#method-i-clear_screen","(msg = nil)","<p>Clear the terminal screen\n"],["clip","String","String.html#method-i-clip","()",""],["clip_bookmark","HookApp","HookApp.html#method-i-clip_bookmark","(url, opts)","<p>Create a bookmark for specified file/url and copy to the clipboard.\n"],["clone_hooks","HookApp","HookApp.html#method-i-clone_hooks","(args)","<p>Copy all hooks from source file to target file\n"],["command","GLI::Commands::MarkdownDocumentListener","GLI/Commands/MarkdownDocumentListener.html#method-i-command","(name, aliases, desc, long_desc, arg_name, arg_options)","<p>Gives you a command in the current context and creates a new context of this command\n"],["commands","GLI::Commands::MarkdownDocumentListener","GLI/Commands/MarkdownDocumentListener.html#method-i-commands","()",""],["copy_bookmark","HookApp","HookApp.html#method-i-copy_bookmark","(title, url, opts)","<p>Create a bookmark from specified title and url and copy to the clipboard.\n"],["decode","HookApp","HookApp.html#method-i-decode","(string)",""],["default_command","GLI::Commands::MarkdownDocumentListener","GLI/Commands/MarkdownDocumentListener.html#method-i-default_command","(name)","<p>Gives you the name of the current command in the current context\n"],["delete_all_hooks","HookApp","HookApp.html#method-i-delete_all_hooks","(url, force: false)","<p>Delete all hooked files/urls from target file\n"],["delete_hooks","HookApp","HookApp.html#method-i-delete_hooks","(args, opts)","<p>Delete hooks between two files/urls\n"],["encode","HookApp","HookApp.html#method-i-encode","(string)",""],["end_command","GLI::Commands::MarkdownDocumentListener","GLI/Commands/MarkdownDocumentListener.html#method-i-end_command","(_name)","<p>Ends a command, and “pops” you back up one context\n"],["end_commands","GLI::Commands::MarkdownDocumentListener","GLI/Commands/MarkdownDocumentListener.html#method-i-end_commands","()",""],["end_options","GLI::Commands::MarkdownDocumentListener","GLI/Commands/MarkdownDocumentListener.html#method-i-end_options","()",""],["ending","GLI::Commands::MarkdownDocumentListener","GLI/Commands/MarkdownDocumentListener.html#method-i-ending","()","<p>Called when processing has completed\n"],["escape_quotes","String","String.html#method-i-escape_quotes","()",""],["flag","GLI::Commands::MarkdownDocumentListener","GLI/Commands/MarkdownDocumentListener.html#method-i-flag","(name, aliases, desc, long_desc, default_value, arg_name, must_match, _type)","<p>Gives you a flag in the current context\n"],["format_regex","HookApp","HookApp.html#method-i-format_regex","(options)","<p>Create a single regex for validation of an array by first char or full match.\n"],["fzf","Hook::PromptFZF","Hook/PromptFZF.html#method-i-fzf","()","<p>Get path to fzf binary, installing if needed\n<p>@return [String] Path to fzf binary\n"],["get_hooks","HookApp","HookApp.html#method-i-get_hooks","(url)","<p>Get bookmarks hooked to file or URL. Return array of bookmark hashes.\n"],["install_fzf","Hook::PromptFZF","Hook/PromptFZF.html#method-i-install_fzf","(force: false)","<p>Install fzf on the current system. Installs to a subdirectory of the gem\n<p>@param force [Boolean] …\n"],["link_all","HookApp","HookApp.html#method-i-link_all","(args)","<p>Create bi-directional links between every file/url in the list of arguments\n"],["link_files","HookApp","HookApp.html#method-i-link_files","(args)","<p>Link 2 or more files/urls with bi-directional hooks.\n"],["linked_bookmarks","HookApp","HookApp.html#method-i-linked_bookmarks","(args, opts)","<p>Get a list of all hooks on a file/url.\n"],["new","GLI::Commands::MarkdownDocumentListener","GLI/Commands/MarkdownDocumentListener.html#method-c-new","(_global_options, _options, _arguments, app)",""],["new","Hooker","Hooker.html#method-c-new","()",""],["nil_if_missing","String","String.html#method-i-nil_if_missing","()",""],["open_gui","HookApp","HookApp.html#method-i-open_gui","(url)","<p>Open the Hook GUI for browsing/performing actions on a file or url\n"],["open_linked","HookApp","HookApp.html#method-i-open_linked","(url)","<p>Select from a menu of available hooks and open using macOS `open`.\n"],["options","GLI::Commands::MarkdownDocumentListener","GLI/Commands/MarkdownDocumentListener.html#method-i-options","()",""],["output_array","HookApp","HookApp.html#method-i-output_array","(hooks_arr, opts)","<p>Output an array of hooks in the given format.\n"],["program_desc","GLI::Commands::MarkdownDocumentListener","GLI/Commands/MarkdownDocumentListener.html#method-i-program_desc","(desc)","<p>Gives you the program description\n"],["program_long_desc","GLI::Commands::MarkdownDocumentListener","GLI/Commands/MarkdownDocumentListener.html#method-i-program_long_desc","(desc)",""],["restore_std","Hook::PromptSTD","Hook/PromptSTD.html#method-i-restore_std","()","<p>Restore silenced STDOUT and STDERR\n"],["search_bookmarks","HookApp","HookApp.html#method-i-search_bookmarks","(search, opts)","<p>Search bookmarks, using both names and addresses unless options contain “:names_only”. Return …\n"],["search_name","HookApp","HookApp.html#method-i-search_name","(search)","<p>Search boomark names/titles. Return array of bookmark hashes.\n"],["search_path_or_address","HookApp","HookApp.html#method-i-search_path_or_address","(search)","<p>Search bookmark paths and addresses. Return array of bookmark hashes.\n"],["select_hook","HookApp","HookApp.html#method-i-select_hook","(marks)","<p>Generate a menu of available hooks for selecting one or more hooks to operate on. Revamped to use `fzf`, …\n"],["silence_std","Hook::PromptSTD","Hook/PromptSTD.html#method-i-silence_std","(file = '/dev/null')","<p>Redirect STDOUT and STDERR to /dev/null or file\n<p>@param file [String] a file path to redirect to …\n"],["split_hook","String","String.html#method-i-split_hook","()",""],["split_hooks","String","String.html#method-i-split_hooks","()",""],["switch","GLI::Commands::MarkdownDocumentListener","GLI/Commands/MarkdownDocumentListener.html#method-i-switch","(name, aliases, desc, long_desc, negatable)","<p>Gives you a switch in the current context\n"],["uninstall_fzf","Hook::PromptFZF","Hook/PromptFZF.html#method-i-uninstall_fzf","()","<p>Remove fzf binary\n"],["valid_hook","String","String.html#method-i-valid_hook","()",""],["valid_hook!","String","String.html#method-i-valid_hook-21","()",""],["validate_format","HookApp","HookApp.html#method-i-validate_format","(fmt, options)","<p>Check if format fully matches or matches the first character of available options. Return full valid …\n"],["version","GLI::Commands::MarkdownDocumentListener","GLI/Commands/MarkdownDocumentListener.html#method-i-version","(version)","<p>Gives you the program version\n"],["which_fzf","Hook::PromptFZF","Hook/PromptFZF.html#method-i-which_fzf","()","<p>Return the path to the fzf binary\n<p>@return [String] Path to fzf\n"],["README","","README_rdoc.html","","<p>hookapp\n<p>A CLI for Hook.app on macOS.\n<p>hook - CLI interface for Hook.app (macOS)\n"]]}}
|
data/html/js/search_index.js.gz
CHANGED
Binary file
|
data/html/table_of_contents.html
CHANGED
data/lib/hook/hookapp.rb
CHANGED
@@ -37,7 +37,7 @@ class HookApp
|
|
37
37
|
|
38
38
|
begin
|
39
39
|
mark = `osascript <<'APPLESCRIPT'
|
40
|
-
tell application "
|
40
|
+
tell application "#{HOOK_APP}"
|
41
41
|
set _hook to make bookmark with data "#{url}"
|
42
42
|
if _hook is missing value
|
43
43
|
return ""
|
@@ -60,7 +60,7 @@ class HookApp
|
|
60
60
|
raise "Invalid target: #{url}" unless url
|
61
61
|
|
62
62
|
hooks = `osascript <<'APPLESCRIPT'
|
63
|
-
tell application "
|
63
|
+
tell application "#{HOOK_APP}"
|
64
64
|
set _mark to make bookmark with data "#{url}"
|
65
65
|
if _mark is missing value
|
66
66
|
return ""
|
@@ -85,7 +85,7 @@ class HookApp
|
|
85
85
|
tell application "System Events" to set front_app to name of first application process whose frontmost is true
|
86
86
|
tell application "#{app}" to activate
|
87
87
|
delay 2
|
88
|
-
tell application "
|
88
|
+
tell application "#{HOOK_APP}"
|
89
89
|
set _hook to (bookmark from active window)
|
90
90
|
set _output to (name of _hook & "||" & address of _hook & "||" & path of _hook)
|
91
91
|
end tell
|
@@ -106,7 +106,7 @@ class HookApp
|
|
106
106
|
def search_name(search)
|
107
107
|
`osascript <<'APPLESCRIPT'
|
108
108
|
set searchString to "#{search.strip}"
|
109
|
-
tell application "
|
109
|
+
tell application "#{HOOK_APP}"
|
110
110
|
set _marks to every bookmark whose name contains searchString
|
111
111
|
set _out to {}
|
112
112
|
repeat with _hook in _marks
|
@@ -124,7 +124,7 @@ class HookApp
|
|
124
124
|
def search_path_or_address(search)
|
125
125
|
`osascript <<'APPLESCRIPT'
|
126
126
|
set searchString to "#{search.strip}"
|
127
|
-
tell application "
|
127
|
+
tell application "#{HOOK_APP}"
|
128
128
|
set _marks to every bookmark whose path contains searchString or address contains searchString
|
129
129
|
set _out to {}
|
130
130
|
repeat with _hook in _marks
|
@@ -141,7 +141,7 @@ class HookApp
|
|
141
141
|
# Get all known bookmarks. Return array of bookmark hashes.
|
142
142
|
def all_bookmarks
|
143
143
|
`osascript <<'APPLESCRIPT'
|
144
|
-
tell application "
|
144
|
+
tell application "#{HOOK_APP}"
|
145
145
|
set _marks to every bookmark
|
146
146
|
set _out to {}
|
147
147
|
repeat with _hook in _marks
|
@@ -224,7 +224,7 @@ class HookApp
|
|
224
224
|
elsif mark[:url]
|
225
225
|
url = URI.parse(mark[:url])
|
226
226
|
id = mark[:url]
|
227
|
-
loc = "#{url.scheme} -
|
227
|
+
loc = "#{url.scheme} + ' - ' + url.hostname"
|
228
228
|
else
|
229
229
|
loc = ''
|
230
230
|
end
|
@@ -273,7 +273,7 @@ class HookApp
|
|
273
273
|
args = ['--layout=reverse-list',
|
274
274
|
'--header="esc: cancel, return: browse"',
|
275
275
|
'--prompt=" Select file > "',
|
276
|
-
%(--preview='hook ls {}'),
|
276
|
+
%(--preview='hook ls -o m {}'),
|
277
277
|
'--height=60%',
|
278
278
|
'--min-height=10']
|
279
279
|
|
@@ -316,7 +316,7 @@ class HookApp
|
|
316
316
|
# Open the Hook GUI for browsing/performing actions on a file or url
|
317
317
|
def open_gui(url)
|
318
318
|
result = `osascript <<'APPLESCRIPT'
|
319
|
-
tell application "
|
319
|
+
tell application "#{HOOK_APP}"
|
320
320
|
set _mark to make bookmark with data "#{url.valid_hook}"
|
321
321
|
if _mark is missing value
|
322
322
|
return "Failed to create bookmark for #{url}"
|
@@ -365,7 +365,7 @@ class HookApp
|
|
365
365
|
|
366
366
|
puts "Linking #{file} and #{target}..."
|
367
367
|
`osascript <<'APPLESCRIPT'
|
368
|
-
tell application "
|
368
|
+
tell application "#{HOOK_APP}"
|
369
369
|
set _mark1 to make bookmark with data "#{file}"
|
370
370
|
set _mark2 to make bookmark with data "#{target}"
|
371
371
|
hook _mark1 and _mark2
|
@@ -385,7 +385,7 @@ class HookApp
|
|
385
385
|
hooks = get_hooks(source)
|
386
386
|
hooks.each do |hook|
|
387
387
|
`osascript <<'APPLESCRIPT'
|
388
|
-
tell application "
|
388
|
+
tell application "#{HOOK_APP}"
|
389
389
|
set _mark1 to make bookmark with data "#{hook[:url]}"
|
390
390
|
set _mark2 to make bookmark with data "#{target}"
|
391
391
|
hook _mark1 and _mark2
|
@@ -409,7 +409,7 @@ class HookApp
|
|
409
409
|
if res =~ /^y/i || force
|
410
410
|
get_hooks(url).each do |hook|
|
411
411
|
`osascript <<'APPLESCRIPT'
|
412
|
-
tell application "
|
412
|
+
tell application "#{HOOK_APP}"
|
413
413
|
set _mark1 to make bookmark with data "#{hook[:url]}"
|
414
414
|
set _mark2 to make bookmark with data "#{url}"
|
415
415
|
unhook _mark1 and _mark2
|
@@ -438,7 +438,7 @@ class HookApp
|
|
438
438
|
source = urls[0]
|
439
439
|
target = urls[1]
|
440
440
|
`osascript <<'APPLESCRIPT'
|
441
|
-
tell application "
|
441
|
+
tell application "#{HOOK_APP}"
|
442
442
|
set _mark1 to make bookmark with data "#{source}"
|
443
443
|
set _mark2 to make bookmark with data "#{target}"
|
444
444
|
unhook _mark1 and _mark2
|
@@ -458,7 +458,7 @@ class HookApp
|
|
458
458
|
link_to = args.dup.map(&:valid_hook).reject { |url| url == source }
|
459
459
|
link_to.each do |url|
|
460
460
|
`osascript <<'APPLESCRIPT'
|
461
|
-
tell application "
|
461
|
+
tell application "#{HOOK_APP}"
|
462
462
|
set _mark1 to make bookmark with data "#{source}"
|
463
463
|
set _mark2 to make bookmark with data "#{url}"
|
464
464
|
hook _mark1 and _mark2
|
@@ -556,7 +556,7 @@ class HookApp
|
|
556
556
|
|
557
557
|
def encode(string)
|
558
558
|
result = `osascript <<'APPLESCRIPT'
|
559
|
-
tell application "
|
559
|
+
tell application "#{HOOK_APP}"
|
560
560
|
percent encode "#{string.escape_quotes}"
|
561
561
|
end tell
|
562
562
|
APPLESCRIPT`.strip.gsub(/'/,'%27')
|
@@ -565,7 +565,7 @@ APPLESCRIPT`.strip.gsub(/'/,'%27')
|
|
565
565
|
|
566
566
|
def decode(string)
|
567
567
|
result = `osascript <<'APPLESCRIPT'
|
568
|
-
tell application "
|
568
|
+
tell application "#{HOOK_APP}"
|
569
569
|
percent decode "#{string.escape_quotes}"
|
570
570
|
end tell
|
571
571
|
APPLESCRIPT`.strip
|
data/lib/hook/prompt.rb
CHANGED
data/lib/hook/version.rb
CHANGED
data/lib/hook.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hookapp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0
|
4
|
+
version: 2.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brett Terpstra
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-11-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aruba
|