hookapp 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +21 -3
- data/bin/hook +2 -2
- data/lib/hook/hooker.rb +2 -2
- data/lib/hook/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 233fe905ddbf24e32e2892b428408df0e39c2428abb2247a788cdc2430bb8112
|
4
|
+
data.tar.gz: 00c3532d26a4ceeb05e955c9eced981368ef6ea6d599f2ddbbfa8cb356299b07
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cc7557096f48961b2a7a4d63b1ad5af319d86e1f36565b0148eb28edbb3684733b270a0d70bfb2db52a4b9bed339c5dc7fe3ee891126b5180a6b85037296b344
|
7
|
+
data.tar.gz: '09559ad538c6daacccc48198b07b699533891d98ba18c2f0f8de222784e6696ab71cdb4b8b0f8a7f67b69f08d2afbfe0495cda250ff09fa03a895ed01d53cb91'
|
data/README.md
CHANGED
@@ -4,7 +4,9 @@ A CLI for Hook.app on macOS.
|
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
7
|
-
`gem install hookapp
|
7
|
+
`gem install hookapp`.
|
8
|
+
|
9
|
+
If you're on a stock Ruby install (i.e. have never installed `rvm` or `rbenv`), you may need sudo and your system password: `sudo gem install hookapp`.
|
8
10
|
|
9
11
|
## Usage
|
10
12
|
|
@@ -41,8 +43,24 @@ Run `hook help COMMAND` on any of the commands for more details.
|
|
41
43
|
|
42
44
|
The `link` command always creates bidirectional hooks. Give it two or more files or urls and it will create links between them. By default it links all files to the last file in the list. Add the `--all` flag to link all files to every other file in the list. This can be abbreviated as `hook ln -a file1.md file2.pdf "https://brettterpstra.com"`.
|
43
45
|
|
44
|
-
|
46
|
+
Similar to the way you would use the GUI, you can use `hook clip file1.md` to copy a Hook URL to the clipboard, and then use `hook ln -p file2.pdf` to create a link from the clipboard to `file2.pdf`.
|
47
|
+
|
48
|
+
You can also clone all of the links on one file to another, great for adding a new file to a group that's fully crosslinked. Just use `hook clone file1.md file2.pdf`. This command is abbreviated as `cp`.
|
49
|
+
|
50
|
+
### Listing hooks
|
45
51
|
|
46
52
|
Use the `list` (aliased as `ls`) command to list all attached hooks for a file. With no output format specified, `ls` will show the paths to all hooks, or the hook url if the hook doesn't have a file path (e.g. a URL). You can specify an output format using `--output_format` (abbreviated as `-o`) with one of "markdown", "hooks", "paths", or "verbose". Formats can be abbreviated to their first letter, so to display a Markdown list of all hooked files, use `hook ls -o m file1.md`.
|
47
53
|
|
48
|
-
|
54
|
+
### Removing hooks
|
55
|
+
|
56
|
+
Use `hook remove file1.md file2.pdf` to remove the bidirectional link between `file1.md` and `file2.pdf`. Add the `--all` flag (abbr. `-a`) with one or more files to remove ALL the hooks on them. This option requires confirmation.
|
57
|
+
|
58
|
+
#### Super nerdy scripting trick
|
59
|
+
|
60
|
+
The `--output_format=paths` option (abbr. `-o p`) combined with the `--files_only` flag (abbr. `-f`) will list just the paths and only include hooks that have file paths (i.e. exclude web, email, and other URLs). This can be combined with `--null` to output the list using a NULL separator, perfect for use with `xargs` or other command line tools.
|
61
|
+
|
62
|
+
### Acting on hooks
|
63
|
+
|
64
|
+
You can open a hooked file or URL by running `hook select file1.md`. This will display a menu of all the hooks on `file1.md`, and entering the number of a selection will open that file in its default application.
|
65
|
+
|
66
|
+
You can also open a file in the Hook GUI using `hook open file1.md`.
|
data/bin/hook
CHANGED
@@ -26,7 +26,7 @@ class App
|
|
26
26
|
# flag [:f,:flagname]
|
27
27
|
|
28
28
|
desc 'List hooks on a file or url'
|
29
|
-
arg_name 'FILE_OR_URL [FILE_OR_URL
|
29
|
+
arg_name 'FILE_OR_URL [FILE_OR_URL...]'
|
30
30
|
command %i[list ls] do |c|
|
31
31
|
c.desc 'Output only bookmarks with file paths (exclude e.g. emails)'
|
32
32
|
c.switch %i[f files_only], { negatable: false, default_value: false }
|
@@ -52,7 +52,7 @@ class App
|
|
52
52
|
end
|
53
53
|
|
54
54
|
desc 'Create bidirectional hooks between two or more files/urls'
|
55
|
-
arg_name 'SOURCE [SOURCE
|
55
|
+
arg_name 'SOURCE [SOURCE...] TARGET'
|
56
56
|
command %i[link ln] do |c|
|
57
57
|
c.desc 'Link every listed file or url to every other'
|
58
58
|
c.switch %i[a all], { negatable: false, default_value: false }
|
data/lib/hook/hooker.rb
CHANGED
@@ -18,14 +18,14 @@ class String
|
|
18
18
|
def valid_hook
|
19
19
|
if File.exist?(self)
|
20
20
|
File.expand_path(self)
|
21
|
-
elsif self =~
|
21
|
+
elsif self =~ /\S+:\/\//
|
22
22
|
self
|
23
23
|
else
|
24
24
|
if self =~ /^\[.*?\]\((.*?)\)$/
|
25
25
|
mdlink = $1
|
26
26
|
mdlink.valid_hook
|
27
27
|
else
|
28
|
-
|
28
|
+
nil
|
29
29
|
end
|
30
30
|
end
|
31
31
|
end
|
data/lib/hook/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hookapp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brett Terpstra
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-07-
|
11
|
+
date: 2020-07-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|