hookapp 2.0.10 → 2.0.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +10 -2
- data/bin/hook +9 -0
- data/hook.rdoc +5 -1
- data/html/HookApp.html +54 -13
- data/html/README_rdoc.html +8 -1
- data/html/created.rid +4 -4
- data/html/index.html +7 -1
- data/html/js/search_index.js +1 -1
- data/html/js/search_index.js.gz +0 -0
- data/html/table_of_contents.html +6 -0
- data/lib/hook/hookapp.rb +25 -2
- data/lib/hook/version.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: 56c7c137eeb609c3ed65bf20626e442eae83a6dfba7974603e5b4a58166e345d
|
4
|
+
data.tar.gz: 57934045f6a6e1dedaeaed61742bd0328471a104ba075595e21c5686459c990c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 15cc3b64fd42bb2637f5f28836a7e033257b2cf50f98c03d091b620b0f1adf9d38d409747efeadcdc0025cb41b659bceb31c199e6e83119279ba5591cc04f39d
|
7
|
+
data.tar.gz: 31d4f11352057917a99ab9ce614235e705dfc1da0f09fb672b2d01830da6d380393d76c2042d6ea6799269f00397a8b51397e5f885193abc1b97988b8858869a
|
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.0.11*
|
10
10
|
|
11
11
|
## Installation
|
12
12
|
|
@@ -101,6 +101,14 @@ Display the program version
|
|
101
101
|
|
102
102
|
## Commands
|
103
103
|
|
104
|
+
### `$ hook` <mark>`browse`</mark> `PATH_OR_GLOB`
|
105
|
+
|
106
|
+
*Browse hooks*
|
107
|
+
|
108
|
+
> Select a file to see its hooks, navigate through descendents
|
109
|
+
|
110
|
+
* * * * * *
|
111
|
+
|
104
112
|
### `$ hook` <mark>`clip|cp`</mark> `FILE_OR_URL`
|
105
113
|
|
106
114
|
*Copy Hook URL for file/url to clipboard*
|
@@ -358,5 +366,5 @@ This software is licensed under the MIT License.
|
|
358
366
|
THE SOFTWARE.
|
359
367
|
|
360
368
|
|
361
|
-
Documentation generated 2022-
|
369
|
+
Documentation generated 2022-07-19 14:13
|
362
370
|
|
data/bin/hook
CHANGED
@@ -242,6 +242,15 @@ filetype by macOS. Allows multiple selections with tab key, and type-ahead fuzzy
|
|
242
242
|
end
|
243
243
|
end
|
244
244
|
|
245
|
+
desc 'Browse hooks'
|
246
|
+
long_desc 'Select a file to see its hooks, navigate through descendents'
|
247
|
+
arg_name 'PATH_OR_GLOB'
|
248
|
+
command %i[browse] do |c|
|
249
|
+
c.action do |_, _, args|
|
250
|
+
hookapp.browse_bookmarks(args)
|
251
|
+
end
|
252
|
+
end
|
253
|
+
|
245
254
|
desc 'Open the specified file or url in Hook GUI'
|
246
255
|
long_desc 'Opens Hook.app on the specified file/URL for browsing and performing actions.
|
247
256
|
|
data/hook.rdoc
CHANGED
@@ -4,7 +4,7 @@ Hook.app is a productivity tool for macOS <https://hookproductivity.com/>.
|
|
4
4
|
|
5
5
|
This gem includes a `hook` binary that allows interaction with the features of Hook.app.
|
6
6
|
|
7
|
-
v2.0.
|
7
|
+
v2.0.11
|
8
8
|
|
9
9
|
=== Global Options
|
10
10
|
=== --help
|
@@ -18,6 +18,10 @@ Display the program version
|
|
18
18
|
|
19
19
|
|
20
20
|
=== Commands
|
21
|
+
==== Command: <tt>browse PATH_OR_GLOB</tt>
|
22
|
+
Browse hooks
|
23
|
+
|
24
|
+
Select a file to see its hooks, navigate through descendents
|
21
25
|
==== Command: <tt>clip|cp FILE_OR_URL</tt>
|
22
26
|
Copy Hook URL for file/url to clipboard
|
23
27
|
|
data/html/HookApp.html
CHANGED
@@ -83,6 +83,7 @@
|
|
83
83
|
<li ><a href="#method-i-all_bookmarks">#all_bookmarks</a>
|
84
84
|
<li ><a href="#method-i-bookmark_for">#bookmark_for</a>
|
85
85
|
<li ><a href="#method-i-bookmark_from_app">#bookmark_from_app</a>
|
86
|
+
<li ><a href="#method-i-browse_bookmarks">#browse_bookmarks</a>
|
86
87
|
<li ><a href="#method-i-clip_bookmark">#clip_bookmark</a>
|
87
88
|
<li ><a href="#method-i-clone_hooks">#clone_hooks</a>
|
88
89
|
<li ><a href="#method-i-copy_bookmark">#copy_bookmark</a>
|
@@ -241,6 +242,46 @@
|
|
241
242
|
</div>
|
242
243
|
|
243
244
|
|
245
|
+
</div>
|
246
|
+
|
247
|
+
<div id="method-i-browse_bookmarks" class="method-detail ">
|
248
|
+
<div class="method-heading">
|
249
|
+
<span class="method-name">browse_bookmarks</span><span
|
250
|
+
class="method-args">(glob)</span>
|
251
|
+
<span class="method-click-advice">click to toggle source</span>
|
252
|
+
</div>
|
253
|
+
|
254
|
+
<div class="method-description">
|
255
|
+
|
256
|
+
|
257
|
+
<div class="method-source-code" id="browse_bookmarks-source">
|
258
|
+
<pre><span class="ruby-comment"># File lib/hook/hookapp.rb, line 258</span>
|
259
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">browse_bookmarks</span>(<span class="ruby-identifier">glob</span>)
|
260
|
+
<span class="ruby-identifier">root</span> = <span class="ruby-keyword">if</span> <span class="ruby-identifier">glob</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Array</span>)
|
261
|
+
<span class="ruby-identifier">glob</span>.<span class="ruby-identifier">count</span>.<span class="ruby-identifier">positive?</span> <span class="ruby-operator">?</span> <span class="ruby-identifier">glob</span> <span class="ruby-operator">:</span> <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">glob</span>(<span class="ruby-string">'**/*'</span>)
|
262
|
+
<span class="ruby-keyword">elsif</span> <span class="ruby-identifier">glob</span> <span class="ruby-operator">&&</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span>(<span class="ruby-identifier">glob</span>)
|
263
|
+
<span class="ruby-identifier">hooks</span> = <span class="ruby-identifier">get_hooks</span>(<span class="ruby-identifier">glob</span>)
|
264
|
+
<span class="ruby-keyword">return</span> <span class="ruby-identifier">select_hook</span>(<span class="ruby-identifier">hooks</span>) <span class="ruby-keyword">unless</span> <span class="ruby-identifier">hooks</span>.<span class="ruby-identifier">empty?</span> <span class="ruby-operator">||</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">directory?</span>(<span class="ruby-identifier">glob</span>)
|
265
|
+
|
266
|
+
<span class="ruby-constant">Dir</span>.<span class="ruby-identifier">glob</span>([<span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-identifier">glob</span>), <span class="ruby-string">'**/*'</span>])
|
267
|
+
<span class="ruby-keyword">else</span>
|
268
|
+
<span class="ruby-constant">Dir</span>.<span class="ruby-identifier">glob</span>(<span class="ruby-identifier">glob</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">glob</span>.<span class="ruby-identifier">empty?</span> <span class="ruby-operator">?</span> <span class="ruby-string">'**/*'</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">glob</span>)
|
269
|
+
<span class="ruby-keyword">end</span>
|
270
|
+
|
271
|
+
<span class="ruby-identifier">args</span> = [<span class="ruby-string">'--layout=reverse-list'</span>,
|
272
|
+
<span class="ruby-string">'--header="esc: cancel, return: open"'</span>,
|
273
|
+
<span class="ruby-string">'--prompt=" Select file > "'</span>,
|
274
|
+
<span class="ruby-string">%(--preview='hook ls {}')</span>,
|
275
|
+
<span class="ruby-string">'--height=60%'</span>,
|
276
|
+
<span class="ruby-string">'--min-height=10'</span>]
|
277
|
+
|
278
|
+
<span class="ruby-identifier">sel</span> = <span class="ruby-node">`echo #{Shellwords.escape(root.join("\n"))} | '#{fzf}' #{args.join(' ')}`</span>.<span class="ruby-identifier">chomp</span>
|
279
|
+
<span class="ruby-keyword">return</span> <span class="ruby-identifier">open_linked</span>(<span class="ruby-identifier">sel</span>)
|
280
|
+
<span class="ruby-keyword">end</span></pre>
|
281
|
+
</div>
|
282
|
+
</div>
|
283
|
+
|
284
|
+
|
244
285
|
</div>
|
245
286
|
|
246
287
|
<div id="method-i-clip_bookmark" class="method-detail ">
|
@@ -276,7 +317,7 @@
|
|
276
317
|
<p>Copy all hooks from source file to target file</p>
|
277
318
|
|
278
319
|
<div class="method-source-code" id="clone_hooks-source">
|
279
|
-
<pre><span class="ruby-comment"># File lib/hook/hookapp.rb, line
|
320
|
+
<pre><span class="ruby-comment"># File lib/hook/hookapp.rb, line 336</span>
|
280
321
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">clone_hooks</span>(<span class="ruby-identifier">args</span>)
|
281
322
|
<span class="ruby-identifier">target</span> = <span class="ruby-identifier">args</span>.<span class="ruby-identifier">pop</span>.<span class="ruby-identifier">valid_hook</span>
|
282
323
|
<span class="ruby-identifier">source</span> = <span class="ruby-identifier">args</span>[<span class="ruby-value">0</span>].<span class="ruby-identifier">valid_hook</span>
|
@@ -340,7 +381,7 @@
|
|
340
381
|
|
341
382
|
|
342
383
|
<div class="method-source-code" id="decode-source">
|
343
|
-
<pre><span class="ruby-comment"># File lib/hook/hookapp.rb, line
|
384
|
+
<pre><span class="ruby-comment"># File lib/hook/hookapp.rb, line 522</span>
|
344
385
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">decode</span>(<span class="ruby-identifier">string</span>)
|
345
386
|
<span class="ruby-identifier">result</span> = <span class="ruby-node">`osascript <<'APPLESCRIPT'
|
346
387
|
tell application "Hook"
|
@@ -366,7 +407,7 @@ APPLESCRIPT`</span>.<span class="ruby-identifier">strip</span>
|
|
366
407
|
<p>Delete all hooked files/urls from target file</p>
|
367
408
|
|
368
409
|
<div class="method-source-code" id="delete_all_hooks-source">
|
369
|
-
<pre><span class="ruby-comment"># File lib/hook/hookapp.rb, line
|
410
|
+
<pre><span class="ruby-comment"># File lib/hook/hookapp.rb, line 359</span>
|
370
411
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">delete_all_hooks</span>(<span class="ruby-identifier">url</span>, <span class="ruby-value">force:</span> <span class="ruby-keyword">false</span>)
|
371
412
|
<span class="ruby-keyword">unless</span> <span class="ruby-identifier">force</span>
|
372
413
|
<span class="ruby-constant">STDERR</span>.<span class="ruby-identifier">print</span> <span class="ruby-node">"Are you sure you want to delete ALL hooks from #{url} (y/N)? "</span>
|
@@ -404,7 +445,7 @@ APPLESCRIPT`</span>.<span class="ruby-identifier">strip</span>
|
|
404
445
|
<p>Delete hooks between two files/urls</p>
|
405
446
|
|
406
447
|
<div class="method-source-code" id="delete_hooks-source">
|
407
|
-
<pre><span class="ruby-comment"># File lib/hook/hookapp.rb, line
|
448
|
+
<pre><span class="ruby-comment"># File lib/hook/hookapp.rb, line 381</span>
|
408
449
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">delete_hooks</span>(<span class="ruby-identifier">args</span>, <span class="ruby-identifier">opts</span>)
|
409
450
|
<span class="ruby-identifier">urls</span> = <span class="ruby-identifier">args</span>.<span class="ruby-identifier">map</span>(<span class="ruby-operator">&</span><span class="ruby-value">:valid_hook</span>).<span class="ruby-identifier">delete_if</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">url</span><span class="ruby-operator">|</span> <span class="ruby-operator">!</span><span class="ruby-identifier">url</span> }
|
410
451
|
<span class="ruby-identifier">output</span> = []
|
@@ -450,7 +491,7 @@ APPLESCRIPT`</span>.<span class="ruby-identifier">strip</span>
|
|
450
491
|
|
451
492
|
|
452
493
|
<div class="method-source-code" id="encode-source">
|
453
|
-
<pre><span class="ruby-comment"># File lib/hook/hookapp.rb, line
|
494
|
+
<pre><span class="ruby-comment"># File lib/hook/hookapp.rb, line 513</span>
|
454
495
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">encode</span>(<span class="ruby-identifier">string</span>)
|
455
496
|
<span class="ruby-identifier">result</span> = <span class="ruby-node">`osascript <<'APPLESCRIPT'
|
456
497
|
tell application "Hook"
|
@@ -540,7 +581,7 @@ APPLESCRIPT`</span>.<span class="ruby-identifier">strip</span>.<span class="ruby
|
|
540
581
|
<p>Create bi-directional links between every file/url in the list of arguments</p>
|
541
582
|
|
542
583
|
<div class="method-source-code" id="link_all-source">
|
543
|
-
<pre><span class="ruby-comment"># File lib/hook/hookapp.rb, line
|
584
|
+
<pre><span class="ruby-comment"># File lib/hook/hookapp.rb, line 411</span>
|
544
585
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">link_all</span>(<span class="ruby-identifier">args</span>)
|
545
586
|
<span class="ruby-identifier">args</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">file</span><span class="ruby-operator">|</span>
|
546
587
|
<span class="ruby-identifier">source</span> = <span class="ruby-identifier">file</span>.<span class="ruby-identifier">valid_hook</span>
|
@@ -575,7 +616,7 @@ APPLESCRIPT`</span>.<span class="ruby-identifier">strip</span>.<span class="ruby
|
|
575
616
|
<p>Link 2 or more files/urls with bi-directional hooks.</p>
|
576
617
|
|
577
618
|
<div class="method-source-code" id="link_files-source">
|
578
|
-
<pre><span class="ruby-comment"># File lib/hook/hookapp.rb, line
|
619
|
+
<pre><span class="ruby-comment"># File lib/hook/hookapp.rb, line 313</span>
|
579
620
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">link_files</span>(<span class="ruby-identifier">args</span>)
|
580
621
|
<span class="ruby-identifier">target</span> = <span class="ruby-identifier">args</span>.<span class="ruby-identifier">pop</span>
|
581
622
|
<span class="ruby-identifier">target</span>.<span class="ruby-identifier">valid_hook!</span>
|
@@ -614,7 +655,7 @@ APPLESCRIPT`</span>.<span class="ruby-identifier">strip</span>.<span class="ruby
|
|
614
655
|
<p>Get a list of all hooks on a file/url.</p>
|
615
656
|
|
616
657
|
<div class="method-source-code" id="linked_bookmarks-source">
|
617
|
-
<pre><span class="ruby-comment"># File lib/hook/hookapp.rb, line
|
658
|
+
<pre><span class="ruby-comment"># File lib/hook/hookapp.rb, line 430</span>
|
618
659
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">linked_bookmarks</span>(<span class="ruby-identifier">args</span>, <span class="ruby-identifier">opts</span>)
|
619
660
|
<span class="ruby-identifier">result</span> = []
|
620
661
|
|
@@ -677,7 +718,7 @@ APPLESCRIPT`</span>.<span class="ruby-identifier">strip</span>.<span class="ruby
|
|
677
718
|
<p>Open the <a href="Hook.html"><code>Hook</code></a> GUI for browsing/performing actions on a file or url</p>
|
678
719
|
|
679
720
|
<div class="method-source-code" id="open_gui-source">
|
680
|
-
<pre><span class="ruby-comment"># File lib/hook/hookapp.rb, line
|
721
|
+
<pre><span class="ruby-comment"># File lib/hook/hookapp.rb, line 282</span>
|
681
722
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">open_gui</span>(<span class="ruby-identifier">url</span>)
|
682
723
|
<span class="ruby-identifier">result</span> = <span class="ruby-node">`osascript <<'APPLESCRIPT'
|
683
724
|
tell application "Hook"
|
@@ -709,7 +750,7 @@ APPLESCRIPT`</span>.<span class="ruby-identifier">strip</span>.<span class="ruby
|
|
709
750
|
<p>Select from a menu of available hooks and open using macOS `open`.</p>
|
710
751
|
|
711
752
|
<div class="method-source-code" id="open_linked-source">
|
712
|
-
<pre><span class="ruby-comment"># File lib/hook/hookapp.rb, line
|
753
|
+
<pre><span class="ruby-comment"># File lib/hook/hookapp.rb, line 298</span>
|
713
754
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">open_linked</span>(<span class="ruby-identifier">url</span>)
|
714
755
|
<span class="ruby-identifier">marks</span> = <span class="ruby-identifier">get_hooks</span>(<span class="ruby-identifier">url</span>)
|
715
756
|
<span class="ruby-keyword">if</span> <span class="ruby-identifier">marks</span>.<span class="ruby-identifier">empty?</span>
|
@@ -740,7 +781,7 @@ APPLESCRIPT`</span>.<span class="ruby-identifier">strip</span>.<span class="ruby
|
|
740
781
|
<p>Output an array of hooks in the given format.</p>
|
741
782
|
|
742
783
|
<div class="method-source-code" id="output_array-source">
|
743
|
-
<pre><span class="ruby-comment"># File lib/hook/hookapp.rb, line
|
784
|
+
<pre><span class="ruby-comment"># File lib/hook/hookapp.rb, line 477</span>
|
744
785
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">output_array</span>(<span class="ruby-identifier">hooks_arr</span>, <span class="ruby-identifier">opts</span>)
|
745
786
|
<span class="ruby-keyword">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">hooks_arr</span>.<span class="ruby-identifier">empty?</span>
|
746
787
|
<span class="ruby-identifier">hooks_arr</span>.<span class="ruby-identifier">reject!</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">h</span><span class="ruby-operator">|</span> <span class="ruby-identifier">h</span>[<span class="ruby-value">:path</span>].<span class="ruby-identifier">nil?</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">h</span>[<span class="ruby-value">:path</span>] <span class="ruby-operator">==</span> <span class="ruby-string">''</span> } <span class="ruby-keyword">if</span> <span class="ruby-identifier">opts</span>[<span class="ruby-value">:files_only</span>]
|
@@ -947,10 +988,10 @@ APPLESCRIPT`</span>.<span class="ruby-identifier">strip</span>.<span class="ruby
|
|
947
988
|
<span class="ruby-string">'--delimiter="\t"'</span>,
|
948
989
|
<span class="ruby-string">'--with-nth=1,4'</span>,
|
949
990
|
<span class="ruby-string">'--height=60%'</span>,
|
950
|
-
<span class="ruby-string">'--min-height=10'</span>
|
951
|
-
]
|
991
|
+
<span class="ruby-string">'--min-height=10'</span>]
|
952
992
|
|
953
993
|
<span class="ruby-identifier">sel</span> = <span class="ruby-node">`echo #{Shellwords.escape(options.join("\n"))} | '#{fzf}' #{args.join(' ')}`</span>.<span class="ruby-identifier">chomp</span>
|
994
|
+
|
954
995
|
<span class="ruby-identifier">res</span> = <span class="ruby-identifier">sel</span>.<span class="ruby-identifier">split</span>(<span class="ruby-regexp">/\n/</span>).<span class="ruby-identifier">map</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">s</span><span class="ruby-operator">|</span>
|
955
996
|
<span class="ruby-identifier">ps</span> = <span class="ruby-identifier">s</span>.<span class="ruby-identifier">split</span>(<span class="ruby-regexp">/\t/</span>)
|
956
997
|
{ <span class="ruby-value">name:</span> <span class="ruby-identifier">ps</span>[<span class="ruby-value">0</span>], <span class="ruby-value">path:</span> <span class="ruby-identifier">ps</span>[<span class="ruby-value">1</span>], <span class="ruby-value">url:</span> <span class="ruby-identifier">ps</span>[<span class="ruby-value">2</span>] }
|
data/html/README_rdoc.html
CHANGED
@@ -64,6 +64,7 @@
|
|
64
64
|
<li><a href="#label--help">–help</a>
|
65
65
|
<li><a href="#label--version">–version</a>
|
66
66
|
<li><a href="#label-Commands">Commands</a>
|
67
|
+
<li><a href="#label-Command-3A+browse++PATH_OR_GLOB">Command: <code>browse PATH_OR_GLOB</code></a>
|
67
68
|
<li><a href="#label-Command-3A+clip-7Ccp++FILE_OR_URL">Command: <code>clip|cp FILE_OR_URL</code></a>
|
68
69
|
<li><a href="#label-Options">Options</a>
|
69
70
|
<li><a href="#label-a-7C--app+APP_NAME">-a|–app APP_NAME</a>
|
@@ -132,7 +133,7 @@
|
|
132
133
|
|
133
134
|
<p>This gem includes a `hook` binary that allows interaction with the features of Hook.app.</p>
|
134
135
|
|
135
|
-
<p>v2.0.
|
136
|
+
<p>v2.0.11</p>
|
136
137
|
|
137
138
|
<h3 id="label-Global+Options">Global Options<span><a href="#label-Global+Options">¶</a> <a href="#top">↑</a></span></h3>
|
138
139
|
|
@@ -146,6 +147,12 @@
|
|
146
147
|
|
147
148
|
<h3 id="label-Commands">Commands<span><a href="#label-Commands">¶</a> <a href="#top">↑</a></span></h3>
|
148
149
|
|
150
|
+
<h4 id="label-Command-3A+browse++PATH_OR_GLOB">Command: <code>browse PATH_OR_GLOB</code><span><a href="#label-Command-3A+browse++PATH_OR_GLOB">¶</a> <a href="#top">↑</a></span></h4>
|
151
|
+
|
152
|
+
<p>Browse hooks</p>
|
153
|
+
|
154
|
+
<p>Select a file to see its hooks, navigate through descendents</p>
|
155
|
+
|
149
156
|
<h4 id="label-Command-3A+clip-7Ccp++FILE_OR_URL">Command: <code>clip|cp FILE_OR_URL</code><span><a href="#label-Command-3A+clip-7Ccp++FILE_OR_URL">¶</a> <a href="#top">↑</a></span></h4>
|
150
157
|
|
151
158
|
<p>Copy <a href="Hook.html"><code>Hook</code></a> URL for file/url to clipboard</p>
|
data/html/created.rid
CHANGED
@@ -1,10 +1,10 @@
|
|
1
|
-
|
1
|
+
Tue, 19 Jul 2022 18:13:24 -0500
|
2
2
|
README.rdoc Tue, 07 Jul 2020 16:57:07 -0500
|
3
3
|
lib/hook.rb Thu, 26 May 2022 08:20:27 -0500
|
4
|
-
lib/hook/hookapp.rb
|
4
|
+
lib/hook/hookapp.rb Tue, 19 Jul 2022 18:13:11 -0500
|
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
7
|
lib/hook/prompt.rb Thu, 26 May 2022 08:20:13 -0500
|
8
8
|
lib/hook/string.rb Sun, 31 Oct 2021 07:03:15 -0500
|
9
|
-
lib/hook/version.rb
|
10
|
-
bin/hook
|
9
|
+
lib/hook/version.rb Tue, 19 Jul 2022 18:13:20 -0500
|
10
|
+
bin/hook Tue, 19 Jul 2022 14:11:16 -0500
|
data/html/index.html
CHANGED
@@ -99,7 +99,7 @@
|
|
99
99
|
|
100
100
|
<p>This gem includes a `hook` binary that allows interaction with the features of Hook.app.</p>
|
101
101
|
|
102
|
-
<p>v2.0.
|
102
|
+
<p>v2.0.11</p>
|
103
103
|
|
104
104
|
<h3 id="label-Global+Options">Global Options<span><a href="#label-Global+Options">¶</a> <a href="#top">↑</a></span></h3>
|
105
105
|
|
@@ -113,6 +113,12 @@
|
|
113
113
|
|
114
114
|
<h3 id="label-Commands">Commands<span><a href="#label-Commands">¶</a> <a href="#top">↑</a></span></h3>
|
115
115
|
|
116
|
+
<h4 id="label-Command-3A+browse++PATH_OR_GLOB">Command: <code>browse PATH_OR_GLOB</code><span><a href="#label-Command-3A+browse++PATH_OR_GLOB">¶</a> <a href="#top">↑</a></span></h4>
|
117
|
+
|
118
|
+
<p>Browse hooks</p>
|
119
|
+
|
120
|
+
<p>Select a file to see its hooks, navigate through descendents</p>
|
121
|
+
|
116
122
|
<h4 id="label-Command-3A+clip-7Ccp++FILE_OR_URL">Command: <code>clip|cp FILE_OR_URL</code><span><a href="#label-Command-3A+clip-7Ccp++FILE_OR_URL">¶</a> <a href="#top">↑</a></span></h4>
|
117
123
|
|
118
124
|
<p>Copy <a href="Hook.html"><code>Hook</code></a> URL for file/url to clipboard</p>
|
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","all_bookmarks()","beginning()","bookmark_for()","bookmark_from_app()","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#all_bookmarks()","gli::commands::markdowndocumentlistener#beginning()","hookapp#bookmark_for()","hookapp#bookmark_from_app()","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"],["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"],["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","string","all_bookmarks()","beginning()","bookmark_for()","bookmark_from_app()","browse_bookmarks()","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#all_bookmarks()","gli::commands::markdowndocumentlistener#beginning()","hookapp#bookmark_for()","hookapp#bookmark_from_app()","hookapp#browse_bookmarks()","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"],["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)",""],["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
@@ -37,6 +37,7 @@
|
|
37
37
|
<li><a href="README_rdoc.html#label--help">–help</a>
|
38
38
|
<li><a href="README_rdoc.html#label--version">–version</a>
|
39
39
|
<li><a href="README_rdoc.html#label-Commands">Commands</a>
|
40
|
+
<li><a href="README_rdoc.html#label-Command-3A+browse++PATH_OR_GLOB">Command: <code>browse PATH_OR_GLOB</code></a>
|
40
41
|
<li><a href="README_rdoc.html#label-Command-3A+clip-7Ccp++FILE_OR_URL">Command: <code>clip|cp FILE_OR_URL</code></a>
|
41
42
|
<li><a href="README_rdoc.html#label-Options">Options</a>
|
42
43
|
<li><a href="README_rdoc.html#label-a-7C--app+APP_NAME">-a|–app APP_NAME</a>
|
@@ -153,6 +154,11 @@
|
|
153
154
|
—
|
154
155
|
<span class="container">HookApp</span>
|
155
156
|
|
157
|
+
<li class="method">
|
158
|
+
<a href="HookApp.html#method-i-browse_bookmarks">#browse_bookmarks</a>
|
159
|
+
—
|
160
|
+
<span class="container">HookApp</span>
|
161
|
+
|
156
162
|
<li class="method">
|
157
163
|
<a href="String.html#method-i-cap">#cap</a>
|
158
164
|
—
|
data/lib/hook/hookapp.rb
CHANGED
@@ -243,10 +243,10 @@ class HookApp
|
|
243
243
|
'--delimiter="\t"',
|
244
244
|
'--with-nth=1,4',
|
245
245
|
'--height=60%',
|
246
|
-
'--min-height=10'
|
247
|
-
]
|
246
|
+
'--min-height=10']
|
248
247
|
|
249
248
|
sel = `echo #{Shellwords.escape(options.join("\n"))} | '#{fzf}' #{args.join(' ')}`.chomp
|
249
|
+
|
250
250
|
res = sel.split(/\n/).map do |s|
|
251
251
|
ps = s.split(/\t/)
|
252
252
|
{ name: ps[0], path: ps[1], url: ps[2] }
|
@@ -255,6 +255,29 @@ class HookApp
|
|
255
255
|
res || []
|
256
256
|
end
|
257
257
|
|
258
|
+
def browse_bookmarks(glob)
|
259
|
+
root = if glob.is_a?(Array)
|
260
|
+
glob.count.positive? ? glob : Dir.glob('**/*')
|
261
|
+
elsif glob && File.exist?(glob)
|
262
|
+
hooks = get_hooks(glob)
|
263
|
+
return select_hook(hooks) unless hooks.empty? || File.directory?(glob)
|
264
|
+
|
265
|
+
Dir.glob([File.expand_path(glob), '**/*'])
|
266
|
+
else
|
267
|
+
Dir.glob(glob.nil? || glob.empty? ? '**/*' : glob)
|
268
|
+
end
|
269
|
+
|
270
|
+
args = ['--layout=reverse-list',
|
271
|
+
'--header="esc: cancel, return: open"',
|
272
|
+
'--prompt=" Select file > "',
|
273
|
+
%(--preview='hook ls {}'),
|
274
|
+
'--height=60%',
|
275
|
+
'--min-height=10']
|
276
|
+
|
277
|
+
sel = `echo #{Shellwords.escape(root.join("\n"))} | '#{fzf}' #{args.join(' ')}`.chomp
|
278
|
+
return open_linked(sel)
|
279
|
+
end
|
280
|
+
|
258
281
|
# Open the Hook GUI for browsing/performing actions on a file or url
|
259
282
|
def open_gui(url)
|
260
283
|
result = `osascript <<'APPLESCRIPT'
|
data/lib/hook/version.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.0.13
|
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-07-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aruba
|