hookapp 2.0.3 → 2.0.8

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.
Files changed (59) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/AUTHORS.md +4 -0
  4. data/CHANGELOG.md +5 -0
  5. data/Gemfile.lock +49 -66
  6. data/LICENSE +21 -0
  7. data/README.md +52 -19
  8. data/Rakefile +7 -3
  9. data/bin/hook +114 -78
  10. data/buildnotes.md +30 -0
  11. data/hook.rdoc +35 -11
  12. data/hookapp.gemspec +2 -2
  13. data/html/App.html +6 -18
  14. data/html/GLI/Commands/Doc.html +2 -10
  15. data/html/GLI/Commands/MarkdownDocumentListener.html +34 -230
  16. data/html/GLI/Commands.html +2 -10
  17. data/html/GLI.html +2 -10
  18. data/html/Hook.html +2 -15
  19. data/html/HookApp.html +99 -319
  20. data/html/Hooker.html +46 -24
  21. data/html/README_rdoc.html +49 -23
  22. data/html/String.html +28 -120
  23. data/html/created.rid +8 -8
  24. data/html/css/rdoc.css +21 -1
  25. data/html/index.html +38 -29
  26. data/html/js/navigation.js.gz +0 -0
  27. data/html/js/search_index.js +1 -1
  28. data/html/js/search_index.js.gz +0 -0
  29. data/html/js/searcher.js.gz +0 -0
  30. data/html/table_of_contents.html +33 -77
  31. data/lib/helpers/fuzzyfilefinder +0 -0
  32. data/lib/hook/hookapp.rb +39 -21
  33. data/lib/hook/hooker.rb +5 -2
  34. data/lib/hook/markdown_document_listener.rb +12 -2
  35. data/lib/hook/string.rb +4 -0
  36. data/lib/hook/version.rb +1 -1
  37. data/lib/hook.rb +5 -4
  38. data/test/helpers/hook-helpers.rb +76 -0
  39. data/test/hook_clip_test.rb +24 -0
  40. data/test/hook_clone_test.rb +30 -0
  41. data/test/hook_encode_test.rb +30 -0
  42. data/test/hook_link_test.rb +39 -0
  43. data/test/hook_list_test.rb +25 -0
  44. data/test/hook_remove_test.rb +34 -0
  45. data/test/hook_scripts_test.rb +21 -0
  46. metadata +19 -22
  47. data/test/default_test.rb +0 -14
  48. data/test/hookfiles/01.test +0 -0
  49. data/test/hookfiles/02.test +0 -0
  50. data/test/hookfiles/03.test +0 -0
  51. data/test/hookfiles/04.test +0 -0
  52. data/test/hookfiles/05.test +0 -0
  53. data/test/hookfiles/06.test +0 -0
  54. data/test/hookfiles/07.test +0 -0
  55. data/test/hookfiles/08.test +0 -0
  56. data/test/hookfiles/09.test +0 -0
  57. data/test/hookfiles/10.test +0 -0
  58. data/test/hookfiles/11.test +0 -0
  59. data/test/hookfiles/12.test +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 140e12bcd6c966d67987a6e9d43720e375857fb3020187909c99e36768be2d20
4
- data.tar.gz: 0ef610377cc5663ea2541e99b0151ca6d57b141e450718fa949631b13ec1765a
3
+ metadata.gz: 17971d6f699aa3ec68b8b4d9903b112858c04484747c15117cea24b90839a4c9
4
+ data.tar.gz: 3b4551d1d1553e4c70129341848584a1542bc4af7c00e2cacb1dd6bf540bf514
5
5
  SHA512:
6
- metadata.gz: ab3a1efee12abc0a04c324ddeae36aea9f2482b4ef5dcf9932432009160f574fac6d2162ca099e4f6ac91a621651977d3ea5125af69bef133b5c4762ee4b68a8
7
- data.tar.gz: ab2aef4f340692d566116248a89f70587f50e93f6c2222fd48f6f1b7253b3e06123383b3cb5090679f126c238bed5f992a8164574f0a8df98ab1c39c82d80b87
6
+ metadata.gz: ad634683684e623978d4b60ad22beea237e228ae9ff3dc999e50e0083e2eba59b192a9e928e26057082d23124e2714c7f41b68ebb0ab68320239611959c521b9
7
+ data.tar.gz: 336ee727add0a904bbf81a97e4327596e0936af32dd7bb66b6cf580ba9d35828212ee7c18a1ec8d87841c1edd7a20d1c30e24f8f2d7803bdcc8dd66986dd3f92
data/.gitignore CHANGED
@@ -2,3 +2,4 @@
2
2
  pkg
3
3
  vendor
4
4
  *.bak
5
+ /results.html
data/AUTHORS.md ADDED
@@ -0,0 +1,4 @@
1
+ ## Authors
2
+
3
+ - Brett Terpstra <me@brettterpstra.com>
4
+ - Josh Nichols <joshua.nichols@gmail.com>
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ #### 2.0.8
2
+
3
+ - Bug fixes
4
+ - New tests
5
+
1
6
  #### 2.0.3
2
7
 
3
8
  - Incorporate `fzf` for selecting and filtering hooks
data/Gemfile.lock CHANGED
@@ -1,18 +1,12 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- hookapp (2.0.3)
5
- gli (= 2.19.0)
4
+ hookapp (2.0.7)
5
+ gli (~> 2.20.1)
6
6
 
7
7
  GEM
8
8
  remote: http://rubygems.org/
9
9
  specs:
10
- activesupport (6.0.3.2)
11
- concurrent-ruby (~> 1.0, >= 1.0.2)
12
- i18n (>= 0.7, < 2)
13
- minitest (~> 5.1)
14
- tzinfo (~> 1.1)
15
- zeitwerk (~> 2.2, >= 2.2.2)
16
10
  aruba (0.14.14)
17
11
  childprocess (>= 0.6.3, < 4.0.0)
18
12
  contracts (~> 0.9)
@@ -22,65 +16,54 @@ GEM
22
16
  thor (>= 0.19, < 2.0)
23
17
  builder (3.2.4)
24
18
  childprocess (3.0.0)
25
- concurrent-ruby (1.1.6)
26
- contracts (0.16.0)
27
- cucumber (4.1.0)
28
- builder (~> 3.2, >= 3.2.3)
29
- cucumber-core (~> 7.1, >= 7.1.0)
30
- cucumber-create-meta (~> 1.0.0, >= 1.0.0)
31
- cucumber-cucumber-expressions (~> 10.1, >= 10.1.0)
32
- cucumber-gherkin (~> 14.0, >= 14.0.1)
33
- cucumber-html-formatter (~> 7.0, >= 7.0.0)
34
- cucumber-messages (~> 12.2, >= 12.2.0)
35
- cucumber-wire (~> 3.1, >= 3.1.0)
36
- diff-lcs (~> 1.3, >= 1.3, < 1.4)
19
+ contracts (0.17)
20
+ cucumber (7.0.0)
21
+ builder (~> 3.2, >= 3.2.4)
22
+ cucumber-core (~> 10.0, >= 10.0.1)
23
+ cucumber-create-meta (~> 6.0, >= 6.0.1)
24
+ cucumber-cucumber-expressions (~> 12.1, >= 12.1.1)
25
+ cucumber-gherkin (~> 20.0, >= 20.0.1)
26
+ cucumber-html-formatter (~> 16.0, >= 16.0.1)
27
+ cucumber-messages (~> 17.0, >= 17.0.1)
28
+ cucumber-wire (~> 6.0, >= 6.0.1)
29
+ diff-lcs (~> 1.4, >= 1.4.4)
30
+ mime-types (~> 3.3, >= 3.3.1)
37
31
  multi_test (~> 0.1, >= 0.1.2)
38
- sys-uname (~> 1.0, >= 1.0.2)
39
- cucumber-core (7.1.0)
40
- cucumber-gherkin (~> 14.0, >= 14.0.1)
41
- cucumber-messages (~> 12.2, >= 12.2.0)
42
- cucumber-tag-expressions (~> 2.0, >= 2.0.4)
43
- cucumber-create-meta (1.0.0)
44
- cucumber-messages (~> 12.2, >= 12.2.0)
45
- sys-uname (~> 1.2, >= 1.2.1)
46
- cucumber-cucumber-expressions (10.2.1)
47
- cucumber-gherkin (14.0.1)
48
- cucumber-messages (~> 12.2, >= 12.2.0)
49
- cucumber-html-formatter (7.0.0)
50
- cucumber-messages (~> 12.2, >= 12.2.0)
51
- cucumber-messages (12.2.0)
52
- protobuf-cucumber (~> 3.10, >= 3.10.8)
53
- cucumber-tag-expressions (2.0.4)
54
- cucumber-wire (3.1.0)
55
- cucumber-core (~> 7.1, >= 7.1.0)
56
- cucumber-cucumber-expressions (~> 10.1, >= 10.1.0)
57
- cucumber-messages (~> 12.2, >= 12.2.0)
58
- diff-lcs (1.3)
59
- ffi (1.13.1)
60
- gli (2.19.0)
61
- i18n (1.8.3)
62
- concurrent-ruby (~> 1.0)
63
- middleware (0.1.0)
64
- minitest (5.14.1)
32
+ sys-uname (~> 1.2, >= 1.2.2)
33
+ cucumber-core (10.0.1)
34
+ cucumber-gherkin (~> 20.0, >= 20.0.1)
35
+ cucumber-messages (~> 17.0, >= 17.0.1)
36
+ cucumber-tag-expressions (~> 3.0, >= 3.0.1)
37
+ cucumber-create-meta (6.0.1)
38
+ cucumber-messages (~> 17.0, >= 17.0.1)
39
+ sys-uname (~> 1.2, >= 1.2.2)
40
+ cucumber-cucumber-expressions (12.1.3)
41
+ cucumber-gherkin (20.0.1)
42
+ cucumber-messages (~> 17.0, >= 17.0.1)
43
+ cucumber-html-formatter (16.0.1)
44
+ cucumber-messages (~> 17.0, >= 17.0.1)
45
+ cucumber-messages (17.1.1)
46
+ cucumber-tag-expressions (3.0.1)
47
+ cucumber-wire (6.1.1)
48
+ cucumber-core (~> 10.0, >= 10.0.1)
49
+ cucumber-cucumber-expressions (~> 12.1, >= 12.1.2)
50
+ cucumber-messages (~> 17.0, >= 17.0.1)
51
+ diff-lcs (1.4.4)
52
+ ffi (1.15.4)
53
+ gli (2.20.1)
54
+ mime-types (3.3.1)
55
+ mime-types-data (~> 3.2015)
56
+ mime-types-data (3.2021.0901)
65
57
  multi_test (0.1.2)
66
- protobuf-cucumber (3.10.8)
67
- activesupport (>= 3.2)
68
- middleware
69
- thor
70
- thread_safe
71
- rake (13.0.1)
72
- rdoc (6.1.2)
73
- rspec-expectations (3.9.2)
58
+ rake (13.0.6)
59
+ rdoc (6.3.2)
60
+ rspec-expectations (3.10.1)
74
61
  diff-lcs (>= 1.2.0, < 2.0)
75
- rspec-support (~> 3.9.0)
76
- rspec-support (3.9.3)
77
- sys-uname (1.2.1)
78
- ffi (>= 1.0.0)
79
- thor (1.0.1)
80
- thread_safe (0.3.6)
81
- tzinfo (1.2.7)
82
- thread_safe (~> 0.1)
83
- zeitwerk (2.3.1)
62
+ rspec-support (~> 3.10.0)
63
+ rspec-support (3.10.2)
64
+ sys-uname (1.2.2)
65
+ ffi (~> 1.1)
66
+ thor (1.1.0)
84
67
 
85
68
  PLATFORMS
86
69
  ruby
@@ -89,7 +72,7 @@ DEPENDENCIES
89
72
  aruba (~> 0.14.14)
90
73
  hookapp!
91
74
  rake (~> 13.0.1)
92
- rdoc (~> 6.1.2)
75
+ rdoc (~> 6.3.2)
93
76
 
94
77
  BUNDLED WITH
95
- 2.1.4
78
+ 2.2.24
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2021 Brett Terpstra
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/README.md CHANGED
@@ -2,9 +2,11 @@
2
2
 
3
3
  CLI interface for Hook.app (macOS)
4
4
 
5
- > Hook.app is a productivity tool for macOS <https://hookproductivity.com/>. This gem includes a `hook` binary that allows interaction with the features of Hook.app.
5
+ > Hook.app is a productivity tool for macOS <https://hookproductivity.com/>.
6
6
 
7
- *v2.0.3*
7
+ This gem includes a `hook` binary that allows interaction with the features of Hook.app.
8
+
9
+ *v2.0.7*
8
10
 
9
11
  ## Installation
10
12
 
@@ -99,13 +101,13 @@ Display the program version
99
101
 
100
102
  ## Commands
101
103
 
102
- ### `$ hook` <mark>`clip|cp`</mark> ` FILE_OR_URL`
104
+ ### `$ hook` <mark>`clip|cp`</mark> `FILE_OR_URL`
103
105
 
104
106
  *Copy Hook URL for file/url to clipboard*
105
107
 
106
108
  > Creates a bookmark for the specified file or URL and copies its Hook URL to the clipboard.
107
109
  >
108
- > The copied Hook URL can be used to link to other files (use `hook link --paste FILE/URL),
110
+ > The copied Hook URL can be used to link to other files (use `hook link --paste FILE/URL`,
109
111
  > or to paste into another app as a link. Use the -m flag to copy a full Markdown link.
110
112
 
111
113
  #### Options
@@ -120,15 +122,17 @@ Copy as Markdown
120
122
 
121
123
  * * * * * *
122
124
 
123
- ### `$ hook` <mark>`clone`</mark> ` SOURCE TARGET`
125
+ ### `$ hook` <mark>`clone`</mark> `SOURCE TARGET`
124
126
 
125
127
  *Clone all hooks from one file or url onto another*
126
128
 
127
- > Copy all the files and urls that the first file is hooked to onto another file. Exactly two arguments (SOURCE, TARGET) required.
129
+ > Copy all the files and urls that the first file is hooked to onto another file.
130
+ >
131
+ > Exactly two arguments (SOURCE, TARGET) required.
128
132
 
129
133
  * * * * * *
130
134
 
131
- ### `$ hook` <mark>`find|search`</mark> ` SEARCH_STRING`
135
+ ### `$ hook` <mark>`find|search`</mark> `[SEARCH_STRING]`
132
136
 
133
137
  *Search bookmarks*
134
138
 
@@ -138,7 +142,7 @@ Copy as Markdown
138
142
 
139
143
  #### Options
140
144
 
141
- ##### `-o` | `--output_format` format
145
+ ##### `-o` | `--output_format` FORMAT
142
146
 
143
147
  Output format [(h)ooks, (p)aths, (m)arkdown, (v)erbose]
144
148
 
@@ -158,7 +162,7 @@ Separate results with NULL separator, only applies with "paths" output for singl
158
162
 
159
163
  * * * * * *
160
164
 
161
- ### `$ hook` <mark>`from`</mark> ` APPLICATION_NAME`
165
+ ### `$ hook` <mark>`from`</mark> `APPLICATION_NAME`
162
166
 
163
167
  *Get a Hook URL for the frontmost window of an app*
164
168
 
@@ -179,7 +183,7 @@ Output as Markdown
179
183
 
180
184
  * * * * * *
181
185
 
182
- ### `$ hook` <mark>`help`</mark> ` command`
186
+ ### `$ hook` <mark>`help`</mark> `command`
183
187
 
184
188
  *Shows a list of commands or help for one command*
185
189
 
@@ -193,7 +197,7 @@ List commands one per line, to assist with shell completion
193
197
 
194
198
  * * * * * *
195
199
 
196
- ### `$ hook` <mark>`link|ln`</mark> ` SOURCE [SOURCE...] TARGET`
200
+ ### `$ hook` <mark>`link|ln`</mark> `SOURCE... TARGET`
197
201
 
198
202
  *Create bidirectional hooks between two or more files/urls*
199
203
 
@@ -217,7 +221,7 @@ Paste URL from clipboard
217
221
 
218
222
  * * * * * *
219
223
 
220
- ### `$ hook` <mark>`list|ls`</mark> ` FILE_OR_URL [FILE_OR_URL...]`
224
+ ### `$ hook` <mark>`list|ls`</mark> `[FILE_OR_URL]...`
221
225
 
222
226
  *List hooks on a file or url*
223
227
 
@@ -227,7 +231,7 @@ Paste URL from clipboard
227
231
 
228
232
  #### Options
229
233
 
230
- ##### `-o` | `--output_format` format
234
+ ##### `-o` | `--output_format` FORMAT
231
235
 
232
236
  Output format [(h)ooks, (p)aths, (m)arkdown, (v)erbose]
233
237
 
@@ -249,15 +253,35 @@ Generate a menu to select hook(s) for opening
249
253
 
250
254
  * * * * * *
251
255
 
252
- ### `$ hook` <mark>`open|gui`</mark> ` FILE_OR_URL`
256
+ ### `$ hook` <mark>`open|gui`</mark> `FILE_OR_URL`
253
257
 
254
258
  *Open the specified file or url in Hook GUI*
255
259
 
256
- > Opens Hook.app on the specified file/URL for browsing and performing actions. Exactly one argument (File/URL) required.
260
+ > Opens Hook.app on the specified file/URL for browsing and performing actions.
261
+ >
262
+ > Exactly one argument (File/URL) required.
263
+
264
+ * * * * * *
265
+
266
+ ### `$ hook` <mark>`percent`</mark> `STRING`
267
+
268
+ *Percent encode/decode a string*
269
+
270
+ > Use encode or decode to apply Hook's url encoding to a string argument. Use '-' to read input from STDIN.
271
+
272
+ #### Commands
273
+
274
+ ##### `$ hook` <mark>`percent decode`</mark> `STRING`
275
+
276
+ *decode a percent-encoded string*
277
+
278
+ ##### `$ hook` <mark>`percent encode`</mark> `STRING`
279
+
280
+ *percent encode a string*
257
281
 
258
282
  * * * * * *
259
283
 
260
- ### `$ hook` <mark>`remove|rm`</mark> ` ITEM_1 ITEM_2`
284
+ ### `$ hook` <mark>`remove|rm`</mark> `FILE_OR_URL...`
261
285
 
262
286
  *Remove a hook between two files/urls*
263
287
 
@@ -271,9 +295,13 @@ Generate a menu to select hook(s) for opening
271
295
 
272
296
  Remove ALL links on files, requires confirmation
273
297
 
298
+ ##### `-f`|`--force`
299
+
300
+
301
+
274
302
  * * * * * *
275
303
 
276
- ### `$ hook` <mark>`scripts`</mark> ` SHELL`
304
+ ### `$ hook` <mark>`scripts`</mark> `SHELL`
277
305
 
278
306
  *Shell completion examples*
279
307
 
@@ -281,7 +309,7 @@ Remove ALL links on files, requires confirmation
281
309
 
282
310
  * * * * * *
283
311
 
284
- ### `$ hook` <mark>`select`</mark> ` FILE_OR_URL`
312
+ ### `$ hook` <mark>`select`</mark> `FILE_OR_URL`
285
313
 
286
314
  *Select from hooks on a file/url and open in default application*
287
315
 
@@ -292,6 +320,11 @@ Remove ALL links on files, requires confirmation
292
320
  * * * * * *
293
321
 
294
322
  #### [Default Command] help
323
+ ## Authors
324
+
325
+ - Brett Terpstra <me@brettterpstra.com>
326
+ - Josh Nichols <joshua.nichols@gmail.com>
327
+
295
328
  ## Credits
296
329
 
297
330
  HookApp embeds [Fuzzy Finder](https://github.com/junegunn/fzf) under the [MIT License](https://github.com/junegunn/fzf/blob/master/LICENSE)
@@ -325,5 +358,5 @@ This software is licensed under the MIT License.
325
358
  THE SOFTWARE.
326
359
 
327
360
 
328
- Documentation generated 2020-11-11 09:29
361
+ Documentation generated 2021-09-26 07:50
329
362
 
data/Rakefile CHANGED
@@ -4,6 +4,7 @@ require 'rubygems/package_task'
4
4
  require 'rdoc/task'
5
5
  require 'cucumber'
6
6
  require 'cucumber/rake/task'
7
+ require 'rake/testtask'
7
8
  Rake::RDocTask.new do |rd|
8
9
  rd.main = "README.rdoc"
9
10
  rd.rdoc_files.include("README.rdoc","lib/**/*.rb","bin/**/*")
@@ -14,6 +15,7 @@ spec = eval(File.read('hookapp.gemspec'))
14
15
 
15
16
  Gem::PackageTask.new(spec) do |pkg|
16
17
  end
18
+
17
19
  CUKE_RESULTS = 'results.html'
18
20
  CLEAN << CUKE_RESULTS
19
21
  desc 'Run features'
@@ -35,10 +37,12 @@ end
35
37
  task :cucumber => :features
36
38
  task 'cucumber:wip' => 'features:wip'
37
39
  task :wip => 'features:wip'
38
- require 'rake/testtask'
40
+
39
41
  Rake::TestTask.new do |t|
40
- t.libs << "test"
42
+ t.libs << ['test', 'test/helpers']
41
43
  t.test_files = FileList['test/*_test.rb']
44
+ t.verbose = ENV['VERBOSE'] =~ /(true|1)/i ? true : false
42
45
  end
43
46
 
44
- task :default => [:test,:features]
47
+ # task :default => [:test,:features]
48
+ task :default => [:test]