hookapp 2.0.9 → 2.0.12

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5a5b6a517bd76ec8ddfc8ef6ffb98d6690dc56c2d5133bb1ad88635d72aaf55e
4
- data.tar.gz: ddd95cde21eba658a09a98c04c49a03e98853bc450b257d2f6ad843cdf084f35
3
+ metadata.gz: 78285cab00adcd12785f5986c43bebe444f3be094c0094fe7db7b9eb26bba162
4
+ data.tar.gz: 25277c6ea09291600d2308ae68ad61c923c28636c6c3726281592d0993116cf7
5
5
  SHA512:
6
- metadata.gz: 2ab5784b34f8a8380b37202cd1a674c78083e6ec1748f3320f4292933a7cc20cd20db520daa7fd697dade590fa32d5f7d21224e1ebae4396fe5ec2aaff7f6081
7
- data.tar.gz: b45ce5ede9b4fa988f660fb5943b0ce1a7ee8e7bfffd9d0d5a45b0a4138c1db812a8f36dffcba02159e20f370e64e2b611e2e968a61fbf2d763ec03295d927d2
6
+ metadata.gz: e6984f54c6eefa637bb30c8831dd967c9f6a00692fbc835f96a2ca3807275a07a7f0406a494f82b2f447f08daa244a8ac564bb9518ccfa26cb34bf9553721c06
7
+ data.tar.gz: 4242b9839a6c7e02ac1796809ddbcbb1a909bd585bbdee94ffaf0c1d09a2c70fd298c5bbfc7ae8cee17d6911ad63f66207f86fc89107da3f850204e52692d06e
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ #### 2.0.10
2
+
3
+ - Fix permissions issues when installed using sudo
4
+
1
5
  #### 2.0.9
2
6
 
3
7
  - Fix fzf integration across platforms
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- hookapp (2.0.9)
4
+ hookapp (2.0.11)
5
5
  gli (~> 2.20.1)
6
6
  tty-which (~> 0.5, >= 0.5.0)
7
7
 
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*
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-05-26 08:29
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.9
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
 
@@ -0,0 +1,100 @@
1
+ <!DOCTYPE html>
2
+
3
+ <html>
4
+ <head>
5
+ <meta charset="UTF-8">
6
+
7
+ <title>module Hook::Prompt - hookapp</title>
8
+
9
+ <script type="text/javascript">
10
+ var rdoc_rel_prefix = "../";
11
+ var index_rel_prefix = "../";
12
+ </script>
13
+
14
+ <script src="../js/navigation.js" defer></script>
15
+ <script src="../js/search.js" defer></script>
16
+ <script src="../js/search_index.js" defer></script>
17
+ <script src="../js/searcher.js" defer></script>
18
+ <script src="../js/darkfish.js" defer></script>
19
+
20
+ <link href="../css/fonts.css" rel="stylesheet">
21
+ <link href="../css/rdoc.css" rel="stylesheet">
22
+
23
+
24
+ <body id="top" role="document" class="module">
25
+ <nav role="navigation">
26
+ <div id="project-navigation">
27
+ <div id="home-section" role="region" title="Quick navigation" class="nav-section">
28
+ <h2>
29
+ <a href="../index.html" rel="home">Home</a>
30
+ </h2>
31
+
32
+ <div id="table-of-contents-navigation">
33
+ <a href="../table_of_contents.html#pages">Pages</a>
34
+ <a href="../table_of_contents.html#classes">Classes</a>
35
+ <a href="../table_of_contents.html#methods">Methods</a>
36
+ </div>
37
+ </div>
38
+
39
+ <div id="search-section" role="search" class="project-section initially-hidden">
40
+ <form action="#" method="get" accept-charset="utf-8">
41
+ <div id="search-field-wrapper">
42
+ <input id="search-field" role="combobox" aria-label="Search"
43
+ aria-autocomplete="list" aria-controls="search-results"
44
+ type="text" name="search" placeholder="Search" spellcheck="false"
45
+ title="Type to search, Up and Down to navigate, Enter to load">
46
+ </div>
47
+
48
+ <ul id="search-results" aria-label="Search Results"
49
+ aria-busy="false" aria-expanded="false"
50
+ aria-atomic="false" class="initially-hidden"></ul>
51
+ </form>
52
+ </div>
53
+
54
+ </div>
55
+
56
+
57
+
58
+ <div id="class-metadata">
59
+
60
+
61
+
62
+ <div id="includes-section" class="nav-section">
63
+ <h3>Included Modules</h3>
64
+
65
+ <ul class="link-list">
66
+ <li><a class="include" href="PromptSTD.html">Hook::PromptSTD</a>
67
+ <li><a class="include" href="PromptFZF.html">Hook::PromptFZF</a>
68
+ </ul>
69
+ </div>
70
+
71
+
72
+
73
+ </div>
74
+ </nav>
75
+
76
+ <main role="main" aria-labelledby="module-Hook::Prompt">
77
+ <h1 id="module-Hook::Prompt" class="module">
78
+ module Hook::Prompt
79
+ </h1>
80
+
81
+ <section class="description">
82
+
83
+ </section>
84
+
85
+ <section id="5Buntitled-5D" class="documentation-section">
86
+
87
+
88
+
89
+
90
+
91
+ </section>
92
+ </main>
93
+
94
+
95
+ <footer id="validator-badges" role="contentinfo">
96
+ <p><a href="https://validator.w3.org/check/referer">Validate</a>
97
+ <p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.3.3.
98
+ <p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
99
+ </footer>
100
+
@@ -0,0 +1,243 @@
1
+ <!DOCTYPE html>
2
+
3
+ <html>
4
+ <head>
5
+ <meta charset="UTF-8">
6
+
7
+ <title>module Hook::PromptFZF - hookapp</title>
8
+
9
+ <script type="text/javascript">
10
+ var rdoc_rel_prefix = "../";
11
+ var index_rel_prefix = "../";
12
+ </script>
13
+
14
+ <script src="../js/navigation.js" defer></script>
15
+ <script src="../js/search.js" defer></script>
16
+ <script src="../js/search_index.js" defer></script>
17
+ <script src="../js/searcher.js" defer></script>
18
+ <script src="../js/darkfish.js" defer></script>
19
+
20
+ <link href="../css/fonts.css" rel="stylesheet">
21
+ <link href="../css/rdoc.css" rel="stylesheet">
22
+
23
+
24
+ <body id="top" role="document" class="module">
25
+ <nav role="navigation">
26
+ <div id="project-navigation">
27
+ <div id="home-section" role="region" title="Quick navigation" class="nav-section">
28
+ <h2>
29
+ <a href="../index.html" rel="home">Home</a>
30
+ </h2>
31
+
32
+ <div id="table-of-contents-navigation">
33
+ <a href="../table_of_contents.html#pages">Pages</a>
34
+ <a href="../table_of_contents.html#classes">Classes</a>
35
+ <a href="../table_of_contents.html#methods">Methods</a>
36
+ </div>
37
+ </div>
38
+
39
+ <div id="search-section" role="search" class="project-section initially-hidden">
40
+ <form action="#" method="get" accept-charset="utf-8">
41
+ <div id="search-field-wrapper">
42
+ <input id="search-field" role="combobox" aria-label="Search"
43
+ aria-autocomplete="list" aria-controls="search-results"
44
+ type="text" name="search" placeholder="Search" spellcheck="false"
45
+ title="Type to search, Up and Down to navigate, Enter to load">
46
+ </div>
47
+
48
+ <ul id="search-results" aria-label="Search Results"
49
+ aria-busy="false" aria-expanded="false"
50
+ aria-atomic="false" class="initially-hidden"></ul>
51
+ </form>
52
+ </div>
53
+
54
+ </div>
55
+
56
+
57
+
58
+ <div id="class-metadata">
59
+
60
+
61
+
62
+
63
+
64
+ <!-- Method Quickref -->
65
+ <div id="method-list-section" class="nav-section">
66
+ <h3>Methods</h3>
67
+
68
+ <ul class="link-list" role="directory">
69
+ <li ><a href="#method-i-fzf">#fzf</a>
70
+ <li ><a href="#method-i-install_fzf">#install_fzf</a>
71
+ <li ><a href="#method-i-uninstall_fzf">#uninstall_fzf</a>
72
+ <li ><a href="#method-i-which_fzf">#which_fzf</a>
73
+ </ul>
74
+ </div>
75
+
76
+ </div>
77
+ </nav>
78
+
79
+ <main role="main" aria-labelledby="module-Hook::PromptFZF">
80
+ <h1 id="module-Hook::PromptFZF" class="module">
81
+ module Hook::PromptFZF
82
+ </h1>
83
+
84
+ <section class="description">
85
+
86
+ <p>Methods for working installing/using FuzzyFileFinder</p>
87
+
88
+ </section>
89
+
90
+ <section id="5Buntitled-5D" class="documentation-section">
91
+
92
+
93
+
94
+
95
+
96
+ <section id="public-instance-5Buntitled-5D-method-details" class="method-section">
97
+ <header>
98
+ <h3>Public Instance Methods</h3>
99
+ </header>
100
+
101
+ <div id="method-i-fzf" class="method-detail ">
102
+ <div class="method-heading">
103
+ <span class="method-name">fzf</span><span
104
+ class="method-args">()</span>
105
+ <span class="method-click-advice">click to toggle source</span>
106
+ </div>
107
+
108
+ <div class="method-description">
109
+ <p>Get path to fzf binary, installing if needed</p>
110
+
111
+ <p>@return [String] Path to fzf binary</p>
112
+
113
+ <div class="method-source-code" id="fzf-source">
114
+ <pre><span class="ruby-comment"># File lib/hook/prompt.rb, line 39</span>
115
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">fzf</span>
116
+ <span class="ruby-ivar">@fzf</span> <span class="ruby-operator">||=</span> <span class="ruby-identifier">install_fzf</span>
117
+ <span class="ruby-keyword">end</span></pre>
118
+ </div>
119
+ </div>
120
+
121
+
122
+ </div>
123
+
124
+ <div id="method-i-install_fzf" class="method-detail ">
125
+ <div class="method-heading">
126
+ <span class="method-name">install_fzf</span><span
127
+ class="method-args">(force: false)</span>
128
+ <span class="method-click-advice">click to toggle source</span>
129
+ </div>
130
+
131
+ <div class="method-description">
132
+ <p>Install fzf on the current system. Installs to a subdirectory of the gem</p>
133
+
134
+ <p>@param force [Boolean] If true, reinstall if</p>
135
+
136
+ <pre class="ruby"><span class="ruby-identifier">needed</span>
137
+ </pre>
138
+
139
+ <p>@return [String] Path to fzf binary</p>
140
+
141
+ <div class="method-source-code" id="install_fzf-source">
142
+ <pre><span class="ruby-comment"># File lib/hook/prompt.rb, line 74</span>
143
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">install_fzf</span>(<span class="ruby-value">force:</span> <span class="ruby-keyword">false</span>)
144
+ <span class="ruby-keyword">if</span> <span class="ruby-identifier">force</span>
145
+ <span class="ruby-identifier">uninstall_fzf</span>
146
+ <span class="ruby-keyword">elsif</span> <span class="ruby-identifier">which_fzf</span>
147
+ <span class="ruby-keyword">return</span> <span class="ruby-identifier">which_fzf</span>
148
+ <span class="ruby-keyword">end</span>
149
+
150
+ <span class="ruby-identifier">fzf_dir</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">dirname</span>(<span class="ruby-keyword">__FILE__</span>), <span class="ruby-string">&#39;../helpers/fzf&#39;</span>)
151
+ <span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">mkdir_p</span>(<span class="ruby-identifier">fzf_dir</span>) <span class="ruby-keyword">unless</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">directory?</span>(<span class="ruby-identifier">fzf_dir</span>)
152
+ <span class="ruby-identifier">fzf_bin</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-identifier">fzf_dir</span>, <span class="ruby-string">&#39;bin/fzf&#39;</span>)
153
+ <span class="ruby-keyword">return</span> <span class="ruby-identifier">fzf_bin</span> <span class="ruby-keyword">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span>(<span class="ruby-identifier">fzf_bin</span>)
154
+
155
+ <span class="ruby-identifier">warn</span> <span class="ruby-string">&#39;fzf: Compiling and installing fzf -- this will only happen once&#39;</span>
156
+ <span class="ruby-identifier">warn</span> <span class="ruby-string">&#39;fzf: fzf is copyright Junegunn Choi, MIT License &lt;https://github.com/junegunn/fzf/blob/master/LICENSE&gt;&#39;</span>
157
+
158
+ <span class="ruby-identifier">silence_std</span>
159
+ <span class="ruby-node">`&#39;#{fzf_dir}/install&#39; --bin --no-key-bindings --no-completion --no-update-rc --no-bash --no-zsh --no-fish &amp;&gt; /dev/null`</span>
160
+ <span class="ruby-keyword">unless</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span>(<span class="ruby-identifier">fzf_bin</span>)
161
+ <span class="ruby-identifier">restore_std</span>
162
+ <span class="ruby-identifier">warn</span> <span class="ruby-string">&#39;Error installing, trying again as root&#39;</span>
163
+ <span class="ruby-identifier">silence_std</span>
164
+ <span class="ruby-node">`sudo &#39;#{fzf_dir}/install&#39; --bin --no-key-bindings --no-completion --no-update-rc --no-bash --no-zsh --no-fish &amp;&gt; /dev/null`</span>
165
+ <span class="ruby-keyword">end</span>
166
+ <span class="ruby-identifier">restore_std</span>
167
+ <span class="ruby-keyword">unless</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span>(<span class="ruby-identifier">fzf_bin</span>)
168
+ <span class="ruby-identifier">puts</span> <span class="ruby-string">&#39;fzf: unable to install fzf. You can install manually and Hook CLI will use the system version.&#39;</span>
169
+ <span class="ruby-identifier">puts</span> <span class="ruby-string">&#39;fzf: see https://github.com/junegunn/fzf#installation&#39;</span>
170
+ <span class="ruby-identifier">raise</span> <span class="ruby-constant">RuntimeError</span>.<span class="ruby-identifier">new</span>(<span class="ruby-string">&#39;Error installing fzf, please report at https://github.com/ttscoff/hookapp/issues&#39;</span>)
171
+ <span class="ruby-keyword">end</span>
172
+
173
+ <span class="ruby-identifier">warn</span> <span class="ruby-node">&quot;fzf: installed to #{fzf}&quot;</span>
174
+ <span class="ruby-identifier">fzf_bin</span>
175
+ <span class="ruby-keyword">end</span></pre>
176
+ </div>
177
+ </div>
178
+
179
+
180
+ </div>
181
+
182
+ <div id="method-i-uninstall_fzf" class="method-detail ">
183
+ <div class="method-heading">
184
+ <span class="method-name">uninstall_fzf</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
+ <p>Remove fzf binary</p>
191
+
192
+ <div class="method-source-code" id="uninstall_fzf-source">
193
+ <pre><span class="ruby-comment"># File lib/hook/prompt.rb, line 46</span>
194
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">uninstall_fzf</span>
195
+ <span class="ruby-identifier">fzf_bin</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">dirname</span>(<span class="ruby-keyword">__FILE__</span>), <span class="ruby-string">&#39;../helpers/fzf/bin/fzf&#39;</span>)
196
+ <span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">rm_f</span>(<span class="ruby-identifier">fzf_bin</span>) <span class="ruby-keyword">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span>(<span class="ruby-identifier">fzf_bin</span>)
197
+ <span class="ruby-identifier">warn</span> <span class="ruby-string">&#39;fzf: removed #{fzf_bin}&#39;</span>
198
+ <span class="ruby-keyword">end</span></pre>
199
+ </div>
200
+ </div>
201
+
202
+
203
+ </div>
204
+
205
+ <div id="method-i-which_fzf" class="method-detail ">
206
+ <div class="method-heading">
207
+ <span class="method-name">which_fzf</span><span
208
+ class="method-args">()</span>
209
+ <span class="method-click-advice">click to toggle source</span>
210
+ </div>
211
+
212
+ <div class="method-description">
213
+ <p>Return the path to the fzf binary</p>
214
+
215
+ <p>@return [String] Path to fzf</p>
216
+
217
+ <div class="method-source-code" id="which_fzf-source">
218
+ <pre><span class="ruby-comment"># File lib/hook/prompt.rb, line 57</span>
219
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">which_fzf</span>
220
+ <span class="ruby-identifier">fzf_dir</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">dirname</span>(<span class="ruby-keyword">__FILE__</span>), <span class="ruby-string">&#39;../helpers/fzf&#39;</span>)
221
+ <span class="ruby-identifier">fzf_bin</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-identifier">fzf_dir</span>, <span class="ruby-string">&#39;bin/fzf&#39;</span>)
222
+ <span class="ruby-keyword">return</span> <span class="ruby-identifier">fzf_bin</span> <span class="ruby-keyword">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span>(<span class="ruby-identifier">fzf_bin</span>)
223
+
224
+ <span class="ruby-constant">TTY</span><span class="ruby-operator">::</span><span class="ruby-constant">Which</span>.<span class="ruby-identifier">which</span>(<span class="ruby-string">&#39;fzf&#39;</span>)
225
+ <span class="ruby-keyword">end</span></pre>
226
+ </div>
227
+ </div>
228
+
229
+
230
+ </div>
231
+
232
+ </section>
233
+
234
+ </section>
235
+ </main>
236
+
237
+
238
+ <footer id="validator-badges" role="contentinfo">
239
+ <p><a href="https://validator.w3.org/check/referer">Validate</a>
240
+ <p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.3.3.
241
+ <p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
242
+ </footer>
243
+
@@ -0,0 +1,177 @@
1
+ <!DOCTYPE html>
2
+
3
+ <html>
4
+ <head>
5
+ <meta charset="UTF-8">
6
+
7
+ <title>module Hook::PromptSTD - hookapp</title>
8
+
9
+ <script type="text/javascript">
10
+ var rdoc_rel_prefix = "../";
11
+ var index_rel_prefix = "../";
12
+ </script>
13
+
14
+ <script src="../js/navigation.js" defer></script>
15
+ <script src="../js/search.js" defer></script>
16
+ <script src="../js/search_index.js" defer></script>
17
+ <script src="../js/searcher.js" defer></script>
18
+ <script src="../js/darkfish.js" defer></script>
19
+
20
+ <link href="../css/fonts.css" rel="stylesheet">
21
+ <link href="../css/rdoc.css" rel="stylesheet">
22
+
23
+
24
+ <body id="top" role="document" class="module">
25
+ <nav role="navigation">
26
+ <div id="project-navigation">
27
+ <div id="home-section" role="region" title="Quick navigation" class="nav-section">
28
+ <h2>
29
+ <a href="../index.html" rel="home">Home</a>
30
+ </h2>
31
+
32
+ <div id="table-of-contents-navigation">
33
+ <a href="../table_of_contents.html#pages">Pages</a>
34
+ <a href="../table_of_contents.html#classes">Classes</a>
35
+ <a href="../table_of_contents.html#methods">Methods</a>
36
+ </div>
37
+ </div>
38
+
39
+ <div id="search-section" role="search" class="project-section initially-hidden">
40
+ <form action="#" method="get" accept-charset="utf-8">
41
+ <div id="search-field-wrapper">
42
+ <input id="search-field" role="combobox" aria-label="Search"
43
+ aria-autocomplete="list" aria-controls="search-results"
44
+ type="text" name="search" placeholder="Search" spellcheck="false"
45
+ title="Type to search, Up and Down to navigate, Enter to load">
46
+ </div>
47
+
48
+ <ul id="search-results" aria-label="Search Results"
49
+ aria-busy="false" aria-expanded="false"
50
+ aria-atomic="false" class="initially-hidden"></ul>
51
+ </form>
52
+ </div>
53
+
54
+ </div>
55
+
56
+
57
+
58
+ <div id="class-metadata">
59
+
60
+
61
+
62
+
63
+
64
+ <!-- Method Quickref -->
65
+ <div id="method-list-section" class="nav-section">
66
+ <h3>Methods</h3>
67
+
68
+ <ul class="link-list" role="directory">
69
+ <li ><a href="#method-i-clear_screen">#clear_screen</a>
70
+ <li ><a href="#method-i-restore_std">#restore_std</a>
71
+ <li ><a href="#method-i-silence_std">#silence_std</a>
72
+ </ul>
73
+ </div>
74
+
75
+ </div>
76
+ </nav>
77
+
78
+ <main role="main" aria-labelledby="module-Hook::PromptSTD">
79
+ <h1 id="module-Hook::PromptSTD" class="module">
80
+ module Hook::PromptSTD
81
+ </h1>
82
+
83
+ <section class="description">
84
+
85
+ </section>
86
+
87
+ <section id="5Buntitled-5D" class="documentation-section">
88
+
89
+
90
+
91
+
92
+
93
+ <section id="public-instance-5Buntitled-5D-method-details" class="method-section">
94
+ <header>
95
+ <h3>Public Instance Methods</h3>
96
+ </header>
97
+
98
+ <div id="method-i-clear_screen" class="method-detail ">
99
+ <div class="method-heading">
100
+ <span class="method-name">clear_screen</span><span
101
+ class="method-args">(msg = nil)</span>
102
+ <span class="method-click-advice">click to toggle source</span>
103
+ </div>
104
+
105
+ <div class="method-description">
106
+ <p>Clear the terminal screen</p>
107
+
108
+ <div class="method-source-code" id="clear_screen-source">
109
+ <pre><span class="ruby-comment"># File lib/hook/prompt.rb, line 8</span>
110
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">clear_screen</span>(<span class="ruby-identifier">msg</span> = <span class="ruby-keyword">nil</span>)
111
+ <span class="ruby-identifier">puts</span> <span class="ruby-string">&quot;\e[H\e[2J&quot;</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">$stdout</span>.<span class="ruby-identifier">tty?</span>
112
+ <span class="ruby-identifier">puts</span> <span class="ruby-identifier">msg</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">msg</span>.<span class="ruby-identifier">good?</span>
113
+ <span class="ruby-keyword">end</span></pre>
114
+ </div>
115
+ </div>
116
+
117
+
118
+ </div>
119
+
120
+ <div id="method-i-restore_std" class="method-detail ">
121
+ <div class="method-heading">
122
+ <span class="method-name">restore_std</span><span
123
+ class="method-args">()</span>
124
+ <span class="method-click-advice">click to toggle source</span>
125
+ </div>
126
+
127
+ <div class="method-description">
128
+ <p>Restore silenced STDOUT and STDERR</p>
129
+
130
+ <div class="method-source-code" id="restore_std-source">
131
+ <pre><span class="ruby-comment"># File lib/hook/prompt.rb, line 26</span>
132
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">restore_std</span>
133
+ <span class="ruby-identifier">$stdout</span> = <span class="ruby-constant">STDOUT</span>
134
+ <span class="ruby-identifier">$stderr</span> = <span class="ruby-constant">STDERR</span>
135
+ <span class="ruby-keyword">end</span></pre>
136
+ </div>
137
+ </div>
138
+
139
+
140
+ </div>
141
+
142
+ <div id="method-i-silence_std" class="method-detail ">
143
+ <div class="method-heading">
144
+ <span class="method-name">silence_std</span><span
145
+ class="method-args">(file = &#39;/dev/null&#39;)</span>
146
+ <span class="method-click-advice">click to toggle source</span>
147
+ </div>
148
+
149
+ <div class="method-description">
150
+ <p>Redirect STDOUT and STDERR to /dev/null or file</p>
151
+
152
+ <p>@param file [String] a file path to redirect to</p>
153
+
154
+ <div class="method-source-code" id="silence_std-source">
155
+ <pre><span class="ruby-comment"># File lib/hook/prompt.rb, line 18</span>
156
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">silence_std</span>(<span class="ruby-identifier">file</span> = <span class="ruby-string">&#39;/dev/null&#39;</span>)
157
+ <span class="ruby-identifier">$stdout</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">file</span>, <span class="ruby-string">&#39;w&#39;</span>)
158
+ <span class="ruby-identifier">$stderr</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">file</span>, <span class="ruby-string">&#39;w&#39;</span>)
159
+ <span class="ruby-keyword">end</span></pre>
160
+ </div>
161
+ </div>
162
+
163
+
164
+ </div>
165
+
166
+ </section>
167
+
168
+ </section>
169
+ </main>
170
+
171
+
172
+ <footer id="validator-badges" role="contentinfo">
173
+ <p><a href="https://validator.w3.org/check/referer">Validate</a>
174
+ <p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.3.3.
175
+ <p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
176
+ </footer>
177
+
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">&#39;**/*&#39;</span>)
262
+ <span class="ruby-keyword">elsif</span> <span class="ruby-identifier">glob</span> <span class="ruby-operator">&amp;&amp;</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">&#39;**/*&#39;</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">&#39;**/*&#39;</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">&#39;--layout=reverse-list&#39;</span>,
272
+ <span class="ruby-string">&#39;--header=&quot;esc: cancel, return: open&quot;&#39;</span>,
273
+ <span class="ruby-string">&#39;--prompt=&quot; Select file &gt; &quot;&#39;</span>,
274
+ <span class="ruby-string">%(--preview=&#39;hook ls &quot;{2}&quot;&#39;)</span>,
275
+ <span class="ruby-string">&#39;--height=60%&#39;</span>,
276
+ <span class="ruby-string">&#39;--min-height=10&#39;</span>]
277
+
278
+ <span class="ruby-identifier">sel</span> = <span class="ruby-node">`echo #{Shellwords.escape(root.join(&quot;\n&quot;))} | &#39;#{fzf}&#39; #{args.join(&#39; &#39;)}`</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 313</span>
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 499</span>
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 &lt;&lt;&#39;APPLESCRIPT&#39;
346
387
  tell application &quot;Hook&quot;
@@ -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 336</span>
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">&quot;Are you sure you want to delete ALL hooks from #{url} (y/N)? &quot;</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 358</span>
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">&amp;</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 490</span>
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 &lt;&lt;&#39;APPLESCRIPT&#39;
456
497
  tell application &quot;Hook&quot;
@@ -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 388</span>
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 290</span>
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 407</span>
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 259</span>
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 &lt;&lt;&#39;APPLESCRIPT&#39;
683
724
  tell application &quot;Hook&quot;
@@ -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 275</span>
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 454</span>
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">&#39;&#39;</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">&#39;--delimiter=&quot;\t&quot;&#39;</span>,
948
989
  <span class="ruby-string">&#39;--with-nth=1,4&#39;</span>,
949
990
  <span class="ruby-string">&#39;--height=60%&#39;</span>,
950
- <span class="ruby-string">&#39;--min-height=10&#39;</span>
951
- ]
991
+ <span class="ruby-string">&#39;--min-height=10&#39;</span>]
952
992
 
953
993
  <span class="ruby-identifier">sel</span> = <span class="ruby-node">`echo #{Shellwords.escape(options.join(&quot;\n&quot;))} | &#39;#{fzf}&#39; #{args.join(&#39; &#39;)}`</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>] }
@@ -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.9</p>
136
+ <p>v2.0.11</p>
136
137
 
137
138
  <h3 id="label-Global+Options">Global Options<span><a href="#label-Global+Options">&para;</a> <a href="#top">&uarr;</a></span></h3>
138
139
 
@@ -146,6 +147,12 @@
146
147
 
147
148
  <h3 id="label-Commands">Commands<span><a href="#label-Commands">&para;</a> <a href="#top">&uarr;</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">&para;</a> <a href="#top">&uarr;</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">&para;</a> <a href="#top">&uarr;</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
- Thu, 26 May 2022 08:30:27 -0500
1
+ Tue, 19 Jul 2022 18:10:23 -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 Thu, 26 May 2022 08:19:39 -0500
4
+ lib/hook/hookapp.rb Tue, 19 Jul 2022 18:08:40 -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 Thu, 26 May 2022 08:29:18 -0500
10
- bin/hook Sun, 31 Oct 2021 07:54:10 -0500
9
+ lib/hook/version.rb Tue, 19 Jul 2022 18:09:46 -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.9</p>
102
+ <p>v2.0.11</p>
103
103
 
104
104
  <h3 id="label-Global+Options">Global Options<span><a href="#label-Global+Options">&para;</a> <a href="#top">&uarr;</a></span></h3>
105
105
 
@@ -113,6 +113,12 @@
113
113
 
114
114
  <h3 id="label-Commands">Commands<span><a href="#label-Commands">&para;</a> <a href="#top">&uarr;</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">&para;</a> <a href="#top">&uarr;</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">&para;</a> <a href="#top">&uarr;</a></span></h4>
117
123
 
118
124
  <p>Copy <a href="Hook.html"><code>Hook</code></a> URL for file/url to clipboard</p>
@@ -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"]]}}
Binary file
@@ -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
  &mdash;
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
+ &mdash;
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
  &mdash;
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 "{2}"'),
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Hook
4
- VERSION = '2.0.9'
4
+ VERSION = '2.0.12'
5
5
  end
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.9
4
+ version: 2.0.12
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-05-26 00:00:00.000000000 Z
11
+ date: 2022-07-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aruba
@@ -119,6 +119,9 @@ files:
119
119
  - html/GLI/Commands/Doc.html
120
120
  - html/GLI/Commands/MarkdownDocumentListener.html
121
121
  - html/Hook.html
122
+ - html/Hook/Prompt.html
123
+ - html/Hook/PromptFZF.html
124
+ - html/Hook/PromptSTD.html
122
125
  - html/HookApp.html
123
126
  - html/Hooker.html
124
127
  - html/README_rdoc.html