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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 25f4c050d142cf0e50d7eb6e3c034c5bec09b313643af3925b63824d5eec42e4
4
- data.tar.gz: 3d9aa843527c9431cab23c086b703f3cf47ea598650cf6297cb1acf5036b3f68
3
+ metadata.gz: 1a9668f9397d2fb44830bdae8f053f48a129658f57dfce5d057efeef8e8108e8
4
+ data.tar.gz: 4bd8c06fe21cb5fc41888fbe7c6baa01b35d38e437be8f7671d86df258f6e1e0
5
5
  SHA512:
6
- metadata.gz: 3ac2d88f4dcc6a725ccda24717470222c4661e1f20003d82ce67e628a2c1a5508b55fa0366f07ea535585d8db1e1c1b9066fd975b0ec7ea5b6c8f679276276b0
7
- data.tar.gz: a809bba7e260162f183ea3513e2b791152f90b9dd811bfdce4bf39f4d2bca572912c07dac71ae51371721d601b3f85483c9c3e89d97142695c7b219fda5a5dcd
6
+ metadata.gz: 9480ef4185b9120dcb1a5ce0ec7c8e098879d1d2445c6582b5369008152f5dbc76cf41417543a1db95e3d988475b104813307d83c41d3adbe73976c24750598d
7
+ data.tar.gz: 5494dbbea9930dfe2b251e4b707f0815a2871be3d35e51c1a329c2a7b364dede989225e89c5caa9cf27494bc2c965ae3a9a48b4ce4a70c7d81eda56b51071942
data/.dockerignore ADDED
@@ -0,0 +1,16 @@
1
+ # .git is needed for gem building, but we can exclude .gitignore
2
+ .gitignore
3
+ .vscode
4
+ .idea
5
+ # Allow pkg/*.gem for Docker testing
6
+ # *.gem
7
+ # pkg/
8
+ html/
9
+ vendor/
10
+ *.log
11
+ .DS_Store
12
+ node_modules
13
+ *.swp
14
+ *.swo
15
+ *~
16
+
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.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.2.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
- `gem install hookapp`.
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
- 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`.
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
- #!/usr/bin/env ruby -W1
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
 
@@ -0,0 +1,11 @@
1
+ version: '3.8'
2
+
3
+ services:
4
+ test:
5
+ build:
6
+ context: .
7
+ dockerfile: Dockerfile.test
8
+ image: hookapp-test:ruby2.6
9
+ command: sh -c "hook --version && hook help"
10
+
11
+
data/hookapp.gemspec CHANGED
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Ensure we require the local version and not one we might have installed already
4
- require File.join([File.dirname(__FILE__), 'lib', 'hook', 'version.rb'])
4
+ require './lib/hook/version'
5
5
  Gem::Specification.new do |s|
6
6
  s.name = 'hookapp'
7
7
  s.version = Hook::VERSION
@@ -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.files = `git ls-files`.split("\n")
14
- s.require_paths << 'lib'
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/html/App.html CHANGED
@@ -1,11 +1,17 @@
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>class App - hookapp</title>
8
9
 
10
+ <meta name="keywords" content="ruby,class,App">
11
+
12
+ <meta name="description" content="class App: Main class for GLI app">
13
+
14
+
9
15
  <script type="text/javascript">
10
16
  var rdoc_rel_prefix = "./";
11
17
  var index_rel_prefix = "./";
@@ -22,7 +28,12 @@
22
28
 
23
29
 
24
30
  <body id="top" role="document" class="class">
25
- <nav role="navigation">
31
+ <div id="navigation-toggle" role="button" tabindex="0" aria-label="Toggle sidebar" aria-expanded="true" aria-controls="navigation">
32
+ <span aria-hidden="true">&#9776;</span>
33
+ </div>
34
+
35
+
36
+ <nav id="navigation" role="navigation">
26
37
  <div id="project-navigation">
27
38
  <div id="home-section" role="region" title="Quick navigation" class="nav-section">
28
39
  <h2>
@@ -41,7 +52,7 @@
41
52
  <div id="search-field-wrapper">
42
53
  <input id="search-field" role="combobox" aria-label="Search"
43
54
  aria-autocomplete="list" aria-controls="search-results"
44
- type="text" name="search" placeholder="Search" spellcheck="false"
55
+ type="text" name="search" placeholder="Search (/) for a class, method, ..." spellcheck="false"
45
56
  title="Type to search, Up and Down to navigate, Enter to load">
46
57
  </div>
47
58
 
@@ -54,18 +65,14 @@
54
65
  </div>
55
66
 
56
67
 
57
-
58
- <div id="class-metadata">
59
-
60
-
61
- <div id="parent-class-section" class="nav-section">
62
- <h3>Parent</h3>
63
-
64
- <p class="link"><a href="Object.html">Object</a>
68
+
69
+ <div id="parent-class-section" class="nav-section">
70
+ <h3>Ancestors</h3>
71
+ <ul><li><a href="Object.html">Object</a><ul><li>BasicObject</li></ul></li></ul>
65
72
  </div>
66
73
 
67
-
68
-
74
+
75
+
69
76
  <div id="extends-section" class="nav-section">
70
77
  <h3>Extended With Modules</h3>
71
78
 
@@ -74,12 +81,24 @@
74
81
  </ul>
75
82
  </div>
76
83
 
77
-
78
- </div>
84
+
85
+
86
+
87
+
88
+
89
+ <footer id="validator-badges" role="contentinfo">
90
+ <p><a href="https://validator.w3.org/check/referer">Validate</a>
91
+ <p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.14.0.
92
+ <p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
93
+ </footer>
94
+
79
95
  </nav>
80
96
 
81
97
  <main role="main" aria-labelledby="class-App">
82
- <h1 id="class-App" class="class">
98
+
99
+
100
+
101
+ <h1 id="class-App" class="anchor-link class">
83
102
  class App
84
103
  </h1>
85
104
 
@@ -89,7 +108,7 @@
89
108
 
90
109
  </section>
91
110
 
92
- <section id="5Buntitled-5D" class="documentation-section">
111
+ <section id="5Buntitled-5D" class="documentation-section anchor-link">
93
112
 
94
113
 
95
114
 
@@ -98,10 +117,3 @@
98
117
  </section>
99
118
  </main>
100
119
 
101
-
102
- <footer id="validator-badges" role="contentinfo">
103
- <p><a href="https://validator.w3.org/check/referer">Validate</a>
104
- <p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.3.3.
105
- <p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
106
- </footer>
107
-
@@ -1,11 +1,17 @@
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>module GLI::Commands::Doc - hookapp</title>
8
9
 
10
+ <meta name="keywords" content="ruby,module,GLI::Commands::Doc">
11
+
12
+ <meta name="description" content="Documentation for the GLI::Commands::Doc module">
13
+
14
+
9
15
  <script type="text/javascript">
10
16
  var rdoc_rel_prefix = "../../";
11
17
  var index_rel_prefix = "../../";
@@ -22,7 +28,12 @@
22
28
 
23
29
 
24
30
  <body id="top" role="document" class="module">
25
- <nav role="navigation">
31
+ <div id="navigation-toggle" role="button" tabindex="0" aria-label="Toggle sidebar" aria-expanded="true" aria-controls="navigation">
32
+ <span aria-hidden="true">&#9776;</span>
33
+ </div>
34
+
35
+
36
+ <nav id="navigation" role="navigation">
26
37
  <div id="project-navigation">
27
38
  <div id="home-section" role="region" title="Quick navigation" class="nav-section">
28
39
  <h2>
@@ -41,7 +52,7 @@
41
52
  <div id="search-field-wrapper">
42
53
  <input id="search-field" role="combobox" aria-label="Search"
43
54
  aria-autocomplete="list" aria-controls="search-results"
44
- type="text" name="search" placeholder="Search" spellcheck="false"
55
+ type="text" name="search" placeholder="Search (/) for a class, method, ..." spellcheck="false"
45
56
  title="Type to search, Up and Down to navigate, Enter to load">
46
57
  </div>
47
58
 
@@ -54,18 +65,50 @@
54
65
  </div>
55
66
 
56
67
 
68
+
69
+
70
+
71
+
72
+
73
+
74
+
75
+
76
+
77
+ <footer id="validator-badges" role="contentinfo">
78
+ <p><a href="https://validator.w3.org/check/referer">Validate</a>
79
+ <p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.14.0.
80
+ <p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
81
+ </footer>
57
82
 
58
- <div id="class-metadata">
59
-
60
-
61
-
62
-
63
-
64
- </div>
65
83
  </nav>
66
84
 
67
85
  <main role="main" aria-labelledby="module-GLI::Commands::Doc">
68
- <h1 id="module-GLI::Commands::Doc" class="module">
86
+
87
+
88
+ <ol role="navigation" aria-label="breadcrumb" class="breadcrumb">
89
+
90
+ <li>
91
+
92
+ <a href="../../GLI.html">GLI</a><span>::</span>
93
+
94
+ </li>
95
+
96
+ <li>
97
+
98
+ <a href="../../GLI/Commands.html">Commands</a><span>::</span>
99
+
100
+ </li>
101
+
102
+ <li>
103
+
104
+ <span>Doc</span>
105
+
106
+ </li>
107
+
108
+ </ol>
109
+
110
+
111
+ <h1 id="module-GLI::Commands::Doc" class="anchor-link module">
69
112
  module GLI::Commands::Doc
70
113
  </h1>
71
114
 
@@ -73,7 +116,7 @@
73
116
 
74
117
  </section>
75
118
 
76
- <section id="5Buntitled-5D" class="documentation-section">
119
+ <section id="5Buntitled-5D" class="documentation-section anchor-link">
77
120
 
78
121
 
79
122
 
@@ -82,10 +125,3 @@
82
125
  </section>
83
126
  </main>
84
127
 
85
-
86
- <footer id="validator-badges" role="contentinfo">
87
- <p><a href="https://validator.w3.org/check/referer">Validate</a>
88
- <p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.3.3.
89
- <p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
90
- </footer>
91
-