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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 69d899b79ca15a4966ce811c6bc083f93a1152f4a6c70611c090dbfc01d6003b
4
- data.tar.gz: '066122764283adadf0a9929659d0f9f87b136c2f3b65312a6afda34606aaa5d9'
3
+ metadata.gz: 233fe905ddbf24e32e2892b428408df0e39c2428abb2247a788cdc2430bb8112
4
+ data.tar.gz: 00c3532d26a4ceeb05e955c9eced981368ef6ea6d599f2ddbbfa8cb356299b07
5
5
  SHA512:
6
- metadata.gz: bebe816553c3b5783a5628ea4e7140f742decc5cb394e64b4d13643ba0493016c0fb9c75b98fecc9d5b069f238e22f8e9b627c282d64d4f5566c1bb39df3a7e4
7
- data.tar.gz: 01114bbe9cfb43a1d0d7573c51d041a8027bc1d98e21c96638fd3ce6fd25919d26ae0cdcab121671c09b82be2eb77db2cf462a762f9aaa6350b9a784dbc78b78
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
- ### Listing and opening hooked files/URLs
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
- You can select a hook from a menu using `hook select file1.md`, and the resulting selection will be opened in the default application for its filetype.
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, ...] TARGET'
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 }
@@ -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 =~ /^(hook|http)/
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
- false
28
+ nil
29
29
  end
30
30
  end
31
31
  end
@@ -1,3 +1,3 @@
1
1
  module Hook
2
- VERSION = '0.0.2'
2
+ VERSION = '0.0.3'
3
3
  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: 0.0.2
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-08 00:00:00.000000000 Z
11
+ date: 2020-07-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake