hookapp 2.0.5 → 2.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/AUTHORS.md +4 -0
- data/CHANGELOG.md +9 -0
- data/Gemfile.lock +35 -40
- data/LICENSE +21 -0
- data/README.md +52 -19
- data/Rakefile +7 -3
- data/bin/hook +102 -65
- data/buildnotes.md +30 -0
- data/hook.rdoc +35 -11
- data/hookapp.gemspec +1 -0
- data/html/App.html +1 -1
- data/html/GLI/Commands/Doc.html +1 -1
- data/html/GLI/Commands/MarkdownDocumentListener.html +27 -17
- data/html/GLI/Commands.html +1 -1
- data/html/GLI.html +1 -1
- data/html/Hook.html +1 -1
- data/html/HookApp.html +106 -44
- data/html/Hooker.html +2 -2
- data/html/README_rdoc.html +47 -18
- data/html/String.html +23 -1
- data/html/created.rid +9 -8
- data/html/index.html +39 -12
- data/html/js/navigation.js.gz +0 -0
- data/html/js/search_index.js +1 -1
- data/html/js/search_index.js.gz +0 -0
- data/html/js/searcher.js.gz +0 -0
- data/html/table_of_contents.html +71 -7
- data/lib/hook/hookapp.rb +40 -22
- data/lib/hook/hooker.rb +1 -0
- data/lib/hook/markdown_document_listener.rb +12 -2
- data/lib/hook/prompt.rb +113 -0
- data/lib/hook/string.rb +4 -0
- data/lib/hook/version.rb +1 -1
- data/lib/hook.rb +2 -0
- data/test/helpers/hook-helpers.rb +76 -0
- data/test/hook_clip_test.rb +24 -0
- data/test/hook_clone_test.rb +30 -0
- data/test/hook_encode_test.rb +30 -0
- data/test/hook_link_test.rb +40 -0
- data/test/hook_list_test.rb +25 -0
- data/test/hook_remove_test.rb +34 -0
- data/test/hook_scripts_test.rb +21 -0
- metadata +33 -16
- data/lib/helpers/fuzzyfilefinder +0 -0
- data/test/default_test.rb +0 -14
- data/test/hookfiles/01.test +0 -0
- data/test/hookfiles/02.test +0 -0
- data/test/hookfiles/03.test +0 -0
- data/test/hookfiles/04.test +0 -0
- data/test/hookfiles/05.test +0 -0
- data/test/hookfiles/06.test +0 -0
- data/test/hookfiles/07.test +0 -0
- data/test/hookfiles/08.test +0 -0
- data/test/hookfiles/09.test +0 -0
- data/test/hookfiles/10.test +0 -0
- data/test/hookfiles/11.test +0 -0
- data/test/hookfiles/12.test +0 -0
data/html/String.html
CHANGED
@@ -75,6 +75,7 @@
|
|
75
75
|
<li ><a href="#method-i-cap">#cap</a>
|
76
76
|
<li ><a href="#method-i-cap-21">#cap!</a>
|
77
77
|
<li ><a href="#method-i-clip">#clip</a>
|
78
|
+
<li ><a href="#method-i-escape_quotes">#escape_quotes</a>
|
78
79
|
<li ><a href="#method-i-nil_if_missing">#nil_if_missing</a>
|
79
80
|
<li ><a href="#method-i-split_hook">#split_hook</a>
|
80
81
|
<li ><a href="#method-i-split_hooks">#split_hooks</a>
|
@@ -176,6 +177,27 @@
|
|
176
177
|
</div>
|
177
178
|
|
178
179
|
|
180
|
+
</div>
|
181
|
+
|
182
|
+
<div id="method-i-escape_quotes" class="method-detail ">
|
183
|
+
<div class="method-heading">
|
184
|
+
<span class="method-name">escape_quotes</span><span
|
185
|
+
class="method-args">()</span>
|
186
|
+
<span class="method-click-advice">click to toggle source</span>
|
187
|
+
</div>
|
188
|
+
|
189
|
+
<div class="method-description">
|
190
|
+
|
191
|
+
|
192
|
+
<div class="method-source-code" id="escape_quotes-source">
|
193
|
+
<pre><span class="ruby-comment"># File lib/hook/string.rb, line 61</span>
|
194
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">escape_quotes</span>
|
195
|
+
<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp">/"/</span>, <span class="ruby-string">'\\"'</span>)
|
196
|
+
<span class="ruby-keyword">end</span></pre>
|
197
|
+
</div>
|
198
|
+
</div>
|
199
|
+
|
200
|
+
|
179
201
|
</div>
|
180
202
|
|
181
203
|
<div id="method-i-nil_if_missing" class="method-detail ">
|
@@ -307,7 +329,7 @@
|
|
307
329
|
|
308
330
|
<footer id="validator-badges" role="contentinfo">
|
309
331
|
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
310
|
-
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.3.
|
332
|
+
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.3.3.
|
311
333
|
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
312
334
|
</footer>
|
313
335
|
|
data/html/created.rid
CHANGED
@@ -1,9 +1,10 @@
|
|
1
|
-
|
1
|
+
Thu, 26 May 2022 08:30:27 -0500
|
2
2
|
README.rdoc Tue, 07 Jul 2020 16:57:07 -0500
|
3
|
-
lib/hook.rb
|
4
|
-
lib/hook/hookapp.rb
|
5
|
-
lib/hook/hooker.rb
|
6
|
-
lib/hook/markdown_document_listener.rb
|
7
|
-
lib/hook/
|
8
|
-
lib/hook/
|
9
|
-
|
3
|
+
lib/hook.rb Thu, 26 May 2022 08:20:27 -0500
|
4
|
+
lib/hook/hookapp.rb Thu, 26 May 2022 08:19:39 -0500
|
5
|
+
lib/hook/hooker.rb Sun, 31 Oct 2021 07:54:46 -0500
|
6
|
+
lib/hook/markdown_document_listener.rb Sun, 26 Sep 2021 07:45:59 -0500
|
7
|
+
lib/hook/prompt.rb Thu, 26 May 2022 08:20:13 -0500
|
8
|
+
lib/hook/string.rb Sun, 31 Oct 2021 07:03:15 -0500
|
9
|
+
lib/hook/version.rb Thu, 26 May 2022 08:29:18 -0500
|
10
|
+
bin/hook Sun, 31 Oct 2021 07:54:10 -0500
|
data/html/index.html
CHANGED
@@ -74,6 +74,9 @@
|
|
74
74
|
<li><a href="./GLI/Commands/Doc.html">GLI::Commands::Doc</a>
|
75
75
|
<li><a href="./GLI/Commands/MarkdownDocumentListener.html">GLI::Commands::MarkdownDocumentListener</a>
|
76
76
|
<li><a href="./Hook.html">Hook</a>
|
77
|
+
<li><a href="./Hook/Prompt.html">Hook::Prompt</a>
|
78
|
+
<li><a href="./Hook/PromptFZF.html">Hook::PromptFZF</a>
|
79
|
+
<li><a href="./Hook/PromptSTD.html">Hook::PromptSTD</a>
|
77
80
|
<li><a href="./HookApp.html">HookApp</a>
|
78
81
|
<li><a href="./Hooker.html">Hooker</a>
|
79
82
|
<li><a href="./String.html">String</a>
|
@@ -92,9 +95,11 @@
|
|
92
95
|
|
93
96
|
<h2 id="label-hook+-+CLI+interface+for+Hook.app+-28macOS-29">hook - CLI interface for Hook.app (macOS)<span><a href="#label-hook+-+CLI+interface+for+Hook.app+-28macOS-29">¶</a> <a href="#top">↑</a></span></h2>
|
94
97
|
|
95
|
-
<p>Hook.app is a productivity tool for macOS <<a href="https://hookproductivity.com">hookproductivity.com</a>/>
|
98
|
+
<p>Hook.app is a productivity tool for macOS <<a href="https://hookproductivity.com">hookproductivity.com</a>/>.</p>
|
96
99
|
|
97
|
-
<p>
|
100
|
+
<p>This gem includes a `hook` binary that allows interaction with the features of Hook.app.</p>
|
101
|
+
|
102
|
+
<p>v2.0.9</p>
|
98
103
|
|
99
104
|
<h3 id="label-Global+Options">Global Options<span><a href="#label-Global+Options">¶</a> <a href="#top">↑</a></span></h3>
|
100
105
|
|
@@ -114,7 +119,7 @@
|
|
114
119
|
|
115
120
|
<p>Creates a bookmark for the specified file or URL and copies its <a href="Hook.html"><code>Hook</code></a> URL to the clipboard.</p>
|
116
121
|
|
117
|
-
<p>The copied <a href="Hook.html"><code>Hook</code></a> URL can be used to link to other files (use `hook link –paste FILE/URL
|
122
|
+
<p>The copied <a href="Hook.html"><code>Hook</code></a> URL can be used to link to other files (use `hook link –paste FILE/URL`, or to paste into another app as a link. Use the -m flag to copy a full Markdown link.</p>
|
118
123
|
|
119
124
|
<h5 id="label-Options">Options<span><a href="#label-Options">¶</a> <a href="#top">↑</a></span></h5>
|
120
125
|
|
@@ -134,9 +139,11 @@
|
|
134
139
|
|
135
140
|
<p>Clone all hooks from one file or url onto another</p>
|
136
141
|
|
137
|
-
<p>Copy all the files and urls that the first file is hooked to onto another file
|
142
|
+
<p>Copy all the files and urls that the first file is hooked to onto another file.</p>
|
143
|
+
|
144
|
+
<p>Exactly two arguments (SOURCE, TARGET) required.</p>
|
138
145
|
|
139
|
-
<h4 id="label-Command-3A+find-7Csearch
|
146
|
+
<h4 id="label-Command-3A+find-7Csearch++-5BSEARCH_STRING-5D">Command: <code>find|search [SEARCH_STRING]</code><span><a href="#label-Command-3A+find-7Csearch++-5BSEARCH_STRING-5D">¶</a> <a href="#top">↑</a></span></h4>
|
140
147
|
|
141
148
|
<p>Search bookmarks</p>
|
142
149
|
|
@@ -146,7 +153,7 @@
|
|
146
153
|
|
147
154
|
<h5 id="label-Options">Options<span><a href="#label-Options">¶</a> <a href="#top">↑</a></span></h5>
|
148
155
|
|
149
|
-
<h5 id="label-o-7C--output_format+
|
156
|
+
<h5 id="label-o-7C--output_format+FORMAT">-o|–output_format FORMAT<span><a href="#label-o-7C--output_format+FORMAT">¶</a> <a href="#top">↑</a></span></h5>
|
150
157
|
|
151
158
|
<p>Output format [(h)ooks, (p)aths, (m)arkdown, (v)erbose]</p>
|
152
159
|
<dl class="rdoc-list label-list"><dt>Default Value
|
@@ -196,7 +203,7 @@
|
|
196
203
|
|
197
204
|
<p>List commands one per line, to assist with shell completion</p>
|
198
205
|
|
199
|
-
<h4 id="label-Command-3A+link-7Cln++SOURCE
|
206
|
+
<h4 id="label-Command-3A+link-7Cln++SOURCE...+TARGET">Command: <code>link|ln SOURCE... TARGET</code><span><a href="#label-Command-3A+link-7Cln++SOURCE...+TARGET">¶</a> <a href="#top">↑</a></span></h4>
|
200
207
|
|
201
208
|
<p>Create bidirectional hooks between two or more files/urls</p>
|
202
209
|
|
@@ -214,7 +221,7 @@
|
|
214
221
|
|
215
222
|
<p>Paste URL from clipboard</p>
|
216
223
|
|
217
|
-
<h4 id="label-Command-3A+list-7Cls
|
224
|
+
<h4 id="label-Command-3A+list-7Cls++-5BFILE_OR_URL-5D...">Command: <code>list|ls [FILE_OR_URL]...</code><span><a href="#label-Command-3A+list-7Cls++-5BFILE_OR_URL-5D...">¶</a> <a href="#top">↑</a></span></h4>
|
218
225
|
|
219
226
|
<p>List hooks on a file or url</p>
|
220
227
|
|
@@ -224,7 +231,7 @@
|
|
224
231
|
|
225
232
|
<h5 id="label-Options">Options<span><a href="#label-Options">¶</a> <a href="#top">↑</a></span></h5>
|
226
233
|
|
227
|
-
<h5 id="label-o-7C--output_format+
|
234
|
+
<h5 id="label-o-7C--output_format+FORMAT">-o|–output_format FORMAT<span><a href="#label-o-7C--output_format+FORMAT">¶</a> <a href="#top">↑</a></span></h5>
|
228
235
|
|
229
236
|
<p>Output format [(h)ooks, (p)aths, (m)arkdown, (v)erbose]</p>
|
230
237
|
<dl class="rdoc-list label-list"><dt>Default Value
|
@@ -250,9 +257,27 @@
|
|
250
257
|
|
251
258
|
<p>Open the specified file or url in <a href="Hook.html"><code>Hook</code></a> GUI</p>
|
252
259
|
|
253
|
-
<p>Opens Hook.app on the specified file/URL for browsing and performing actions
|
260
|
+
<p>Opens Hook.app on the specified file/URL for browsing and performing actions.</p>
|
261
|
+
|
262
|
+
<p>Exactly one argument (File/URL) required.</p>
|
263
|
+
|
264
|
+
<h4 id="label-Command-3A+percent++STRING">Command: <code>percent STRING</code><span><a href="#label-Command-3A+percent++STRING">¶</a> <a href="#top">↑</a></span></h4>
|
265
|
+
|
266
|
+
<p>Percent encode/decode a string</p>
|
267
|
+
|
268
|
+
<p>Use encode or decode to apply Hook's url encoding to a string argument. Use '-' to read input from STDIN.</p>
|
254
269
|
|
255
|
-
<
|
270
|
+
<h5 id="label-Commands">Commands<span><a href="#label-Commands">¶</a> <a href="#top">↑</a></span></h5>
|
271
|
+
|
272
|
+
<h6 id="label-Command-3A+decode++STRING">Command: <code>decode STRING</code><span><a href="#label-Command-3A+decode++STRING">¶</a> <a href="#top">↑</a></span></h6>
|
273
|
+
|
274
|
+
<p>decode a percent-encoded string</p>
|
275
|
+
|
276
|
+
<h6 id="label-Command-3A+encode++STRING">Command: <code>encode STRING</code><span><a href="#label-Command-3A+encode++STRING">¶</a> <a href="#top">↑</a></span></h6>
|
277
|
+
|
278
|
+
<p>percent encode a string</p>
|
279
|
+
|
280
|
+
<h4 id="label-Command-3A+remove-7Crm++FILE_OR_URL...">Command: <code>remove|rm FILE_OR_URL...</code><span><a href="#label-Command-3A+remove-7Crm++FILE_OR_URL...">¶</a> <a href="#top">↑</a></span></h4>
|
256
281
|
|
257
282
|
<p>Remove a hook between two files/urls</p>
|
258
283
|
|
@@ -266,6 +291,8 @@
|
|
266
291
|
|
267
292
|
<p>Remove ALL links on files, requires confirmation</p>
|
268
293
|
|
294
|
+
<h5 id="label-f-7C--force">-f|–force<span><a href="#label-f-7C--force">¶</a> <a href="#top">↑</a></span></h5>
|
295
|
+
|
269
296
|
<h4 id="label-Command-3A+scripts++SHELL">Command: <code>scripts SHELL</code><span><a href="#label-Command-3A+scripts++SHELL">¶</a> <a href="#top">↑</a></span></h4>
|
270
297
|
|
271
298
|
<p>Shell completion examples</p>
|
@@ -287,7 +314,7 @@
|
|
287
314
|
|
288
315
|
<footer id="validator-badges" role="contentinfo">
|
289
316
|
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
290
|
-
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.3.
|
317
|
+
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.3.3.
|
291
318
|
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
292
319
|
</footer>
|
293
320
|
|
data/html/js/navigation.js.gz
CHANGED
Binary file
|
data/html/js/search_index.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
var search_data = {"index":{"searchIndex":["app","gli","commands","doc","markdowndocumentlistener","hook","hookapp","hooker","string","all_bookmarks()","beginning()","bookmark_for()","bookmark_from_app()","cap()","cap!()","clip()","clip_bookmark()","clone_hooks()","command()","commands()","copy_bookmark()","default_command()","delete_all_hooks()","delete_hooks()","end_command()","end_commands()","end_options()","ending()","flag()","format_regex()","get_hooks()","link_all()","link_files()","linked_bookmarks()","new()","new()","nil_if_missing()","open_gui()","open_linked()","options()","output_array()","program_desc()","program_long_desc()","search_bookmarks()","search_name()","search_path_or_address()","select_hook()","split_hook()","split_hooks()","switch()","valid_hook()","valid_hook!()","validate_format()","version()","readme"],"longSearchIndex":["app","gli","gli::commands","gli::commands::doc","gli::commands::markdowndocumentlistener","hook","hookapp","hooker","string","hookapp#all_bookmarks()","gli::commands::markdowndocumentlistener#beginning()","hookapp#bookmark_for()","hookapp#bookmark_from_app()","string#cap()","string#cap!()","string#clip()","hookapp#clip_bookmark()","hookapp#clone_hooks()","gli::commands::markdowndocumentlistener#command()","gli::commands::markdowndocumentlistener#commands()","hookapp#copy_bookmark()","gli::commands::markdowndocumentlistener#default_command()","hookapp#delete_all_hooks()","hookapp#delete_hooks()","gli::commands::markdowndocumentlistener#end_command()","gli::commands::markdowndocumentlistener#end_commands()","gli::commands::markdowndocumentlistener#end_options()","gli::commands::markdowndocumentlistener#ending()","gli::commands::markdowndocumentlistener#flag()","hookapp#format_regex()","hookapp#get_hooks()","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()","hookapp#search_bookmarks()","hookapp#search_name()","hookapp#search_path_or_address()","hookapp#select_hook()","string#split_hook()","string#split_hooks()","gli::commands::markdowndocumentlistener#switch()","string#valid_hook()","string#valid_hook!()","hookapp#validate_format()","gli::commands::markdowndocumentlistener#version()",""],"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","",""],["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","()",""],["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"],["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)","<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"],["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"],["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"],["get_hooks","HookApp","HookApp.html#method-i-get_hooks","(url)","<p>Get bookmarks hooked to file or URL. Return array of bookmark hashes.\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)",""],["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"],["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"],["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"],["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()","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"]]}}
|
data/html/js/search_index.js.gz
CHANGED
Binary file
|
data/html/js/searcher.js.gz
CHANGED
Binary file
|
data/html/table_of_contents.html
CHANGED
@@ -42,9 +42,9 @@
|
|
42
42
|
<li><a href="README_rdoc.html#label-a-7C--app+APP_NAME">-a|–app APP_NAME</a>
|
43
43
|
<li><a href="README_rdoc.html#label-m-7C--markdown">-m|–markdown</a>
|
44
44
|
<li><a href="README_rdoc.html#label-Command-3A+clone++SOURCE+TARGET">Command: <code>clone SOURCE TARGET</code></a>
|
45
|
-
<li><a href="README_rdoc.html#label-Command-3A+find-7Csearch
|
45
|
+
<li><a href="README_rdoc.html#label-Command-3A+find-7Csearch++-5BSEARCH_STRING-5D">Command: <code>find|search [SEARCH_STRING]</code></a>
|
46
46
|
<li><a href="README_rdoc.html#label-Options">Options</a>
|
47
|
-
<li><a href="README_rdoc.html#label-o-7C--output_format+
|
47
|
+
<li><a href="README_rdoc.html#label-o-7C--output_format+FORMAT">-o|–output_format FORMAT</a>
|
48
48
|
<li><a href="README_rdoc.html#label-f-7C--files_only">-f|–files_only</a>
|
49
49
|
<li><a href="README_rdoc.html#label-n-7C--names_only">-n|–names_only</a>
|
50
50
|
<li><a href="README_rdoc.html#label--null">–null</a>
|
@@ -55,20 +55,25 @@
|
|
55
55
|
<li><a href="README_rdoc.html#label-Command-3A+help++command">Command: <code>help command</code></a>
|
56
56
|
<li><a href="README_rdoc.html#label-Options">Options</a>
|
57
57
|
<li><a href="README_rdoc.html#label-c">-c</a>
|
58
|
-
<li><a href="README_rdoc.html#label-Command-3A+link-7Cln++SOURCE
|
58
|
+
<li><a href="README_rdoc.html#label-Command-3A+link-7Cln++SOURCE...+TARGET">Command: <code>link|ln SOURCE... TARGET</code></a>
|
59
59
|
<li><a href="README_rdoc.html#label-Options">Options</a>
|
60
60
|
<li><a href="README_rdoc.html#label-a-7C--all">-a|–all</a>
|
61
61
|
<li><a href="README_rdoc.html#label-p-7C--paste">-p|–paste</a>
|
62
|
-
<li><a href="README_rdoc.html#label-Command-3A+list-7Cls
|
62
|
+
<li><a href="README_rdoc.html#label-Command-3A+list-7Cls++-5BFILE_OR_URL-5D...">Command: <code>list|ls [FILE_OR_URL]...</code></a>
|
63
63
|
<li><a href="README_rdoc.html#label-Options">Options</a>
|
64
|
-
<li><a href="README_rdoc.html#label-o-7C--output_format+
|
64
|
+
<li><a href="README_rdoc.html#label-o-7C--output_format+FORMAT">-o|–output_format FORMAT</a>
|
65
65
|
<li><a href="README_rdoc.html#label-f-7C--files_only">-f|–files_only</a>
|
66
66
|
<li><a href="README_rdoc.html#label--null">–null</a>
|
67
67
|
<li><a href="README_rdoc.html#label-s-7C--select">-<a href="no-">s|–</a>select</a>
|
68
68
|
<li><a href="README_rdoc.html#label-Command-3A+open-7Cgui++FILE_OR_URL">Command: <code>open|gui FILE_OR_URL</code></a>
|
69
|
-
<li><a href="README_rdoc.html#label-Command-3A+
|
69
|
+
<li><a href="README_rdoc.html#label-Command-3A+percent++STRING">Command: <code>percent STRING</code></a>
|
70
|
+
<li><a href="README_rdoc.html#label-Commands">Commands</a>
|
71
|
+
<li><a href="README_rdoc.html#label-Command-3A+decode++STRING">Command: <code>decode STRING</code></a>
|
72
|
+
<li><a href="README_rdoc.html#label-Command-3A+encode++STRING">Command: <code>encode STRING</code></a>
|
73
|
+
<li><a href="README_rdoc.html#label-Command-3A+remove-7Crm++FILE_OR_URL...">Command: <code>remove|rm FILE_OR_URL...</code></a>
|
70
74
|
<li><a href="README_rdoc.html#label-Options">Options</a>
|
71
75
|
<li><a href="README_rdoc.html#label-a-7C--all">-a|–all</a>
|
76
|
+
<li><a href="README_rdoc.html#label-f-7C--force">-f|–force</a>
|
72
77
|
<li><a href="README_rdoc.html#label-Command-3A+scripts++SHELL">Command: <code>scripts SHELL</code></a>
|
73
78
|
<li><a href="README_rdoc.html#label-Command-3A+select++FILE_OR_URL">Command: <code>select FILE_OR_URL</code></a>
|
74
79
|
</ul>
|
@@ -95,6 +100,15 @@
|
|
95
100
|
<li class="module">
|
96
101
|
<a href="Hook.html">Hook</a>
|
97
102
|
</li>
|
103
|
+
<li class="module">
|
104
|
+
<a href="Hook/Prompt.html">Hook::Prompt</a>
|
105
|
+
</li>
|
106
|
+
<li class="module">
|
107
|
+
<a href="Hook/PromptFZF.html">Hook::PromptFZF</a>
|
108
|
+
</li>
|
109
|
+
<li class="module">
|
110
|
+
<a href="Hook/PromptSTD.html">Hook::PromptSTD</a>
|
111
|
+
</li>
|
98
112
|
<li class="class">
|
99
113
|
<a href="HookApp.html">HookApp</a>
|
100
114
|
</li>
|
@@ -149,6 +163,11 @@
|
|
149
163
|
—
|
150
164
|
<span class="container">String</span>
|
151
165
|
|
166
|
+
<li class="method">
|
167
|
+
<a href="Hook/PromptSTD.html#method-i-clear_screen">#clear_screen</a>
|
168
|
+
—
|
169
|
+
<span class="container">Hook::PromptSTD</span>
|
170
|
+
|
152
171
|
<li class="method">
|
153
172
|
<a href="String.html#method-i-clip">#clip</a>
|
154
173
|
—
|
@@ -179,6 +198,11 @@
|
|
179
198
|
—
|
180
199
|
<span class="container">HookApp</span>
|
181
200
|
|
201
|
+
<li class="method">
|
202
|
+
<a href="HookApp.html#method-i-decode">#decode</a>
|
203
|
+
—
|
204
|
+
<span class="container">HookApp</span>
|
205
|
+
|
182
206
|
<li class="method">
|
183
207
|
<a href="GLI/Commands/MarkdownDocumentListener.html#method-i-default_command">#default_command</a>
|
184
208
|
—
|
@@ -194,6 +218,11 @@
|
|
194
218
|
—
|
195
219
|
<span class="container">HookApp</span>
|
196
220
|
|
221
|
+
<li class="method">
|
222
|
+
<a href="HookApp.html#method-i-encode">#encode</a>
|
223
|
+
—
|
224
|
+
<span class="container">HookApp</span>
|
225
|
+
|
197
226
|
<li class="method">
|
198
227
|
<a href="GLI/Commands/MarkdownDocumentListener.html#method-i-end_command">#end_command</a>
|
199
228
|
—
|
@@ -214,6 +243,11 @@
|
|
214
243
|
—
|
215
244
|
<span class="container">GLI::Commands::MarkdownDocumentListener</span>
|
216
245
|
|
246
|
+
<li class="method">
|
247
|
+
<a href="String.html#method-i-escape_quotes">#escape_quotes</a>
|
248
|
+
—
|
249
|
+
<span class="container">String</span>
|
250
|
+
|
217
251
|
<li class="method">
|
218
252
|
<a href="GLI/Commands/MarkdownDocumentListener.html#method-i-flag">#flag</a>
|
219
253
|
—
|
@@ -224,11 +258,21 @@
|
|
224
258
|
—
|
225
259
|
<span class="container">HookApp</span>
|
226
260
|
|
261
|
+
<li class="method">
|
262
|
+
<a href="Hook/PromptFZF.html#method-i-fzf">#fzf</a>
|
263
|
+
—
|
264
|
+
<span class="container">Hook::PromptFZF</span>
|
265
|
+
|
227
266
|
<li class="method">
|
228
267
|
<a href="HookApp.html#method-i-get_hooks">#get_hooks</a>
|
229
268
|
—
|
230
269
|
<span class="container">HookApp</span>
|
231
270
|
|
271
|
+
<li class="method">
|
272
|
+
<a href="Hook/PromptFZF.html#method-i-install_fzf">#install_fzf</a>
|
273
|
+
—
|
274
|
+
<span class="container">Hook::PromptFZF</span>
|
275
|
+
|
232
276
|
<li class="method">
|
233
277
|
<a href="HookApp.html#method-i-link_all">#link_all</a>
|
234
278
|
—
|
@@ -279,6 +323,11 @@
|
|
279
323
|
—
|
280
324
|
<span class="container">GLI::Commands::MarkdownDocumentListener</span>
|
281
325
|
|
326
|
+
<li class="method">
|
327
|
+
<a href="Hook/PromptSTD.html#method-i-restore_std">#restore_std</a>
|
328
|
+
—
|
329
|
+
<span class="container">Hook::PromptSTD</span>
|
330
|
+
|
282
331
|
<li class="method">
|
283
332
|
<a href="HookApp.html#method-i-search_bookmarks">#search_bookmarks</a>
|
284
333
|
—
|
@@ -299,6 +348,11 @@
|
|
299
348
|
—
|
300
349
|
<span class="container">HookApp</span>
|
301
350
|
|
351
|
+
<li class="method">
|
352
|
+
<a href="Hook/PromptSTD.html#method-i-silence_std">#silence_std</a>
|
353
|
+
—
|
354
|
+
<span class="container">Hook::PromptSTD</span>
|
355
|
+
|
302
356
|
<li class="method">
|
303
357
|
<a href="String.html#method-i-split_hook">#split_hook</a>
|
304
358
|
—
|
@@ -314,6 +368,11 @@
|
|
314
368
|
—
|
315
369
|
<span class="container">GLI::Commands::MarkdownDocumentListener</span>
|
316
370
|
|
371
|
+
<li class="method">
|
372
|
+
<a href="Hook/PromptFZF.html#method-i-uninstall_fzf">#uninstall_fzf</a>
|
373
|
+
—
|
374
|
+
<span class="container">Hook::PromptFZF</span>
|
375
|
+
|
317
376
|
<li class="method">
|
318
377
|
<a href="String.html#method-i-valid_hook">#valid_hook</a>
|
319
378
|
—
|
@@ -333,13 +392,18 @@
|
|
333
392
|
<a href="GLI/Commands/MarkdownDocumentListener.html#method-i-version">#version</a>
|
334
393
|
—
|
335
394
|
<span class="container">GLI::Commands::MarkdownDocumentListener</span>
|
395
|
+
|
396
|
+
<li class="method">
|
397
|
+
<a href="Hook/PromptFZF.html#method-i-which_fzf">#which_fzf</a>
|
398
|
+
—
|
399
|
+
<span class="container">Hook::PromptFZF</span>
|
336
400
|
</ul>
|
337
401
|
</main>
|
338
402
|
|
339
403
|
|
340
404
|
<footer id="validator-badges" role="contentinfo">
|
341
405
|
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
342
|
-
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.3.
|
406
|
+
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.3.3.
|
343
407
|
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
344
408
|
</footer>
|
345
409
|
|
data/lib/hook/hookapp.rb
CHANGED
@@ -4,6 +4,8 @@ require 'shellwords'
|
|
4
4
|
require 'uri'
|
5
5
|
# Hook.app functions
|
6
6
|
class HookApp
|
7
|
+
include Hook::Prompt
|
8
|
+
|
7
9
|
# Create a single regex for validation of an
|
8
10
|
# array by first char or full match.
|
9
11
|
def format_regex(options)
|
@@ -171,9 +173,9 @@ class HookApp
|
|
171
173
|
output = output_array(result, opts)
|
172
174
|
|
173
175
|
if opts[:format] =~ /^v/
|
174
|
-
"Search results for: #{search}\n---------\n" + output.join("\n")
|
176
|
+
"Search results for: #{search}\n---------\n" + output.join("\n") if output
|
175
177
|
else
|
176
|
-
output.join(separator)
|
178
|
+
output.join(separator) if output
|
177
179
|
end
|
178
180
|
end
|
179
181
|
|
@@ -233,7 +235,8 @@ class HookApp
|
|
233
235
|
raise "Error processing available hooks" if options.empty?
|
234
236
|
|
235
237
|
args = ['--layout=reverse-list',
|
236
|
-
'--header="esc: cancel, tab: multi-select, return: open
|
238
|
+
'--header="esc: cancel, tab: multi-select, ctrl-a: select all, return: open"',
|
239
|
+
'--bind ctrl-a:select-all',
|
237
240
|
'--prompt=" Select hooks > "',
|
238
241
|
'--multi',
|
239
242
|
'--tabstop=4',
|
@@ -243,19 +246,13 @@ class HookApp
|
|
243
246
|
'--min-height=10'
|
244
247
|
]
|
245
248
|
|
246
|
-
fzf = File.join(File.dirname(__FILE__), '../helpers/fuzzyfilefinder')
|
247
|
-
|
248
249
|
sel = `echo #{Shellwords.escape(options.join("\n"))} | '#{fzf}' #{args.join(' ')}`.chomp
|
249
|
-
res = sel.split(/\n/).map
|
250
|
+
res = sel.split(/\n/).map do |s|
|
250
251
|
ps = s.split(/\t/)
|
251
252
|
{ name: ps[0], path: ps[1], url: ps[2] }
|
252
|
-
}
|
253
|
-
|
254
|
-
if res.size == 0
|
255
|
-
raise 'Cancelled (empty response)'
|
256
253
|
end
|
257
254
|
|
258
|
-
res
|
255
|
+
res || []
|
259
256
|
end
|
260
257
|
|
261
258
|
# Open the Hook GUI for browsing/performing actions on a file or url
|
@@ -281,9 +278,11 @@ class HookApp
|
|
281
278
|
warn "No hooks found for #{url}"
|
282
279
|
else
|
283
280
|
res = select_hook(marks)
|
284
|
-
res.
|
285
|
-
|
286
|
-
|
281
|
+
unless res.empty?
|
282
|
+
res.each {|mark|
|
283
|
+
`open '#{mark[:url]}'`
|
284
|
+
}
|
285
|
+
end
|
287
286
|
end
|
288
287
|
end
|
289
288
|
|
@@ -334,10 +333,13 @@ class HookApp
|
|
334
333
|
end
|
335
334
|
|
336
335
|
# Delete all hooked files/urls from target file
|
337
|
-
def delete_all_hooks(url)
|
338
|
-
|
339
|
-
|
340
|
-
|
336
|
+
def delete_all_hooks(url, force: false)
|
337
|
+
unless force
|
338
|
+
STDERR.print "Are you sure you want to delete ALL hooks from #{url} (y/N)? "
|
339
|
+
res = STDIN.gets.strip
|
340
|
+
end
|
341
|
+
|
342
|
+
if res =~ /^y/i || force
|
341
343
|
get_hooks(url).each do |hook|
|
342
344
|
`osascript <<'APPLESCRIPT'
|
343
345
|
tell application "Hook"
|
@@ -360,7 +362,7 @@ class HookApp
|
|
360
362
|
urls.each_with_index do |url, i|
|
361
363
|
raise "Invalid target: #{args[i]}" unless url
|
362
364
|
|
363
|
-
output.push(delete_all_hooks(url))
|
365
|
+
output.push(delete_all_hooks(url, force: opts[:force]))
|
364
366
|
end
|
365
367
|
return output.join("\n")
|
366
368
|
end
|
@@ -431,7 +433,7 @@ class HookApp
|
|
431
433
|
hooks_arr = get_hooks(url)
|
432
434
|
|
433
435
|
output = output_array(hooks_arr, opts)
|
434
|
-
result.push({ file: filename, links: output.join(separator) })
|
436
|
+
result.push({ file: filename, links: output.join(separator) }) if output
|
435
437
|
end
|
436
438
|
|
437
439
|
|
@@ -479,11 +481,27 @@ class HookApp
|
|
479
481
|
end
|
480
482
|
end
|
481
483
|
else
|
482
|
-
|
484
|
+
warn 'No bookmarks'
|
483
485
|
end
|
484
486
|
|
485
487
|
output
|
486
488
|
end
|
487
|
-
end
|
488
489
|
|
490
|
+
def encode(string)
|
491
|
+
result = `osascript <<'APPLESCRIPT'
|
492
|
+
tell application "Hook"
|
493
|
+
percent encode "#{string.escape_quotes}"
|
494
|
+
end tell
|
495
|
+
APPLESCRIPT`.strip.gsub(/'/,'%27')
|
496
|
+
print result
|
497
|
+
end
|
489
498
|
|
499
|
+
def decode(string)
|
500
|
+
result = `osascript <<'APPLESCRIPT'
|
501
|
+
tell application "Hook"
|
502
|
+
percent decode "#{string.escape_quotes}"
|
503
|
+
end tell
|
504
|
+
APPLESCRIPT`.strip
|
505
|
+
print result
|
506
|
+
end
|
507
|
+
end
|