hookapp 2.0.5 → 2.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/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/buildnotes.md
CHANGED
@@ -27,3 +27,33 @@ Helpers and main classes are in `lib/`.
|
|
27
27
|
Update the docs with `bundle exec bin/hook _doc --format=markdown` and `bundle exec bin/hook _doc --format=rdoc`, then run `rake rerdoc`
|
28
28
|
|
29
29
|
@run(bundle exec bin/hook _doc --format=rdoc && bundle exec bin/hook _doc --format=markdown && rake rerdoc)
|
30
|
+
|
31
|
+
## Test
|
32
|
+
|
33
|
+
Run all tests using `rake test`.
|
34
|
+
|
35
|
+
Run verbose using `rake test TESTOPT="-v"`
|
36
|
+
|
37
|
+
Run a single test using `rake test TEST=test/TEST_FILE.rb`
|
38
|
+
|
39
|
+
This howzit task accepts an optional argument pointing to a specific test (just the test part of the filename, e.g. archive runs `test/doing_archive_test.rb`).
|
40
|
+
|
41
|
+
`howzit -r test -- archive` (or `bld test archive` with the Fish function)
|
42
|
+
|
43
|
+
```run
|
44
|
+
#!/bin/bash
|
45
|
+
if [[ -n $1 ]]; then
|
46
|
+
rake test TESTOPT="-v" TEST=test/hook_$1_test.rb
|
47
|
+
if [[ $? != 0 ]]; then
|
48
|
+
echo "Available tests"
|
49
|
+
echo -e "\033[1;32;40m"
|
50
|
+
FILES="test/hook_*_test.rb"
|
51
|
+
for file in $FILES; do
|
52
|
+
echo $(basename $file ".rb") | sed -E 's/hook_(.*)_test/- \1/'
|
53
|
+
done
|
54
|
+
echo -e "\033[0m"
|
55
|
+
fi
|
56
|
+
else
|
57
|
+
rake test TESTOPT="-v"
|
58
|
+
fi
|
59
|
+
```
|
data/hook.rdoc
CHANGED
@@ -1,8 +1,10 @@
|
|
1
1
|
== hook - CLI interface for Hook.app (macOS)
|
2
2
|
|
3
|
-
Hook.app is a productivity tool for macOS <https://hookproductivity.com/>.
|
3
|
+
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
|
+
|
7
|
+
v2.0.9
|
6
8
|
|
7
9
|
=== Global Options
|
8
10
|
=== --help
|
@@ -21,7 +23,7 @@ Copy Hook URL for file/url to clipboard
|
|
21
23
|
|
22
24
|
Creates a bookmark for the specified file or URL and copies its Hook URL to the clipboard.
|
23
25
|
|
24
|
-
The copied Hook URL can be used to link to other files (use `hook link --paste FILE/URL
|
26
|
+
The copied Hook URL can be used to link to other files (use `hook link --paste FILE/URL`,
|
25
27
|
or to paste into another app as a link. Use the -m flag to copy a full Markdown link.
|
26
28
|
===== Options
|
27
29
|
===== -a|--app APP_NAME
|
@@ -39,15 +41,17 @@ Copy as Markdown
|
|
39
41
|
==== Command: <tt>clone SOURCE TARGET</tt>
|
40
42
|
Clone all hooks from one file or url onto another
|
41
43
|
|
42
|
-
Copy all the files and urls that the first file is hooked to onto another file.
|
43
|
-
|
44
|
+
Copy all the files and urls that the first file is hooked to onto another file.
|
45
|
+
|
46
|
+
Exactly two arguments (SOURCE, TARGET) required.
|
47
|
+
==== Command: <tt>find|search [SEARCH_STRING]</tt>
|
44
48
|
Search bookmarks
|
45
49
|
|
46
50
|
Search bookmark urls and names for a string and output in specified format (default "paths").
|
47
51
|
|
48
52
|
Run `hook find` with no search argument to list all bookmarks.
|
49
53
|
===== Options
|
50
|
-
===== -o|--output_format
|
54
|
+
===== -o|--output_format FORMAT
|
51
55
|
|
52
56
|
Output format [(h)ooks, (p)aths, (m)arkdown, (v)erbose]
|
53
57
|
|
@@ -97,7 +101,7 @@ List commands one per line, to assist with shell completion
|
|
97
101
|
|
98
102
|
|
99
103
|
|
100
|
-
==== Command: <tt>link|ln SOURCE
|
104
|
+
==== Command: <tt>link|ln SOURCE... TARGET</tt>
|
101
105
|
Create bidirectional hooks between two or more files/urls
|
102
106
|
|
103
107
|
If two files/urls are provided, links will be bi-directional.
|
@@ -118,14 +122,14 @@ Paste URL from clipboard
|
|
118
122
|
|
119
123
|
|
120
124
|
|
121
|
-
==== Command: <tt>list|ls
|
125
|
+
==== Command: <tt>list|ls [FILE_OR_URL]...</tt>
|
122
126
|
List hooks on a file or url
|
123
127
|
|
124
128
|
Output a list of all hooks attached to given url(s) or file(s) in the specified format (default "paths").
|
125
129
|
|
126
130
|
Run `hook list` with no file/url argument to list all bookmarks.
|
127
131
|
===== Options
|
128
|
-
===== -o|--output_format
|
132
|
+
===== -o|--output_format FORMAT
|
129
133
|
|
130
134
|
Output format [(h)ooks, (p)aths, (m)arkdown, (v)erbose]
|
131
135
|
|
@@ -150,8 +154,23 @@ This option is a shortcut to `hook select` and overrides any other arguments.
|
|
150
154
|
==== Command: <tt>open|gui FILE_OR_URL</tt>
|
151
155
|
Open the specified file or url in Hook GUI
|
152
156
|
|
153
|
-
Opens Hook.app on the specified file/URL for browsing and performing actions.
|
154
|
-
|
157
|
+
Opens Hook.app on the specified file/URL for browsing and performing actions.
|
158
|
+
|
159
|
+
Exactly one argument (File/URL) required.
|
160
|
+
==== Command: <tt>percent STRING</tt>
|
161
|
+
Percent encode/decode a string
|
162
|
+
|
163
|
+
Use encode or decode to apply Hook's url encoding to a string argument. Use '-' to read input from STDIN.
|
164
|
+
===== Commands
|
165
|
+
====== Command: <tt>decode STRING</tt>
|
166
|
+
decode a percent-encoded string
|
167
|
+
|
168
|
+
|
169
|
+
====== Command: <tt>encode STRING</tt>
|
170
|
+
percent encode a string
|
171
|
+
|
172
|
+
|
173
|
+
==== Command: <tt>remove|rm FILE_OR_URL...</tt>
|
155
174
|
Remove a hook between two files/urls
|
156
175
|
|
157
176
|
Remove a hook between two files or URLs. If you use --all, all hooks on a given file will be removed.
|
@@ -163,6 +182,11 @@ Remove ALL links on files, requires confirmation
|
|
163
182
|
|
164
183
|
|
165
184
|
|
185
|
+
===== -f|--force
|
186
|
+
|
187
|
+
|
188
|
+
|
189
|
+
|
166
190
|
==== Command: <tt>scripts SHELL</tt>
|
167
191
|
Shell completion examples
|
168
192
|
|
data/hookapp.gemspec
CHANGED
data/html/App.html
CHANGED
@@ -101,7 +101,7 @@
|
|
101
101
|
|
102
102
|
<footer id="validator-badges" role="contentinfo">
|
103
103
|
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
104
|
-
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.3.
|
104
|
+
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.3.3.
|
105
105
|
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
106
106
|
</footer>
|
107
107
|
|
data/html/GLI/Commands/Doc.html
CHANGED
@@ -85,7 +85,7 @@
|
|
85
85
|
|
86
86
|
<footer id="validator-badges" role="contentinfo">
|
87
87
|
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
88
|
-
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.3.
|
88
|
+
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.3.3.
|
89
89
|
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
90
90
|
</footer>
|
91
91
|
|
@@ -136,6 +136,7 @@
|
|
136
136
|
<span class="ruby-ivar">@io</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">new</span>(<span class="ruby-string">'README.md'</span>, <span class="ruby-string">'w'</span>)
|
137
137
|
<span class="ruby-ivar">@nest</span> = <span class="ruby-string">'#'</span>
|
138
138
|
<span class="ruby-ivar">@arg_name_formatter</span> = <span class="ruby-constant">GLI</span><span class="ruby-operator">::</span><span class="ruby-constant">Commands</span><span class="ruby-operator">::</span><span class="ruby-constant">HelpModules</span><span class="ruby-operator">::</span><span class="ruby-constant">ArgNameFormatter</span>.<span class="ruby-identifier">new</span>
|
139
|
+
<span class="ruby-ivar">@parent_command</span> = []
|
139
140
|
<span class="ruby-keyword">end</span></pre>
|
140
141
|
</div>
|
141
142
|
</div>
|
@@ -161,7 +162,7 @@
|
|
161
162
|
|
162
163
|
|
163
164
|
<div class="method-source-code" id="beginning-source">
|
164
|
-
<pre><span class="ruby-comment"># File lib/hook/markdown_document_listener.rb, line
|
165
|
+
<pre><span class="ruby-comment"># File lib/hook/markdown_document_listener.rb, line 21</span>
|
165
166
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">beginning</span>
|
166
167
|
<span class="ruby-keyword">end</span></pre>
|
167
168
|
</div>
|
@@ -181,10 +182,12 @@
|
|
181
182
|
<p>Gives you a command in the current context and creates a new context of this command</p>
|
182
183
|
|
183
184
|
<div class="method-source-code" id="command-source">
|
184
|
-
<pre><span class="ruby-comment"># File lib/hook/markdown_document_listener.rb, line
|
185
|
+
<pre><span class="ruby-comment"># File lib/hook/markdown_document_listener.rb, line 118</span>
|
185
186
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">command</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">aliases</span>, <span class="ruby-identifier">desc</span>, <span class="ruby-identifier">long_desc</span>, <span class="ruby-identifier">arg_name</span>, <span class="ruby-identifier">arg_options</span>)
|
187
|
+
<span class="ruby-ivar">@parent_command</span>.<span class="ruby-identifier">push</span> ([<span class="ruby-identifier">name</span>] <span class="ruby-operator">+</span> <span class="ruby-identifier">aliases</span>).<span class="ruby-identifier">join</span>(<span class="ruby-string">'|'</span>)
|
186
188
|
<span class="ruby-identifier">arg_name_fmt</span> = <span class="ruby-ivar">@arg_name_formatter</span>.<span class="ruby-identifier">format</span>(<span class="ruby-identifier">arg_name</span>, <span class="ruby-identifier">arg_options</span>, [])
|
187
|
-
<span class="ruby-
|
189
|
+
<span class="ruby-identifier">arg_name_fmt</span> = <span class="ruby-node">" `#{arg_name_fmt.strip}`"</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">arg_name_fmt</span>
|
190
|
+
<span class="ruby-ivar">@io</span>.<span class="ruby-identifier">puts</span> <span class="ruby-identifier">header</span>(<span class="ruby-node">"`$ #{@exe}` <mark>`#{@parent_command.join(' ')}`</mark>#{arg_name_fmt}"</span>, <span class="ruby-value">1</span>)
|
188
191
|
<span class="ruby-ivar">@io</span>.<span class="ruby-identifier">puts</span>
|
189
192
|
<span class="ruby-ivar">@io</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">"*#{String(desc).strip}*"</span>
|
190
193
|
<span class="ruby-ivar">@io</span>.<span class="ruby-identifier">puts</span>
|
@@ -209,7 +212,7 @@
|
|
209
212
|
|
210
213
|
|
211
214
|
<div class="method-source-code" id="commands-source">
|
212
|
-
<pre><span class="ruby-comment"># File lib/hook/markdown_document_listener.rb, line
|
215
|
+
<pre><span class="ruby-comment"># File lib/hook/markdown_document_listener.rb, line 111</span>
|
213
216
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">commands</span>
|
214
217
|
<span class="ruby-ivar">@io</span>.<span class="ruby-identifier">puts</span> <span class="ruby-identifier">header</span>(<span class="ruby-string">"Commands"</span>, <span class="ruby-value">1</span>)
|
215
218
|
<span class="ruby-ivar">@io</span>.<span class="ruby-identifier">puts</span>
|
@@ -232,7 +235,7 @@
|
|
232
235
|
<p>Gives you the name of the current command in the current context</p>
|
233
236
|
|
234
237
|
<div class="method-source-code" id="default_command-source">
|
235
|
-
<pre><span class="ruby-comment"># File lib/hook/markdown_document_listener.rb, line
|
238
|
+
<pre><span class="ruby-comment"># File lib/hook/markdown_document_listener.rb, line 139</span>
|
236
239
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">default_command</span>(<span class="ruby-identifier">name</span>)
|
237
240
|
<span class="ruby-ivar">@io</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">"#### [Default Command] #{name}"</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">name</span>.<span class="ruby-identifier">nil?</span>
|
238
241
|
<span class="ruby-keyword">end</span></pre>
|
@@ -253,8 +256,9 @@
|
|
253
256
|
<p>Ends a command, and “pops” you back up one context</p>
|
254
257
|
|
255
258
|
<div class="method-source-code" id="end_command-source">
|
256
|
-
<pre><span class="ruby-comment"># File lib/hook/markdown_document_listener.rb, line
|
259
|
+
<pre><span class="ruby-comment"># File lib/hook/markdown_document_listener.rb, line 132</span>
|
257
260
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">end_command</span>(<span class="ruby-identifier">_name</span>)
|
261
|
+
<span class="ruby-ivar">@parent_command</span>.<span class="ruby-identifier">pop</span>
|
258
262
|
<span class="ruby-identifier">decrement_nest</span>
|
259
263
|
<span class="ruby-ivar">@io</span>.<span class="ruby-identifier">puts</span> <span class="ruby-string">"* * * * * *\n\n"</span> <span class="ruby-keyword">unless</span> <span class="ruby-ivar">@nest</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">></span> <span class="ruby-value">2</span>
|
260
264
|
<span class="ruby-keyword">end</span></pre>
|
@@ -275,7 +279,7 @@
|
|
275
279
|
|
276
280
|
|
277
281
|
<div class="method-source-code" id="end_commands-source">
|
278
|
-
<pre><span class="ruby-comment"># File lib/hook/markdown_document_listener.rb, line
|
282
|
+
<pre><span class="ruby-comment"># File lib/hook/markdown_document_listener.rb, line 143</span>
|
279
283
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">end_commands</span>
|
280
284
|
<span class="ruby-identifier">decrement_nest</span>
|
281
285
|
<span class="ruby-keyword">end</span></pre>
|
@@ -296,7 +300,7 @@
|
|
296
300
|
|
297
301
|
|
298
302
|
<div class="method-source-code" id="end_options-source">
|
299
|
-
<pre><span class="ruby-comment"># File lib/hook/markdown_document_listener.rb, line
|
303
|
+
<pre><span class="ruby-comment"># File lib/hook/markdown_document_listener.rb, line 108</span>
|
300
304
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">end_options</span>
|
301
305
|
<span class="ruby-keyword">end</span></pre>
|
302
306
|
</div>
|
@@ -316,12 +320,18 @@
|
|
316
320
|
<p>Called when processing has completed</p>
|
317
321
|
|
318
322
|
<div class="method-source-code" id="ending-source">
|
319
|
-
<pre><span class="ruby-comment"># File lib/hook/markdown_document_listener.rb, line
|
323
|
+
<pre><span class="ruby-comment"># File lib/hook/markdown_document_listener.rb, line 25</span>
|
320
324
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">ending</span>
|
321
325
|
<span class="ruby-keyword">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span>(<span class="ruby-string">'CREDITS.md'</span>)
|
322
326
|
<span class="ruby-ivar">@io</span>.<span class="ruby-identifier">puts</span> <span class="ruby-constant">IO</span>.<span class="ruby-identifier">read</span>(<span class="ruby-string">'CREDITS.md'</span>)
|
323
327
|
<span class="ruby-ivar">@io</span>.<span class="ruby-identifier">puts</span>
|
324
328
|
<span class="ruby-keyword">end</span>
|
329
|
+
|
330
|
+
<span class="ruby-keyword">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span>(<span class="ruby-string">'AUTHORS.md'</span>)
|
331
|
+
<span class="ruby-ivar">@io</span>.<span class="ruby-identifier">puts</span> <span class="ruby-constant">IO</span>.<span class="ruby-identifier">read</span>(<span class="ruby-string">'AUTHORS.md'</span>)
|
332
|
+
<span class="ruby-ivar">@io</span>.<span class="ruby-identifier">puts</span>
|
333
|
+
<span class="ruby-keyword">end</span>
|
334
|
+
|
325
335
|
<span class="ruby-keyword">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span>(<span class="ruby-string">'LICENSE.md'</span>)
|
326
336
|
<span class="ruby-ivar">@io</span>.<span class="ruby-identifier">puts</span> <span class="ruby-constant">IO</span>.<span class="ruby-identifier">read</span>(<span class="ruby-string">'LICENSE.md'</span>)
|
327
337
|
<span class="ruby-ivar">@io</span>.<span class="ruby-identifier">puts</span>
|
@@ -348,7 +358,7 @@
|
|
348
358
|
<p>Gives you a flag in the current context</p>
|
349
359
|
|
350
360
|
<div class="method-source-code" id="flag-source">
|
351
|
-
<pre><span class="ruby-comment"># File lib/hook/markdown_document_listener.rb, line
|
361
|
+
<pre><span class="ruby-comment"># File lib/hook/markdown_document_listener.rb, line 80</span>
|
352
362
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">flag</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">aliases</span>, <span class="ruby-identifier">desc</span>, <span class="ruby-identifier">long_desc</span>, <span class="ruby-identifier">default_value</span>, <span class="ruby-identifier">arg_name</span>, <span class="ruby-identifier">must_match</span>, <span class="ruby-identifier">_type</span>)
|
353
363
|
<span class="ruby-identifier">invocations</span> = ([<span class="ruby-identifier">name</span>] <span class="ruby-operator">+</span> <span class="ruby-constant">Array</span>(<span class="ruby-identifier">aliases</span>)).<span class="ruby-identifier">map</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">_</span><span class="ruby-operator">|</span> <span class="ruby-string">"`"</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">add_dashes</span>(<span class="ruby-identifier">_</span>) <span class="ruby-operator">+</span> <span class="ruby-string">"`"</span> }.<span class="ruby-identifier">join</span>(<span class="ruby-string">' | '</span>)
|
354
364
|
<span class="ruby-identifier">usage</span> = <span class="ruby-node">"#{invocations} #{arg_name || 'arg'}"</span>
|
@@ -378,7 +388,7 @@
|
|
378
388
|
|
379
389
|
|
380
390
|
<div class="method-source-code" id="options-source">
|
381
|
-
<pre><span class="ruby-comment"># File lib/hook/markdown_document_listener.rb, line
|
391
|
+
<pre><span class="ruby-comment"># File lib/hook/markdown_document_listener.rb, line 70</span>
|
382
392
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">options</span>
|
383
393
|
<span class="ruby-keyword">if</span> <span class="ruby-ivar">@nest</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">==</span> <span class="ruby-value">1</span>
|
384
394
|
<span class="ruby-ivar">@io</span>.<span class="ruby-identifier">puts</span> <span class="ruby-string">"## Global Options"</span>
|
@@ -404,7 +414,7 @@
|
|
404
414
|
<p>Gives you the program description</p>
|
405
415
|
|
406
416
|
<div class="method-source-code" id="program_desc-source">
|
407
|
-
<pre><span class="ruby-comment"># File lib/hook/markdown_document_listener.rb, line
|
417
|
+
<pre><span class="ruby-comment"># File lib/hook/markdown_document_listener.rb, line 47</span>
|
408
418
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">program_desc</span>(<span class="ruby-identifier">desc</span>)
|
409
419
|
<span class="ruby-ivar">@io</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">"# #{@exe} CLI"</span>
|
410
420
|
<span class="ruby-ivar">@io</span>.<span class="ruby-identifier">puts</span>
|
@@ -428,7 +438,7 @@
|
|
428
438
|
|
429
439
|
|
430
440
|
<div class="method-source-code" id="program_long_desc-source">
|
431
|
-
<pre><span class="ruby-comment"># File lib/hook/markdown_document_listener.rb, line
|
441
|
+
<pre><span class="ruby-comment"># File lib/hook/markdown_document_listener.rb, line 54</span>
|
432
442
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">program_long_desc</span>(<span class="ruby-identifier">desc</span>)
|
433
443
|
<span class="ruby-ivar">@io</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">"> #{desc}"</span>
|
434
444
|
<span class="ruby-ivar">@io</span>.<span class="ruby-identifier">puts</span>
|
@@ -450,13 +460,13 @@
|
|
450
460
|
<p>Gives you a switch in the current context</p>
|
451
461
|
|
452
462
|
<div class="method-source-code" id="switch-source">
|
453
|
-
<pre><span class="ruby-comment"># File lib/hook/markdown_document_listener.rb, line
|
463
|
+
<pre><span class="ruby-comment"># File lib/hook/markdown_document_listener.rb, line 94</span>
|
454
464
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">switch</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">aliases</span>, <span class="ruby-identifier">desc</span>, <span class="ruby-identifier">long_desc</span>, <span class="ruby-identifier">negatable</span>)
|
455
465
|
<span class="ruby-keyword">if</span> <span class="ruby-identifier">negatable</span>
|
456
466
|
<span class="ruby-identifier">name</span> = <span class="ruby-node">"[no-]#{name}"</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">name</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">></span> <span class="ruby-value">1</span>
|
457
467
|
<span class="ruby-identifier">aliases</span> = <span class="ruby-identifier">aliases</span>.<span class="ruby-identifier">map</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">_</span><span class="ruby-operator">|</span> <span class="ruby-identifier">_</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">></span> <span class="ruby-value">1</span> <span class="ruby-operator">?</span> <span class="ruby-node">"[no-]#{_}"</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">_</span> }
|
458
468
|
<span class="ruby-keyword">end</span>
|
459
|
-
<span class="ruby-identifier">invocations</span> = ([<span class="ruby-identifier">name</span>] <span class="ruby-operator">+</span> <span class="ruby-identifier">aliases</span>).<span class="ruby-identifier">map</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">_</span><span class="ruby-operator">|</span> <span class="ruby-string">"`"</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">add_dashes</span>(<span class="ruby-identifier">_</span>) <span class="ruby-operator">+</span> <span class="ruby-string">"`"</span> }.<span class="ruby-identifier">join</span>(<span class="ruby-string">'|'</span>)
|
469
|
+
<span class="ruby-identifier">invocations</span> = ([<span class="ruby-identifier">name</span>] <span class="ruby-operator">+</span> <span class="ruby-identifier">aliases</span>).<span class="ruby-identifier">map</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">_</span><span class="ruby-operator">|</span> <span class="ruby-string">"`"</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">add_dashes</span>(<span class="ruby-identifier">_</span>).<span class="ruby-identifier">strip</span> <span class="ruby-operator">+</span> <span class="ruby-string">"`"</span> }.<span class="ruby-identifier">join</span>(<span class="ruby-string">'|'</span>)
|
460
470
|
<span class="ruby-ivar">@io</span>.<span class="ruby-identifier">puts</span> <span class="ruby-identifier">header</span>(<span class="ruby-node">"#{invocations}"</span>, <span class="ruby-value">2</span>)
|
461
471
|
<span class="ruby-ivar">@io</span>.<span class="ruby-identifier">puts</span>
|
462
472
|
<span class="ruby-ivar">@io</span>.<span class="ruby-identifier">puts</span> <span class="ruby-constant">String</span>(<span class="ruby-identifier">desc</span>).<span class="ruby-identifier">strip</span>
|
@@ -481,7 +491,7 @@
|
|
481
491
|
<p>Gives you the program version</p>
|
482
492
|
|
483
493
|
<div class="method-source-code" id="version-source">
|
484
|
-
<pre><span class="ruby-comment"># File lib/hook/markdown_document_listener.rb, line
|
494
|
+
<pre><span class="ruby-comment"># File lib/hook/markdown_document_listener.rb, line 60</span>
|
485
495
|
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">version</span>(<span class="ruby-identifier">version</span>)
|
486
496
|
<span class="ruby-ivar">@io</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">"*v#{version}*"</span>
|
487
497
|
<span class="ruby-ivar">@io</span>.<span class="ruby-identifier">puts</span>
|
@@ -505,7 +515,7 @@
|
|
505
515
|
|
506
516
|
<footer id="validator-badges" role="contentinfo">
|
507
517
|
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
508
|
-
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.3.
|
518
|
+
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.3.3.
|
509
519
|
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
510
520
|
</footer>
|
511
521
|
|
data/html/GLI/Commands.html
CHANGED
@@ -85,7 +85,7 @@
|
|
85
85
|
|
86
86
|
<footer id="validator-badges" role="contentinfo">
|
87
87
|
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
88
|
-
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.3.
|
88
|
+
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.3.3.
|
89
89
|
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
90
90
|
</footer>
|
91
91
|
|
data/html/GLI.html
CHANGED
@@ -85,7 +85,7 @@
|
|
85
85
|
|
86
86
|
<footer id="validator-badges" role="contentinfo">
|
87
87
|
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
88
|
-
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.3.
|
88
|
+
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.3.3.
|
89
89
|
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
90
90
|
</footer>
|
91
91
|
|
data/html/Hook.html
CHANGED
@@ -94,7 +94,7 @@
|
|
94
94
|
|
95
95
|
<footer id="validator-badges" role="contentinfo">
|
96
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.
|
97
|
+
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.3.3.
|
98
98
|
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
99
99
|
</footer>
|
100
100
|
|