hookapp 2.1.1 → 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 +10 -1
- data/docker-compose.test.yml +11 -0
- data/hookapp.gemspec +12 -3
- data/html/App.html +36 -24
- data/html/GLI/Commands/Doc.html +55 -19
- data/html/GLI/Commands/MarkdownDocumentListener.html +309 -151
- data/html/GLI/Commands.html +49 -19
- data/html/GLI.html +33 -19
- data/html/Hook/Prompt.html +50 -20
- data/html/Hook/PromptFZF.html +129 -69
- data/html/Hook/PromptSTD.html +104 -52
- data/html/Hook.html +34 -19
- data/html/HookApp.html +487 -265
- data/html/Hooker.html +60 -42
- data/html/Object.html +36 -23
- data/html/README_rdoc.html +180 -75
- data/html/String.html +185 -103
- data/html/created.rid +10 -10
- data/html/css/rdoc.css +402 -358
- data/html/fonts/SourceCodePro-Bold.ttf +0 -0
- data/html/fonts/SourceCodePro-Regular.ttf +0 -0
- data/html/index.html +193 -45
- data/html/js/darkfish.js +38 -2
- data/html/js/navigation.js +8 -8
- data/html/js/navigation.js.gz +0 -0
- data/html/js/search.js +4 -4
- 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 +52 -8
- data/lib/hook/hookapp.rb +8 -4
- 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
data/html/table_of_contents.html
CHANGED
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
<!DOCTYPE html>
|
|
2
2
|
|
|
3
|
-
<html>
|
|
3
|
+
<html lang="en">
|
|
4
4
|
<head>
|
|
5
5
|
<meta charset="UTF-8">
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
6
7
|
|
|
7
8
|
<title>Table of Contents - hookapp</title>
|
|
8
9
|
|
|
10
|
+
<meta name="keywords" content="ruby,documentation,Table of Contents - hookapp">
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
<meta name="description" content="Table of Contents - hookapp: hookapp A CLI for Hookmark on macOS. hookproductivity.">
|
|
14
|
+
|
|
15
|
+
|
|
9
16
|
<script type="text/javascript">
|
|
10
17
|
var rdoc_rel_prefix = "./";
|
|
11
18
|
var index_rel_prefix = "./";
|
|
@@ -22,6 +29,50 @@
|
|
|
22
29
|
|
|
23
30
|
|
|
24
31
|
<body id="top" class="table-of-contents">
|
|
32
|
+
<div id="navigation-toggle" role="button" tabindex="0" aria-label="Toggle sidebar" aria-expanded="true" aria-controls="navigation">
|
|
33
|
+
<span aria-hidden="true">☰</span>
|
|
34
|
+
</div>
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
<nav id="navigation" role="navigation">
|
|
38
|
+
<div id="project-navigation">
|
|
39
|
+
<div id="home-section" role="region" title="Quick navigation" class="nav-section">
|
|
40
|
+
<h2>
|
|
41
|
+
<a href="./index.html" rel="home">Home</a>
|
|
42
|
+
</h2>
|
|
43
|
+
|
|
44
|
+
<div id="table-of-contents-navigation">
|
|
45
|
+
<a href="./table_of_contents.html#pages">Pages</a>
|
|
46
|
+
<a href="./table_of_contents.html#classes">Classes</a>
|
|
47
|
+
<a href="./table_of_contents.html#methods">Methods</a>
|
|
48
|
+
</div>
|
|
49
|
+
</div>
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
<div id="search-section" role="search" class="project-section initially-hidden">
|
|
53
|
+
<form action="#" method="get" accept-charset="utf-8">
|
|
54
|
+
<div id="search-field-wrapper">
|
|
55
|
+
<input id="search-field" role="combobox" aria-label="Search"
|
|
56
|
+
aria-autocomplete="list" aria-controls="search-results"
|
|
57
|
+
type="text" name="search" placeholder="Search (/) for a class, method, ..." spellcheck="false"
|
|
58
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
|
59
|
+
</div>
|
|
60
|
+
|
|
61
|
+
<ul id="search-results" aria-label="Search Results"
|
|
62
|
+
aria-busy="false" aria-expanded="false"
|
|
63
|
+
aria-atomic="false" class="initially-hidden"></ul>
|
|
64
|
+
</form>
|
|
65
|
+
</div>
|
|
66
|
+
|
|
67
|
+
</div>
|
|
68
|
+
|
|
69
|
+
<footer id="validator-badges" role="contentinfo">
|
|
70
|
+
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
|
71
|
+
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.14.0.
|
|
72
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
|
73
|
+
</footer>
|
|
74
|
+
|
|
75
|
+
</nav>
|
|
25
76
|
<main role="main">
|
|
26
77
|
<h1 class="class">Table of Contents - hookapp</h1>
|
|
27
78
|
|
|
@@ -419,10 +470,3 @@
|
|
|
419
470
|
</ul>
|
|
420
471
|
</main>
|
|
421
472
|
|
|
422
|
-
|
|
423
|
-
<footer id="validator-badges" role="contentinfo">
|
|
424
|
-
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
|
425
|
-
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.3.3.
|
|
426
|
-
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
|
427
|
-
</footer>
|
|
428
|
-
|
data/lib/hook/hookapp.rb
CHANGED
|
@@ -56,8 +56,12 @@ class HookApp
|
|
|
56
56
|
|
|
57
57
|
# Get bookmarks hooked to file or URL. Return array of bookmark hashes.
|
|
58
58
|
def get_hooks(url)
|
|
59
|
-
url.
|
|
60
|
-
|
|
59
|
+
if url.is_a?(String)
|
|
60
|
+
url = url.valid_hook
|
|
61
|
+
raise "Invalid target: #{url}" unless url
|
|
62
|
+
else
|
|
63
|
+
return []
|
|
64
|
+
end
|
|
61
65
|
|
|
62
66
|
hooks = `osascript <<'APPLESCRIPT'
|
|
63
67
|
tell application "#{HOOK_APP}"
|
|
@@ -270,14 +274,14 @@ class HookApp
|
|
|
270
274
|
Dir.glob(glob.nil? || glob.empty? ? glob_all : glob)
|
|
271
275
|
end
|
|
272
276
|
|
|
273
|
-
|
|
277
|
+
args = ['--layout=reverse-list',
|
|
274
278
|
'--header="esc: cancel, return: browse"',
|
|
275
279
|
'--prompt=" Select file > "',
|
|
276
280
|
%(--preview='hook ls -o m {}'),
|
|
277
281
|
'--height=60%',
|
|
278
282
|
'--min-height=10']
|
|
279
283
|
|
|
280
|
-
sel = `echo #{Shellwords.escape(root.join("\n"))} | '#{fzf}' #{args.join(' ')}`.chomp.split("\n")
|
|
284
|
+
sel = `echo #{Shellwords.escape(root[0..300].join("\n"))} | '#{fzf}' #{args.join(' ')}`.chomp.split("\n")
|
|
281
285
|
|
|
282
286
|
if sel.count == 1
|
|
283
287
|
marks = get_hooks(sel[0])
|
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: []
|