hookapp 2.1.2 → 2.1.3
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/.dockerignore +16 -0
- data/Gemfile.lock +2 -2
- data/README.md +42 -13
- data/bin/hook +9 -0
- data/docker-compose.test.yml +11 -0
- data/hookapp.gemspec +11 -2
- data/lib/hook/version.rb +1 -1
- data/scripts/fix_installation.sh +61 -0
- data/scripts/test_installation_docker.sh +57 -0
- metadata +10 -10
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1a9668f9397d2fb44830bdae8f053f48a129658f57dfce5d057efeef8e8108e8
|
|
4
|
+
data.tar.gz: 4bd8c06fe21cb5fc41888fbe7c6baa01b35d38e437be8f7671d86df258f6e1e0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9480ef4185b9120dcb1a5ce0ec7c8e098879d1d2445c6582b5369008152f5dbc76cf41417543a1db95e3d988475b104813307d83c41d3adbe73976c24750598d
|
|
7
|
+
data.tar.gz: 5494dbbea9930dfe2b251e4b707f0815a2871be3d35e51c1a329c2a7b364dede989225e89c5caa9cf27494bc2c965ae3a9a48b4ce4a70c7d81eda56b51071942
|
data/.dockerignore
ADDED
data/Gemfile.lock
CHANGED
|
@@ -50,14 +50,14 @@ GEM
|
|
|
50
50
|
mime-types-data (3.2022.0105)
|
|
51
51
|
multi_test (1.1.0)
|
|
52
52
|
rake (13.0.6)
|
|
53
|
-
rdoc (6.3.
|
|
53
|
+
rdoc (6.3.4.1)
|
|
54
54
|
rspec-expectations (3.11.0)
|
|
55
55
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
56
56
|
rspec-support (~> 3.11.0)
|
|
57
57
|
rspec-support (3.11.0)
|
|
58
58
|
sys-uname (1.2.2)
|
|
59
59
|
ffi (~> 1.1)
|
|
60
|
-
thor (1.
|
|
60
|
+
thor (1.4.0)
|
|
61
61
|
tty-which (0.5.0)
|
|
62
62
|
|
|
63
63
|
PLATFORMS
|
data/README.md
CHANGED
|
@@ -10,9 +10,38 @@ This gem includes a `hook` binary that allows interaction with the features of H
|
|
|
10
10
|
|
|
11
11
|
## Installation
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
**Recommended:** Install without sudo:
|
|
14
|
+
```bash
|
|
15
|
+
gem install hookapp
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
**If you encounter errors** (especially "cannot load such file" errors), you may have a broken installation. Run the fix script:
|
|
19
|
+
```bash
|
|
20
|
+
./scripts/fix_installation.sh
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Then install again:
|
|
24
|
+
```bash
|
|
25
|
+
gem install hookapp
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
**Note:** If you're on a stock Ruby install (i.e. have never installed `rvm` or `rbenv`), you may need sudo, but this can cause issues. It's better to use a Ruby version manager like `rbenv`, `rvm`, or `mise` (formerly `rtx`).
|
|
29
|
+
|
|
30
|
+
## Testing Installation
|
|
14
31
|
|
|
15
|
-
|
|
32
|
+
To test the installation in a clean Ruby 2.6 environment (simulating system Ruby):
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
./scripts/test_installation_docker.sh
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Or using docker-compose:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
docker-compose -f docker-compose.test.yml up --build
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
This will build the gem and test installation in a Docker container with Ruby 2.6, simulating the environment where users might encounter the original error.
|
|
16
45
|
|
|
17
46
|
## Usage
|
|
18
47
|
|
|
@@ -38,13 +67,13 @@ COMMANDS
|
|
|
38
67
|
find, search - Search bookmarks
|
|
39
68
|
from - Get a Hook URL for the frontmost window of an app
|
|
40
69
|
help - Shows a list of commands or help for one command
|
|
41
|
-
link, ln - Create bidirectional hooks between two or more
|
|
70
|
+
link, ln - Create bidirectional hooks between two or more
|
|
42
71
|
files/urls
|
|
43
72
|
list, ls - List hooks on a file or url
|
|
44
73
|
open, gui - Open the specified file or url in Hook GUI
|
|
45
74
|
remove, rm - Remove a hook between two files/urls
|
|
46
75
|
scripts - Shell completion examples
|
|
47
|
-
select - Select from hooks on a file/url and open in default
|
|
76
|
+
select - Select from hooks on a file/url and open in default
|
|
48
77
|
application
|
|
49
78
|
```
|
|
50
79
|
|
|
@@ -87,7 +116,7 @@ Use `hook find` (or `hook search`) and a search string to find bookmarks contain
|
|
|
87
116
|
### Shell completion
|
|
88
117
|
|
|
89
118
|
Use `hook scripts [SHELL]` to output a completion script for your specified shell (currently `bash`, `zsh`, or `fish` are available). The comment at the top of the output will guide you to install and utilize the script.
|
|
90
|
-
|
|
119
|
+
|
|
91
120
|
|
|
92
121
|
## Global Options
|
|
93
122
|
|
|
@@ -114,7 +143,7 @@ Display the program version
|
|
|
114
143
|
*Copy Hookmark URL for file/url to clipboard*
|
|
115
144
|
|
|
116
145
|
> Creates a bookmark for the specified file or URL and copies its Hookmark URL to the clipboard.
|
|
117
|
-
>
|
|
146
|
+
>
|
|
118
147
|
> The copied Hookmark URL can be used to link to other files (use `hook link --paste FILE/URL`,
|
|
119
148
|
> or to paste into another app as a link. Use the -m flag to copy a full Markdown link.
|
|
120
149
|
|
|
@@ -135,7 +164,7 @@ Copy as Markdown
|
|
|
135
164
|
*Clone all hooks from one file or url onto another*
|
|
136
165
|
|
|
137
166
|
> Copy all the files and urls that the first file is hooked to onto another file.
|
|
138
|
-
>
|
|
167
|
+
>
|
|
139
168
|
> Exactly two arguments (SOURCE, TARGET) required.
|
|
140
169
|
|
|
141
170
|
* * * * * *
|
|
@@ -145,7 +174,7 @@ Copy as Markdown
|
|
|
145
174
|
*Search bookmarks*
|
|
146
175
|
|
|
147
176
|
> Search bookmark urls and names for a string and output in specified format (default "paths").
|
|
148
|
-
>
|
|
177
|
+
>
|
|
149
178
|
> Run `hook find` with no search argument to list all bookmarks.
|
|
150
179
|
|
|
151
180
|
#### Options
|
|
@@ -176,7 +205,7 @@ Separate results with NULL separator, only applies with "paths" output for singl
|
|
|
176
205
|
|
|
177
206
|
> Specify an application by name (without '.app') to bring that app to the foreground and create a bookmark
|
|
178
207
|
> for the active document, note, task, etc., returning a Hookmark URL.
|
|
179
|
-
>
|
|
208
|
+
>
|
|
180
209
|
> Use -m to get the response as Markdown, and/or -c to copy the result directly to the clipboard.
|
|
181
210
|
|
|
182
211
|
#### Options
|
|
@@ -213,7 +242,7 @@ List commands one per line, to assist with shell completion
|
|
|
213
242
|
> If three or more are provided, `link` defaults to creating bi-directional
|
|
214
243
|
> links between each file and the last file in the list. Use `-a` to create
|
|
215
244
|
> bi-directional links between every file in the list.
|
|
216
|
-
>
|
|
245
|
+
>
|
|
217
246
|
> If using `--paste`, the URL/hook link in the clipboard will be used as one argument,
|
|
218
247
|
> to be combined with one or more file/url arguments.
|
|
219
248
|
|
|
@@ -234,7 +263,7 @@ Paste URL from clipboard
|
|
|
234
263
|
*List hooks on a file or url*
|
|
235
264
|
|
|
236
265
|
> Output a list of all hooks attached to given url(s) or file(s) in the specified format (default "paths").
|
|
237
|
-
>
|
|
266
|
+
>
|
|
238
267
|
> Run `hook list` with no file/url argument to list all bookmarks.
|
|
239
268
|
|
|
240
269
|
#### Options
|
|
@@ -266,7 +295,7 @@ Generate a menu to select hook(s) for opening
|
|
|
266
295
|
*Open the specified file or url in Hookmark GUI*
|
|
267
296
|
|
|
268
297
|
> Opens Hookmark on the specified file/URL for browsing and performing actions.
|
|
269
|
-
>
|
|
298
|
+
>
|
|
270
299
|
> Exactly one argument (File/URL) required.
|
|
271
300
|
|
|
272
301
|
* * * * * *
|
|
@@ -294,7 +323,7 @@ Generate a menu to select hook(s) for opening
|
|
|
294
323
|
*Remove a hook between two files/urls*
|
|
295
324
|
|
|
296
325
|
> Remove a hook between two files or URLs. If you use --all, all hooks on a given file will be removed.
|
|
297
|
-
>
|
|
326
|
+
>
|
|
298
327
|
> If --all isn't specified, exactly two arguments (Files/URLs) are required.
|
|
299
328
|
|
|
300
329
|
#### Options
|
data/bin/hook
CHANGED
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
#!/usr/bin/env ruby -W0
|
|
2
2
|
# frozen_string_literal: true
|
|
3
3
|
|
|
4
|
+
# Ensure rubygems is loaded
|
|
5
|
+
require 'rubygems' unless defined?(Gem)
|
|
6
|
+
|
|
7
|
+
# Add the gem's lib directory to the load path
|
|
8
|
+
# When installed, bin/hook is at: /path/to/gems/hookapp-X.X.X/bin/hook
|
|
9
|
+
# So lib is at: /path/to/gems/hookapp-X.X.X/lib
|
|
10
|
+
lib_path = File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib'))
|
|
11
|
+
$LOAD_PATH.unshift(lib_path) if File.directory?(lib_path) && !$LOAD_PATH.include?(lib_path)
|
|
12
|
+
|
|
4
13
|
require 'hook'
|
|
5
14
|
require 'shellwords'
|
|
6
15
|
|
data/hookapp.gemspec
CHANGED
|
@@ -10,12 +10,21 @@ Gem::Specification.new do |s|
|
|
|
10
10
|
s.homepage = 'https://brettterpstra.com'
|
|
11
11
|
s.platform = Gem::Platform::RUBY
|
|
12
12
|
s.summary = 'A CLI for Hook.app (macOS)'
|
|
13
|
-
s.
|
|
14
|
-
|
|
13
|
+
s.license = 'MIT'
|
|
14
|
+
# Use git ls-files if available, otherwise fall back to Dir glob
|
|
15
|
+
s.files = begin
|
|
16
|
+
if File.directory?('.git') && system('git rev-parse --git-dir > /dev/null 2>&1')
|
|
17
|
+
`git ls-files`.split("\n").reject(&:empty?)
|
|
18
|
+
else
|
|
19
|
+
Dir.glob('**/*').select { |f| File.file?(f) && !f.start_with?('.') && !f.include?('/.') }
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
s.require_paths = ['lib']
|
|
15
23
|
s.extra_rdoc_files = ['README.rdoc', 'hook.rdoc']
|
|
16
24
|
s.rdoc_options << '--title' << 'hook' << '--main' << 'README.rdoc' << '-ri'
|
|
17
25
|
s.bindir = 'bin'
|
|
18
26
|
s.executables << 'hook'
|
|
27
|
+
s.required_ruby_version = '>= 2.6.0'
|
|
19
28
|
s.add_development_dependency('aruba', '~> 0.14.14')
|
|
20
29
|
s.add_development_dependency('rake', '~> 13.0.1')
|
|
21
30
|
s.add_development_dependency('rdoc', '~> 6.3.2')
|
data/lib/hook/version.rb
CHANGED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# Fix script for broken hookapp installation
|
|
3
|
+
# This script cleans up broken system Ruby installations and provides proper installation instructions
|
|
4
|
+
|
|
5
|
+
set -e
|
|
6
|
+
|
|
7
|
+
echo "=== Hookapp Installation Fix Script ==="
|
|
8
|
+
echo ""
|
|
9
|
+
|
|
10
|
+
# Check for broken system Ruby installation
|
|
11
|
+
BROKEN_WRAPPER="/usr/local/bin/hook"
|
|
12
|
+
BROKEN_GEM_PATH="/Library/Ruby/Gems/2.6.0/gems/hookapp-2.1.2"
|
|
13
|
+
|
|
14
|
+
if [ -f "$BROKEN_WRAPPER" ]; then
|
|
15
|
+
echo "Found broken wrapper script at $BROKEN_WRAPPER"
|
|
16
|
+
echo "Removing broken wrapper script..."
|
|
17
|
+
sudo rm -f "$BROKEN_WRAPPER"
|
|
18
|
+
echo "✓ Removed broken wrapper script"
|
|
19
|
+
else
|
|
20
|
+
echo "✓ No broken wrapper script found"
|
|
21
|
+
fi
|
|
22
|
+
|
|
23
|
+
if [ -d "$BROKEN_GEM_PATH" ]; then
|
|
24
|
+
echo "Found broken gem installation at $BROKEN_GEM_PATH"
|
|
25
|
+
echo "Removing broken gem installation..."
|
|
26
|
+
sudo rm -rf "$BROKEN_GEM_PATH"
|
|
27
|
+
echo "✓ Removed broken gem installation"
|
|
28
|
+
else
|
|
29
|
+
echo "✓ No broken gem installation found"
|
|
30
|
+
fi
|
|
31
|
+
|
|
32
|
+
# Check for system Ruby gem installation
|
|
33
|
+
if sudo gem list hookapp -i >/dev/null 2>&1; then
|
|
34
|
+
echo ""
|
|
35
|
+
echo "Found hookapp installed in system Ruby"
|
|
36
|
+
echo "Uninstalling from system Ruby..."
|
|
37
|
+
sudo gem uninstall hookapp -x
|
|
38
|
+
echo "✓ Uninstalled from system Ruby"
|
|
39
|
+
else
|
|
40
|
+
echo "✓ No system Ruby installation found"
|
|
41
|
+
fi
|
|
42
|
+
|
|
43
|
+
echo ""
|
|
44
|
+
echo "=== Installation Instructions ==="
|
|
45
|
+
echo ""
|
|
46
|
+
echo "To install hookapp properly, use one of these methods:"
|
|
47
|
+
echo ""
|
|
48
|
+
echo "1. Install without sudo (recommended):"
|
|
49
|
+
echo " gem install hookapp"
|
|
50
|
+
echo ""
|
|
51
|
+
echo "2. If you must use sudo (not recommended):"
|
|
52
|
+
echo " sudo gem install hookapp"
|
|
53
|
+
echo " # Then verify installation:"
|
|
54
|
+
echo " hook --version"
|
|
55
|
+
echo ""
|
|
56
|
+
echo "3. Install from local source:"
|
|
57
|
+
echo " gem build hookapp.gemspec"
|
|
58
|
+
echo " gem install pkg/hookapp-*.gem"
|
|
59
|
+
echo ""
|
|
60
|
+
echo "After installation, verify with: hook --version"
|
|
61
|
+
echo ""
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# Test hookapp installation in a Docker container with Ruby 2.6
|
|
3
|
+
# This simulates a clean system Ruby installation
|
|
4
|
+
|
|
5
|
+
set -e
|
|
6
|
+
|
|
7
|
+
echo "=== Testing hookapp installation in Docker (Ruby 2.6) ==="
|
|
8
|
+
echo ""
|
|
9
|
+
|
|
10
|
+
# Check if Docker is available
|
|
11
|
+
if ! command -v docker &> /dev/null; then
|
|
12
|
+
echo "Error: Docker is not installed or not in PATH"
|
|
13
|
+
echo "Please install Docker: https://www.docker.com/get-started"
|
|
14
|
+
exit 1
|
|
15
|
+
fi
|
|
16
|
+
|
|
17
|
+
# Build the gem first to ensure it's ready
|
|
18
|
+
echo "Building gem..."
|
|
19
|
+
gem build hookapp.gemspec
|
|
20
|
+
echo "✓ Gem built successfully"
|
|
21
|
+
|
|
22
|
+
# Ensure pkg directory exists and gem is there
|
|
23
|
+
mkdir -p pkg
|
|
24
|
+
# Move gem to pkg if it's in the root
|
|
25
|
+
if ls hookapp-*.gem 1> /dev/null 2>&1; then
|
|
26
|
+
mv hookapp-*.gem pkg/
|
|
27
|
+
echo "✓ Gem moved to pkg/ directory"
|
|
28
|
+
else
|
|
29
|
+
echo "✓ Gem already in pkg/ directory"
|
|
30
|
+
fi
|
|
31
|
+
echo ""
|
|
32
|
+
|
|
33
|
+
# Build Docker image
|
|
34
|
+
echo "Building Docker image with Ruby 2.6..."
|
|
35
|
+
docker build -f Dockerfile.test -t hookapp-test:ruby2.6 .
|
|
36
|
+
echo "✓ Docker image built"
|
|
37
|
+
echo ""
|
|
38
|
+
|
|
39
|
+
# Run the container to test installation
|
|
40
|
+
echo "Testing installation in container..."
|
|
41
|
+
echo "---"
|
|
42
|
+
docker run --rm hookapp-test:ruby2.6
|
|
43
|
+
echo "---"
|
|
44
|
+
echo ""
|
|
45
|
+
|
|
46
|
+
# Test with sudo simulation (install as root in container)
|
|
47
|
+
echo "Testing installation as root (simulating sudo)..."
|
|
48
|
+
echo "---"
|
|
49
|
+
docker run --rm hookapp-test:ruby2.6 sh -c "gem install hookapp-*.gem && hook --version && hook help"
|
|
50
|
+
echo "---"
|
|
51
|
+
echo ""
|
|
52
|
+
|
|
53
|
+
echo "✓ All tests completed!"
|
|
54
|
+
echo ""
|
|
55
|
+
echo "To manually inspect the container:"
|
|
56
|
+
echo " docker run -it --rm hookapp-test:ruby2.6 /bin/bash"
|
|
57
|
+
|
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: hookapp
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.1.
|
|
4
|
+
version: 2.1.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Brett Terpstra
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: aruba
|
|
@@ -86,7 +85,6 @@ dependencies:
|
|
|
86
85
|
- - ">="
|
|
87
86
|
- !ruby/object:Gem::Version
|
|
88
87
|
version: 0.5.0
|
|
89
|
-
description:
|
|
90
88
|
email: me@brettterpstra.com
|
|
91
89
|
executables:
|
|
92
90
|
- hook
|
|
@@ -95,6 +93,7 @@ extra_rdoc_files:
|
|
|
95
93
|
- README.rdoc
|
|
96
94
|
- hook.rdoc
|
|
97
95
|
files:
|
|
96
|
+
- ".dockerignore"
|
|
98
97
|
- ".gitignore"
|
|
99
98
|
- AUTHORS.md
|
|
100
99
|
- CHANGELOG.md
|
|
@@ -108,6 +107,7 @@ files:
|
|
|
108
107
|
- Rakefile
|
|
109
108
|
- bin/hook
|
|
110
109
|
- buildnotes.md
|
|
110
|
+
- docker-compose.test.yml
|
|
111
111
|
- features/hook.feature
|
|
112
112
|
- features/step_definitions/hook_steps.rb
|
|
113
113
|
- features/support/env.rb
|
|
@@ -181,6 +181,8 @@ files:
|
|
|
181
181
|
- lib/hook/prompt.rb
|
|
182
182
|
- lib/hook/string.rb
|
|
183
183
|
- lib/hook/version.rb
|
|
184
|
+
- scripts/fix_installation.sh
|
|
185
|
+
- scripts/test_installation_docker.sh
|
|
184
186
|
- test/helpers/hook-helpers.rb
|
|
185
187
|
- test/hook_clip_test.rb
|
|
186
188
|
- test/hook_clone_test.rb
|
|
@@ -191,9 +193,9 @@ files:
|
|
|
191
193
|
- test/hook_scripts_test.rb
|
|
192
194
|
- test/test_helper.rb
|
|
193
195
|
homepage: https://brettterpstra.com
|
|
194
|
-
licenses:
|
|
196
|
+
licenses:
|
|
197
|
+
- MIT
|
|
195
198
|
metadata: {}
|
|
196
|
-
post_install_message:
|
|
197
199
|
rdoc_options:
|
|
198
200
|
- "--title"
|
|
199
201
|
- hook
|
|
@@ -202,20 +204,18 @@ rdoc_options:
|
|
|
202
204
|
- "-ri"
|
|
203
205
|
require_paths:
|
|
204
206
|
- lib
|
|
205
|
-
- lib
|
|
206
207
|
required_ruby_version: !ruby/object:Gem::Requirement
|
|
207
208
|
requirements:
|
|
208
209
|
- - ">="
|
|
209
210
|
- !ruby/object:Gem::Version
|
|
210
|
-
version:
|
|
211
|
+
version: 2.6.0
|
|
211
212
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
212
213
|
requirements:
|
|
213
214
|
- - ">="
|
|
214
215
|
- !ruby/object:Gem::Version
|
|
215
216
|
version: '0'
|
|
216
217
|
requirements: []
|
|
217
|
-
rubygems_version: 3.
|
|
218
|
-
signing_key:
|
|
218
|
+
rubygems_version: 3.6.7
|
|
219
219
|
specification_version: 4
|
|
220
220
|
summary: A CLI for Hook.app (macOS)
|
|
221
221
|
test_files: []
|