hookapp 2.0.16 → 2.1.0

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: b44765919b81d0e345de0a2f6a209c57f8d3be0d4de196215a9e5c4e061f682e
4
- data.tar.gz: 8372344a2b3ff71302d63e9052bd627fbd7fdb7543173c3f4f25bf1399f5d305
3
+ metadata.gz: d6f20d258c61f15b65d3520c147dbcd2e0b6998fe04e1b75d535de76e0db14bd
4
+ data.tar.gz: 57db4084be3e26d82496c8f8795aab3b821a29f48dffa9a564bc4526859c95fe
5
5
  SHA512:
6
- metadata.gz: 14bf6681d695f971bad160873ce10ee84ee4b406ce118623abfaf1b8ee6c4ca09a8f4b5e3da7df31515974add9c19c4d2a487c94f9541ceb19513fca13ef6e47
7
- data.tar.gz: e77f6a5f2822c461927d8c84120aa6f41dd16cb02cf13c6a7cd63b33f191488c71b583c62929a9d4d4284eb6f9b84467341cf21bf990a22bcd3107a4ad2d4da5
6
+ metadata.gz: 50e203166e31e5832973dbc927788b726f2e5f2c2a99b2612221d135e68db27ed9e6eef823d1bac2beff9854b04814c35623ab589f83ec592ebc90becd216b94
7
+ data.tar.gz: e9bf80532aefc5224e86974530f500619a44b1d6a8574732251c76651563609c924d69de3058d0251b07683ed4e578e77370a1e5b2792865c04f94516cb23113
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ #### 2.0.16
2
+
3
+ - Change fzf preview to Markdown listing
4
+
1
5
  #### 2.0.10
2
6
 
3
7
  - Fix permissions issues when installed using sudo
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- hookapp (2.0.16)
4
+ hookapp (2.1.0)
5
5
  gli (~> 2.20.1)
6
6
  tty-which (~> 0.5, >= 0.5.0)
7
7
 
data/README.md CHANGED
@@ -6,7 +6,7 @@ CLI interface for Hook.app (macOS)
6
6
 
7
7
  This gem includes a `hook` binary that allows interaction with the features of Hook.app.
8
8
 
9
- *v2.0.16*
9
+ *v2.1.0*
10
10
 
11
11
  ## Installation
12
12
 
@@ -366,5 +366,5 @@ This software is licensed under the MIT License.
366
366
  THE SOFTWARE.
367
367
 
368
368
 
369
- Documentation generated 2022-08-23 09:39
369
+ Documentation generated 2022-11-10 09:20
370
370
 
data/Rakefile CHANGED
@@ -20,9 +20,9 @@ CUKE_RESULTS = 'results.html'
20
20
  CLEAN << CUKE_RESULTS
21
21
  desc 'Run features'
22
22
  Cucumber::Rake::Task.new(:features) do |t|
23
- opts = "features --format html -o #{CUKE_RESULTS} --format progress -x"
24
- opts += " --tags #{ENV['TAGS']}" if ENV['TAGS']
25
- t.cucumber_opts = opts
23
+ opts = ["features", "--format html", "-o #{CUKE_RESULTS}", "--format progress", "-x"]
24
+ opts.push("--tags #{ENV['TAGS']}") if ENV['TAGS']
25
+ t.cucumber_opts = opts
26
26
  t.fork = false
27
27
  end
28
28
 
@@ -30,7 +30,7 @@ desc 'Run features tagged as work-in-progress (@wip)'
30
30
  Cucumber::Rake::Task.new('features:wip') do |t|
31
31
  tag_opts = ' --tags ~@pending'
32
32
  tag_opts = ' --tags @wip'
33
- t.cucumber_opts = "features --format html -o #{CUKE_RESULTS} --format pretty -x -s#{tag_opts}"
33
+ t.cucumber_opts = ["features", "--format html", "-o #{CUKE_RESULTS}", "--format pretty", "-x", "-s#{tag_opts}"]
34
34
  t.fork = false
35
35
  end
36
36
 
data/hook.rdoc CHANGED
@@ -4,7 +4,7 @@ Hook.app is a productivity tool for macOS <https://hookproductivity.com/>.
4
4
 
5
5
  This gem includes a `hook` binary that allows interaction with the features of Hook.app.
6
6
 
7
- v2.0.16
7
+ v2.1.0
8
8
 
9
9
  === Global Options
10
10
  === --help
data/html/App.html CHANGED
@@ -61,7 +61,7 @@
61
61
  <div id="parent-class-section" class="nav-section">
62
62
  <h3>Parent</h3>
63
63
 
64
- <p class="link">Object
64
+ <p class="link"><a href="Object.html">Object</a>
65
65
  </div>
66
66
 
67
67
 
@@ -61,7 +61,7 @@
61
61
  <div id="parent-class-section" class="nav-section">
62
62
  <h3>Parent</h3>
63
63
 
64
- <p class="link">Object
64
+ <p class="link"><a href="../../Object.html">Object</a>
65
65
  </div>
66
66
 
67
67
 
data/html/HookApp.html CHANGED
@@ -61,7 +61,7 @@
61
61
  <div id="parent-class-section" class="nav-section">
62
62
  <h3>Parent</h3>
63
63
 
64
- <p class="link">Object
64
+ <p class="link"><a href="Object.html">Object</a>
65
65
  </div>
66
66
 
67
67
 
@@ -186,8 +186,8 @@
186
186
  <div class="method-source-code" id="all_bookmarks-source">
187
187
  <pre><span class="ruby-comment"># File lib/hook/hookapp.rb, line 142</span>
188
188
  <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">all_bookmarks</span>
189
- <span class="ruby-string">`osascript &lt;&lt;&#39;APPLESCRIPT&#39;
190
- tell application &quot;Hook&quot;
189
+ <span class="ruby-node">`osascript &lt;&lt;&#39;APPLESCRIPT&#39;
190
+ tell application &quot;#{HOOK_APP}&quot;
191
191
  set _marks to every bookmark
192
192
  set _out to {}
193
193
  repeat with _hook in _marks
@@ -224,7 +224,7 @@
224
224
 
225
225
  <span class="ruby-keyword">begin</span>
226
226
  <span class="ruby-identifier">mark</span> = <span class="ruby-node">`osascript &lt;&lt;&#39;APPLESCRIPT&#39;
227
- tell application &quot;Hook&quot;
227
+ tell application &quot;#{HOOK_APP}&quot;
228
228
  set _hook to make bookmark with data &quot;#{url}&quot;
229
229
  if _hook is missing value
230
230
  return &quot;&quot;
@@ -263,7 +263,7 @@
263
263
  tell application &quot;System Events&quot; to set front_app to name of first application process whose frontmost is true
264
264
  tell application &quot;#{app}&quot; to activate
265
265
  delay 2
266
- tell application &quot;Hook&quot;
266
+ tell application &quot;#{HOOK_APP}&quot;
267
267
  set _hook to (bookmark from active window)
268
268
  set _output to (name of _hook &amp; &quot;||&quot; &amp; address of _hook &amp; &quot;||&quot; &amp; path of _hook)
269
269
  end tell
@@ -407,7 +407,7 @@
407
407
  <span class="ruby-identifier">hooks</span> = <span class="ruby-identifier">get_hooks</span>(<span class="ruby-identifier">source</span>)
408
408
  <span class="ruby-identifier">hooks</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">hook</span><span class="ruby-operator">|</span>
409
409
  <span class="ruby-node">`osascript &lt;&lt;&#39;APPLESCRIPT&#39;
410
- tell application &quot;Hook&quot;
410
+ tell application &quot;#{HOOK_APP}&quot;
411
411
  set _mark1 to make bookmark with data &quot;#{hook[:url]}&quot;
412
412
  set _mark2 to make bookmark with data &quot;#{target}&quot;
413
413
  hook _mark1 and _mark2
@@ -465,7 +465,7 @@
465
465
  <pre><span class="ruby-comment"># File lib/hook/hookapp.rb, line 566</span>
466
466
  <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">decode</span>(<span class="ruby-identifier">string</span>)
467
467
  <span class="ruby-identifier">result</span> = <span class="ruby-node">`osascript &lt;&lt;&#39;APPLESCRIPT&#39;
468
- tell application &quot;Hook&quot;
468
+ tell application &quot;#{HOOK_APP}&quot;
469
469
  percent decode &quot;#{string.escape_quotes}&quot;
470
470
  end tell
471
471
  APPLESCRIPT`</span>.<span class="ruby-identifier">strip</span>
@@ -498,7 +498,7 @@ APPLESCRIPT`</span>.<span class="ruby-identifier">strip</span>
498
498
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">res</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp">/^y/i</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">force</span>
499
499
  <span class="ruby-identifier">get_hooks</span>(<span class="ruby-identifier">url</span>).<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">hook</span><span class="ruby-operator">|</span>
500
500
  <span class="ruby-node">`osascript &lt;&lt;&#39;APPLESCRIPT&#39;
501
- tell application &quot;Hook&quot;
501
+ tell application &quot;#{HOOK_APP}&quot;
502
502
  set _mark1 to make bookmark with data &quot;#{hook[:url]}&quot;
503
503
  set _mark2 to make bookmark with data &quot;#{url}&quot;
504
504
  unhook _mark1 and _mark2
@@ -543,7 +543,7 @@ APPLESCRIPT`</span>.<span class="ruby-identifier">strip</span>
543
543
  <span class="ruby-identifier">source</span> = <span class="ruby-identifier">urls</span>[<span class="ruby-value">0</span>]
544
544
  <span class="ruby-identifier">target</span> = <span class="ruby-identifier">urls</span>[<span class="ruby-value">1</span>]
545
545
  <span class="ruby-node">`osascript &lt;&lt;&#39;APPLESCRIPT&#39;
546
- tell application &quot;Hook&quot;
546
+ tell application &quot;#{HOOK_APP}&quot;
547
547
  set _mark1 to make bookmark with data &quot;#{source}&quot;
548
548
  set _mark2 to make bookmark with data &quot;#{target}&quot;
549
549
  unhook _mark1 and _mark2
@@ -575,7 +575,7 @@ APPLESCRIPT`</span>.<span class="ruby-identifier">strip</span>
575
575
  <pre><span class="ruby-comment"># File lib/hook/hookapp.rb, line 557</span>
576
576
  <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">encode</span>(<span class="ruby-identifier">string</span>)
577
577
  <span class="ruby-identifier">result</span> = <span class="ruby-node">`osascript &lt;&lt;&#39;APPLESCRIPT&#39;
578
- tell application &quot;Hook&quot;
578
+ tell application &quot;#{HOOK_APP}&quot;
579
579
  percent encode &quot;#{string.escape_quotes}&quot;
580
580
  end tell
581
581
  APPLESCRIPT`</span>.<span class="ruby-identifier">strip</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp">/&#39;/</span>,<span class="ruby-string">&#39;%27&#39;</span>)
@@ -627,7 +627,7 @@ APPLESCRIPT`</span>.<span class="ruby-identifier">strip</span>.<span class="ruby
627
627
  <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;Invalid target: #{url}&quot;</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">url</span>
628
628
 
629
629
  <span class="ruby-identifier">hooks</span> = <span class="ruby-node">`osascript &lt;&lt;&#39;APPLESCRIPT&#39;
630
- tell application &quot;Hook&quot;
630
+ tell application &quot;#{HOOK_APP}&quot;
631
631
  set _mark to make bookmark with data &quot;#{url}&quot;
632
632
  if _mark is missing value
633
633
  return &quot;&quot;
@@ -669,7 +669,7 @@ APPLESCRIPT`</span>.<span class="ruby-identifier">strip</span>.<span class="ruby
669
669
  <span class="ruby-identifier">link_to</span> = <span class="ruby-identifier">args</span>.<span class="ruby-identifier">dup</span>.<span class="ruby-identifier">map</span>(<span class="ruby-operator">&amp;</span><span class="ruby-value">:valid_hook</span>).<span class="ruby-identifier">reject</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">url</span><span class="ruby-operator">|</span> <span class="ruby-identifier">url</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">source</span> }
670
670
  <span class="ruby-identifier">link_to</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">url</span><span class="ruby-operator">|</span>
671
671
  <span class="ruby-node">`osascript &lt;&lt;&#39;APPLESCRIPT&#39;
672
- tell application &quot;Hook&quot;
672
+ tell application &quot;#{HOOK_APP}&quot;
673
673
  set _mark1 to make bookmark with data &quot;#{source}&quot;
674
674
  set _mark2 to make bookmark with data &quot;#{url}&quot;
675
675
  hook _mark1 and _mark2
@@ -709,7 +709,7 @@ APPLESCRIPT`</span>.<span class="ruby-identifier">strip</span>.<span class="ruby
709
709
 
710
710
  <span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;Linking #{file} and #{target}...&quot;</span>
711
711
  <span class="ruby-node">`osascript &lt;&lt;&#39;APPLESCRIPT&#39;
712
- tell application &quot;Hook&quot;
712
+ tell application &quot;#{HOOK_APP}&quot;
713
713
  set _mark1 to make bookmark with data &quot;#{file}&quot;
714
714
  set _mark2 to make bookmark with data &quot;#{target}&quot;
715
715
  hook _mark1 and _mark2
@@ -802,7 +802,7 @@ APPLESCRIPT`</span>.<span class="ruby-identifier">strip</span>.<span class="ruby
802
802
  <pre><span class="ruby-comment"># File lib/hook/hookapp.rb, line 317</span>
803
803
  <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">open_gui</span>(<span class="ruby-identifier">url</span>)
804
804
  <span class="ruby-identifier">result</span> = <span class="ruby-node">`osascript &lt;&lt;&#39;APPLESCRIPT&#39;
805
- tell application &quot;Hook&quot;
805
+ tell application &quot;#{HOOK_APP}&quot;
806
806
  set _mark to make bookmark with data &quot;#{url.valid_hook}&quot;
807
807
  if _mark is missing value
808
808
  return &quot;Failed to create bookmark for #{url}&quot;
@@ -954,7 +954,7 @@ APPLESCRIPT`</span>.<span class="ruby-identifier">strip</span>.<span class="ruby
954
954
  <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">search_name</span>(<span class="ruby-identifier">search</span>)
955
955
  <span class="ruby-node">`osascript &lt;&lt;&#39;APPLESCRIPT&#39;
956
956
  set searchString to &quot;#{search.strip}&quot;
957
- tell application &quot;Hook&quot;
957
+ tell application &quot;#{HOOK_APP}&quot;
958
958
  set _marks to every bookmark whose name contains searchString
959
959
  set _out to {}
960
960
  repeat with _hook in _marks
@@ -988,7 +988,7 @@ APPLESCRIPT`</span>.<span class="ruby-identifier">strip</span>.<span class="ruby
988
988
  <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">search_path_or_address</span>(<span class="ruby-identifier">search</span>)
989
989
  <span class="ruby-node">`osascript &lt;&lt;&#39;APPLESCRIPT&#39;
990
990
  set searchString to &quot;#{search.strip}&quot;
991
- tell application &quot;Hook&quot;
991
+ tell application &quot;#{HOOK_APP}&quot;
992
992
  set _marks to every bookmark whose path contains searchString or address contains searchString
993
993
  set _out to {}
994
994
  repeat with _hook in _marks
@@ -133,7 +133,7 @@
133
133
 
134
134
  <p>This gem includes a `hook` binary that allows interaction with the features of Hook.app.</p>
135
135
 
136
- <p>v2.0.16</p>
136
+ <p>v2.1.0</p>
137
137
 
138
138
  <h3 id="label-Global+Options">Global Options<span><a href="#label-Global+Options">&para;</a> <a href="#top">&uarr;</a></span></h3>
139
139
 
data/html/String.html CHANGED
@@ -61,7 +61,7 @@
61
61
  <div id="parent-class-section" class="nav-section">
62
62
  <h3>Parent</h3>
63
63
 
64
- <p class="link">Object
64
+ <p class="link"><a href="Object.html">Object</a>
65
65
  </div>
66
66
 
67
67
 
data/html/created.rid CHANGED
@@ -1,10 +1,10 @@
1
- Tue, 23 Aug 2022 09:39:55 -0500
1
+ Thu, 10 Nov 2022 09:20:50 -0600
2
2
  README.rdoc Tue, 07 Jul 2020 16:57:07 -0500
3
- lib/hook.rb Thu, 26 May 2022 08:20:27 -0500
4
- lib/hook/hookapp.rb Tue, 23 Aug 2022 09:37:26 -0500
3
+ lib/hook.rb Thu, 10 Nov 2022 09:16:41 -0600
4
+ lib/hook/hookapp.rb Thu, 10 Nov 2022 09:18:33 -0600
5
5
  lib/hook/hooker.rb Sun, 31 Oct 2021 07:54:46 -0500
6
6
  lib/hook/markdown_document_listener.rb Sun, 26 Sep 2021 07:45:59 -0500
7
7
  lib/hook/prompt.rb Tue, 23 Aug 2022 06:17:15 -0500
8
8
  lib/hook/string.rb Sun, 31 Oct 2021 07:03:15 -0500
9
- lib/hook/version.rb Tue, 23 Aug 2022 09:38:49 -0500
9
+ lib/hook/version.rb Thu, 10 Nov 2022 09:19:48 -0600
10
10
  bin/hook Tue, 19 Jul 2022 14:11:16 -0500
data/html/index.html CHANGED
@@ -79,6 +79,7 @@
79
79
  <li><a href="./Hook/PromptSTD.html">Hook::PromptSTD</a>
80
80
  <li><a href="./HookApp.html">HookApp</a>
81
81
  <li><a href="./Hooker.html">Hooker</a>
82
+ <li><a href="./Object.html">Object</a>
82
83
  <li><a href="./String.html">String</a>
83
84
  </ul>
84
85
  </div>
@@ -99,7 +100,7 @@
99
100
 
100
101
  <p>This gem includes a `hook` binary that allows interaction with the features of Hook.app.</p>
101
102
 
102
- <p>v2.0.16</p>
103
+ <p>v2.1.0</p>
103
104
 
104
105
  <h3 id="label-Global+Options">Global Options<span><a href="#label-Global+Options">&para;</a> <a href="#top">&uarr;</a></span></h3>
105
106
 
@@ -1 +1 @@
1
- var search_data = {"index":{"searchIndex":["app","gli","commands","doc","markdowndocumentlistener","hook","prompt","promptfzf","promptstd","hookapp","hooker","string","act_on()","all_bookmarks()","beginning()","bookmark_for()","bookmark_from_app()","browse_bookmarks()","browse_linked()","cap()","cap!()","clear_screen()","clip()","clip_bookmark()","clone_hooks()","command()","commands()","copy_bookmark()","decode()","default_command()","delete_all_hooks()","delete_hooks()","encode()","end_command()","end_commands()","end_options()","ending()","escape_quotes()","flag()","format_regex()","fzf()","get_hooks()","install_fzf()","link_all()","link_files()","linked_bookmarks()","new()","new()","nil_if_missing()","open_gui()","open_linked()","options()","output_array()","program_desc()","program_long_desc()","restore_std()","search_bookmarks()","search_name()","search_path_or_address()","select_hook()","silence_std()","split_hook()","split_hooks()","switch()","uninstall_fzf()","valid_hook()","valid_hook!()","validate_format()","version()","which_fzf()","readme"],"longSearchIndex":["app","gli","gli::commands","gli::commands::doc","gli::commands::markdowndocumentlistener","hook","hook::prompt","hook::promptfzf","hook::promptstd","hookapp","hooker","string","hookapp#act_on()","hookapp#all_bookmarks()","gli::commands::markdowndocumentlistener#beginning()","hookapp#bookmark_for()","hookapp#bookmark_from_app()","hookapp#browse_bookmarks()","hookapp#browse_linked()","string#cap()","string#cap!()","hook::promptstd#clear_screen()","string#clip()","hookapp#clip_bookmark()","hookapp#clone_hooks()","gli::commands::markdowndocumentlistener#command()","gli::commands::markdowndocumentlistener#commands()","hookapp#copy_bookmark()","hookapp#decode()","gli::commands::markdowndocumentlistener#default_command()","hookapp#delete_all_hooks()","hookapp#delete_hooks()","hookapp#encode()","gli::commands::markdowndocumentlistener#end_command()","gli::commands::markdowndocumentlistener#end_commands()","gli::commands::markdowndocumentlistener#end_options()","gli::commands::markdowndocumentlistener#ending()","string#escape_quotes()","gli::commands::markdowndocumentlistener#flag()","hookapp#format_regex()","hook::promptfzf#fzf()","hookapp#get_hooks()","hook::promptfzf#install_fzf()","hookapp#link_all()","hookapp#link_files()","hookapp#linked_bookmarks()","gli::commands::markdowndocumentlistener::new()","hooker::new()","string#nil_if_missing()","hookapp#open_gui()","hookapp#open_linked()","gli::commands::markdowndocumentlistener#options()","hookapp#output_array()","gli::commands::markdowndocumentlistener#program_desc()","gli::commands::markdowndocumentlistener#program_long_desc()","hook::promptstd#restore_std()","hookapp#search_bookmarks()","hookapp#search_name()","hookapp#search_path_or_address()","hookapp#select_hook()","hook::promptstd#silence_std()","string#split_hook()","string#split_hooks()","gli::commands::markdowndocumentlistener#switch()","hook::promptfzf#uninstall_fzf()","string#valid_hook()","string#valid_hook!()","hookapp#validate_format()","gli::commands::markdowndocumentlistener#version()","hook::promptfzf#which_fzf()",""],"info":[["App","","App.html","","<p>Main class for GLI app\n"],["GLI","","GLI.html","",""],["GLI::Commands","","GLI/Commands.html","",""],["GLI::Commands::Doc","","GLI/Commands/Doc.html","",""],["GLI::Commands::MarkdownDocumentListener","","GLI/Commands/MarkdownDocumentListener.html","","<p>DocumentListener class for GLI documentation generator\n"],["Hook","","Hook.html","",""],["Hook::Prompt","","Hook/Prompt.html","",""],["Hook::PromptFZF","","Hook/PromptFZF.html","","<p>Methods for working installing/using FuzzyFileFinder\n"],["Hook::PromptSTD","","Hook/PromptSTD.html","",""],["HookApp","","HookApp.html","","<p>Hook.app functions\n"],["Hooker","","Hooker.html","","<p>Hook.app CLI interface\n"],["String","","String.html","","<p>String helpers\n"],["act_on","HookApp","HookApp.html#method-i-act_on","(url)",""],["all_bookmarks","HookApp","HookApp.html#method-i-all_bookmarks","()","<p>Get all known bookmarks. Return array of bookmark hashes.\n"],["beginning","GLI::Commands::MarkdownDocumentListener","GLI/Commands/MarkdownDocumentListener.html#method-i-beginning","()",""],["bookmark_for","HookApp","HookApp.html#method-i-bookmark_for","(url)","<p>Get a Hook bookmark for file or URL. Return bookmark hash.\n"],["bookmark_from_app","HookApp","HookApp.html#method-i-bookmark_from_app","(app, opts)","<p>Get a bookmark from the foreground document of specified app.\n"],["browse_bookmarks","HookApp","HookApp.html#method-i-browse_bookmarks","(glob)",""],["browse_linked","HookApp","HookApp.html#method-i-browse_linked","(url)","<p>Select from a menu of available hooks and open using macOS `open`.\n"],["cap","String","String.html#method-i-cap","()","<p>Capitalize only if no uppercase\n"],["cap!","String","String.html#method-i-cap-21","()",""],["clear_screen","Hook::PromptSTD","Hook/PromptSTD.html#method-i-clear_screen","(msg = nil)","<p>Clear the terminal screen\n"],["clip","String","String.html#method-i-clip","()",""],["clip_bookmark","HookApp","HookApp.html#method-i-clip_bookmark","(url, opts)","<p>Create a bookmark for specified file/url and copy to the clipboard.\n"],["clone_hooks","HookApp","HookApp.html#method-i-clone_hooks","(args)","<p>Copy all hooks from source file to target file\n"],["command","GLI::Commands::MarkdownDocumentListener","GLI/Commands/MarkdownDocumentListener.html#method-i-command","(name, aliases, desc, long_desc, arg_name, arg_options)","<p>Gives you a command in the current context and creates a new context of this command\n"],["commands","GLI::Commands::MarkdownDocumentListener","GLI/Commands/MarkdownDocumentListener.html#method-i-commands","()",""],["copy_bookmark","HookApp","HookApp.html#method-i-copy_bookmark","(title, url, opts)","<p>Create a bookmark from specified title and url and copy to the clipboard.\n"],["decode","HookApp","HookApp.html#method-i-decode","(string)",""],["default_command","GLI::Commands::MarkdownDocumentListener","GLI/Commands/MarkdownDocumentListener.html#method-i-default_command","(name)","<p>Gives you the name of the current command in the current context\n"],["delete_all_hooks","HookApp","HookApp.html#method-i-delete_all_hooks","(url, force: false)","<p>Delete all hooked files/urls from target file\n"],["delete_hooks","HookApp","HookApp.html#method-i-delete_hooks","(args, opts)","<p>Delete hooks between two files/urls\n"],["encode","HookApp","HookApp.html#method-i-encode","(string)",""],["end_command","GLI::Commands::MarkdownDocumentListener","GLI/Commands/MarkdownDocumentListener.html#method-i-end_command","(_name)","<p>Ends a command, and “pops” you back up one context\n"],["end_commands","GLI::Commands::MarkdownDocumentListener","GLI/Commands/MarkdownDocumentListener.html#method-i-end_commands","()",""],["end_options","GLI::Commands::MarkdownDocumentListener","GLI/Commands/MarkdownDocumentListener.html#method-i-end_options","()",""],["ending","GLI::Commands::MarkdownDocumentListener","GLI/Commands/MarkdownDocumentListener.html#method-i-ending","()","<p>Called when processing has completed\n"],["escape_quotes","String","String.html#method-i-escape_quotes","()",""],["flag","GLI::Commands::MarkdownDocumentListener","GLI/Commands/MarkdownDocumentListener.html#method-i-flag","(name, aliases, desc, long_desc, default_value, arg_name, must_match, _type)","<p>Gives you a flag in the current context\n"],["format_regex","HookApp","HookApp.html#method-i-format_regex","(options)","<p>Create a single regex for validation of an array by first char or full match.\n"],["fzf","Hook::PromptFZF","Hook/PromptFZF.html#method-i-fzf","()","<p>Get path to fzf binary, installing if needed\n<p>@return [String] Path to fzf binary\n"],["get_hooks","HookApp","HookApp.html#method-i-get_hooks","(url)","<p>Get bookmarks hooked to file or URL. Return array of bookmark hashes.\n"],["install_fzf","Hook::PromptFZF","Hook/PromptFZF.html#method-i-install_fzf","(force: false)","<p>Install fzf on the current system. Installs to a subdirectory of the gem\n<p>@param force [Boolean] …\n"],["link_all","HookApp","HookApp.html#method-i-link_all","(args)","<p>Create bi-directional links between every file/url in the list of arguments\n"],["link_files","HookApp","HookApp.html#method-i-link_files","(args)","<p>Link 2 or more files/urls with bi-directional hooks.\n"],["linked_bookmarks","HookApp","HookApp.html#method-i-linked_bookmarks","(args, opts)","<p>Get a list of all hooks on a file/url.\n"],["new","GLI::Commands::MarkdownDocumentListener","GLI/Commands/MarkdownDocumentListener.html#method-c-new","(_global_options, _options, _arguments, app)",""],["new","Hooker","Hooker.html#method-c-new","()",""],["nil_if_missing","String","String.html#method-i-nil_if_missing","()",""],["open_gui","HookApp","HookApp.html#method-i-open_gui","(url)","<p>Open the Hook GUI for browsing/performing actions on a file or url\n"],["open_linked","HookApp","HookApp.html#method-i-open_linked","(url)","<p>Select from a menu of available hooks and open using macOS `open`.\n"],["options","GLI::Commands::MarkdownDocumentListener","GLI/Commands/MarkdownDocumentListener.html#method-i-options","()",""],["output_array","HookApp","HookApp.html#method-i-output_array","(hooks_arr, opts)","<p>Output an array of hooks in the given format.\n"],["program_desc","GLI::Commands::MarkdownDocumentListener","GLI/Commands/MarkdownDocumentListener.html#method-i-program_desc","(desc)","<p>Gives you the program description\n"],["program_long_desc","GLI::Commands::MarkdownDocumentListener","GLI/Commands/MarkdownDocumentListener.html#method-i-program_long_desc","(desc)",""],["restore_std","Hook::PromptSTD","Hook/PromptSTD.html#method-i-restore_std","()","<p>Restore silenced STDOUT and STDERR\n"],["search_bookmarks","HookApp","HookApp.html#method-i-search_bookmarks","(search, opts)","<p>Search bookmarks, using both names and addresses unless options contain “:names_only”. Return …\n"],["search_name","HookApp","HookApp.html#method-i-search_name","(search)","<p>Search boomark names/titles. Return array of bookmark hashes.\n"],["search_path_or_address","HookApp","HookApp.html#method-i-search_path_or_address","(search)","<p>Search bookmark paths and addresses. Return array of bookmark hashes.\n"],["select_hook","HookApp","HookApp.html#method-i-select_hook","(marks)","<p>Generate a menu of available hooks for selecting one or more hooks to operate on. Revamped to use `fzf`, …\n"],["silence_std","Hook::PromptSTD","Hook/PromptSTD.html#method-i-silence_std","(file = '/dev/null')","<p>Redirect STDOUT and STDERR to /dev/null or file\n<p>@param file [String] a file path to redirect to …\n"],["split_hook","String","String.html#method-i-split_hook","()",""],["split_hooks","String","String.html#method-i-split_hooks","()",""],["switch","GLI::Commands::MarkdownDocumentListener","GLI/Commands/MarkdownDocumentListener.html#method-i-switch","(name, aliases, desc, long_desc, negatable)","<p>Gives you a switch in the current context\n"],["uninstall_fzf","Hook::PromptFZF","Hook/PromptFZF.html#method-i-uninstall_fzf","()","<p>Remove fzf binary\n"],["valid_hook","String","String.html#method-i-valid_hook","()",""],["valid_hook!","String","String.html#method-i-valid_hook-21","()",""],["validate_format","HookApp","HookApp.html#method-i-validate_format","(fmt, options)","<p>Check if format fully matches or matches the first character of available options. Return full valid …\n"],["version","GLI::Commands::MarkdownDocumentListener","GLI/Commands/MarkdownDocumentListener.html#method-i-version","(version)","<p>Gives you the program version\n"],["which_fzf","Hook::PromptFZF","Hook/PromptFZF.html#method-i-which_fzf","()","<p>Return the path to the fzf binary\n<p>@return [String] Path to fzf\n"],["README","","README_rdoc.html","","<p>hookapp\n<p>A CLI for Hook.app on macOS.\n<p>hook - CLI interface for Hook.app (macOS)\n"]]}}
1
+ var search_data = {"index":{"searchIndex":["app","gli","commands","doc","markdowndocumentlistener","hook","prompt","promptfzf","promptstd","hookapp","hooker","object","string","act_on()","all_bookmarks()","beginning()","bookmark_for()","bookmark_from_app()","browse_bookmarks()","browse_linked()","cap()","cap!()","clear_screen()","clip()","clip_bookmark()","clone_hooks()","command()","commands()","copy_bookmark()","decode()","default_command()","delete_all_hooks()","delete_hooks()","encode()","end_command()","end_commands()","end_options()","ending()","escape_quotes()","flag()","format_regex()","fzf()","get_hooks()","install_fzf()","link_all()","link_files()","linked_bookmarks()","new()","new()","nil_if_missing()","open_gui()","open_linked()","options()","output_array()","program_desc()","program_long_desc()","restore_std()","search_bookmarks()","search_name()","search_path_or_address()","select_hook()","silence_std()","split_hook()","split_hooks()","switch()","uninstall_fzf()","valid_hook()","valid_hook!()","validate_format()","version()","which_fzf()","readme"],"longSearchIndex":["app","gli","gli::commands","gli::commands::doc","gli::commands::markdowndocumentlistener","hook","hook::prompt","hook::promptfzf","hook::promptstd","hookapp","hooker","object","string","hookapp#act_on()","hookapp#all_bookmarks()","gli::commands::markdowndocumentlistener#beginning()","hookapp#bookmark_for()","hookapp#bookmark_from_app()","hookapp#browse_bookmarks()","hookapp#browse_linked()","string#cap()","string#cap!()","hook::promptstd#clear_screen()","string#clip()","hookapp#clip_bookmark()","hookapp#clone_hooks()","gli::commands::markdowndocumentlistener#command()","gli::commands::markdowndocumentlistener#commands()","hookapp#copy_bookmark()","hookapp#decode()","gli::commands::markdowndocumentlistener#default_command()","hookapp#delete_all_hooks()","hookapp#delete_hooks()","hookapp#encode()","gli::commands::markdowndocumentlistener#end_command()","gli::commands::markdowndocumentlistener#end_commands()","gli::commands::markdowndocumentlistener#end_options()","gli::commands::markdowndocumentlistener#ending()","string#escape_quotes()","gli::commands::markdowndocumentlistener#flag()","hookapp#format_regex()","hook::promptfzf#fzf()","hookapp#get_hooks()","hook::promptfzf#install_fzf()","hookapp#link_all()","hookapp#link_files()","hookapp#linked_bookmarks()","gli::commands::markdowndocumentlistener::new()","hooker::new()","string#nil_if_missing()","hookapp#open_gui()","hookapp#open_linked()","gli::commands::markdowndocumentlistener#options()","hookapp#output_array()","gli::commands::markdowndocumentlistener#program_desc()","gli::commands::markdowndocumentlistener#program_long_desc()","hook::promptstd#restore_std()","hookapp#search_bookmarks()","hookapp#search_name()","hookapp#search_path_or_address()","hookapp#select_hook()","hook::promptstd#silence_std()","string#split_hook()","string#split_hooks()","gli::commands::markdowndocumentlistener#switch()","hook::promptfzf#uninstall_fzf()","string#valid_hook()","string#valid_hook!()","hookapp#validate_format()","gli::commands::markdowndocumentlistener#version()","hook::promptfzf#which_fzf()",""],"info":[["App","","App.html","","<p>Main class for GLI app\n"],["GLI","","GLI.html","",""],["GLI::Commands","","GLI/Commands.html","",""],["GLI::Commands::Doc","","GLI/Commands/Doc.html","",""],["GLI::Commands::MarkdownDocumentListener","","GLI/Commands/MarkdownDocumentListener.html","","<p>DocumentListener class for GLI documentation generator\n"],["Hook","","Hook.html","",""],["Hook::Prompt","","Hook/Prompt.html","",""],["Hook::PromptFZF","","Hook/PromptFZF.html","","<p>Methods for working installing/using FuzzyFileFinder\n"],["Hook::PromptSTD","","Hook/PromptSTD.html","",""],["HookApp","","HookApp.html","","<p>Hook.app functions\n"],["Hooker","","Hooker.html","","<p>Hook.app CLI interface\n"],["Object","","Object.html","",""],["String","","String.html","","<p>String helpers\n"],["act_on","HookApp","HookApp.html#method-i-act_on","(url)",""],["all_bookmarks","HookApp","HookApp.html#method-i-all_bookmarks","()","<p>Get all known bookmarks. Return array of bookmark hashes.\n"],["beginning","GLI::Commands::MarkdownDocumentListener","GLI/Commands/MarkdownDocumentListener.html#method-i-beginning","()",""],["bookmark_for","HookApp","HookApp.html#method-i-bookmark_for","(url)","<p>Get a Hook bookmark for file or URL. Return bookmark hash.\n"],["bookmark_from_app","HookApp","HookApp.html#method-i-bookmark_from_app","(app, opts)","<p>Get a bookmark from the foreground document of specified app.\n"],["browse_bookmarks","HookApp","HookApp.html#method-i-browse_bookmarks","(glob)",""],["browse_linked","HookApp","HookApp.html#method-i-browse_linked","(url)","<p>Select from a menu of available hooks and open using macOS `open`.\n"],["cap","String","String.html#method-i-cap","()","<p>Capitalize only if no uppercase\n"],["cap!","String","String.html#method-i-cap-21","()",""],["clear_screen","Hook::PromptSTD","Hook/PromptSTD.html#method-i-clear_screen","(msg = nil)","<p>Clear the terminal screen\n"],["clip","String","String.html#method-i-clip","()",""],["clip_bookmark","HookApp","HookApp.html#method-i-clip_bookmark","(url, opts)","<p>Create a bookmark for specified file/url and copy to the clipboard.\n"],["clone_hooks","HookApp","HookApp.html#method-i-clone_hooks","(args)","<p>Copy all hooks from source file to target file\n"],["command","GLI::Commands::MarkdownDocumentListener","GLI/Commands/MarkdownDocumentListener.html#method-i-command","(name, aliases, desc, long_desc, arg_name, arg_options)","<p>Gives you a command in the current context and creates a new context of this command\n"],["commands","GLI::Commands::MarkdownDocumentListener","GLI/Commands/MarkdownDocumentListener.html#method-i-commands","()",""],["copy_bookmark","HookApp","HookApp.html#method-i-copy_bookmark","(title, url, opts)","<p>Create a bookmark from specified title and url and copy to the clipboard.\n"],["decode","HookApp","HookApp.html#method-i-decode","(string)",""],["default_command","GLI::Commands::MarkdownDocumentListener","GLI/Commands/MarkdownDocumentListener.html#method-i-default_command","(name)","<p>Gives you the name of the current command in the current context\n"],["delete_all_hooks","HookApp","HookApp.html#method-i-delete_all_hooks","(url, force: false)","<p>Delete all hooked files/urls from target file\n"],["delete_hooks","HookApp","HookApp.html#method-i-delete_hooks","(args, opts)","<p>Delete hooks between two files/urls\n"],["encode","HookApp","HookApp.html#method-i-encode","(string)",""],["end_command","GLI::Commands::MarkdownDocumentListener","GLI/Commands/MarkdownDocumentListener.html#method-i-end_command","(_name)","<p>Ends a command, and “pops” you back up one context\n"],["end_commands","GLI::Commands::MarkdownDocumentListener","GLI/Commands/MarkdownDocumentListener.html#method-i-end_commands","()",""],["end_options","GLI::Commands::MarkdownDocumentListener","GLI/Commands/MarkdownDocumentListener.html#method-i-end_options","()",""],["ending","GLI::Commands::MarkdownDocumentListener","GLI/Commands/MarkdownDocumentListener.html#method-i-ending","()","<p>Called when processing has completed\n"],["escape_quotes","String","String.html#method-i-escape_quotes","()",""],["flag","GLI::Commands::MarkdownDocumentListener","GLI/Commands/MarkdownDocumentListener.html#method-i-flag","(name, aliases, desc, long_desc, default_value, arg_name, must_match, _type)","<p>Gives you a flag in the current context\n"],["format_regex","HookApp","HookApp.html#method-i-format_regex","(options)","<p>Create a single regex for validation of an array by first char or full match.\n"],["fzf","Hook::PromptFZF","Hook/PromptFZF.html#method-i-fzf","()","<p>Get path to fzf binary, installing if needed\n<p>@return [String] Path to fzf binary\n"],["get_hooks","HookApp","HookApp.html#method-i-get_hooks","(url)","<p>Get bookmarks hooked to file or URL. Return array of bookmark hashes.\n"],["install_fzf","Hook::PromptFZF","Hook/PromptFZF.html#method-i-install_fzf","(force: false)","<p>Install fzf on the current system. Installs to a subdirectory of the gem\n<p>@param force [Boolean] …\n"],["link_all","HookApp","HookApp.html#method-i-link_all","(args)","<p>Create bi-directional links between every file/url in the list of arguments\n"],["link_files","HookApp","HookApp.html#method-i-link_files","(args)","<p>Link 2 or more files/urls with bi-directional hooks.\n"],["linked_bookmarks","HookApp","HookApp.html#method-i-linked_bookmarks","(args, opts)","<p>Get a list of all hooks on a file/url.\n"],["new","GLI::Commands::MarkdownDocumentListener","GLI/Commands/MarkdownDocumentListener.html#method-c-new","(_global_options, _options, _arguments, app)",""],["new","Hooker","Hooker.html#method-c-new","()",""],["nil_if_missing","String","String.html#method-i-nil_if_missing","()",""],["open_gui","HookApp","HookApp.html#method-i-open_gui","(url)","<p>Open the Hook GUI for browsing/performing actions on a file or url\n"],["open_linked","HookApp","HookApp.html#method-i-open_linked","(url)","<p>Select from a menu of available hooks and open using macOS `open`.\n"],["options","GLI::Commands::MarkdownDocumentListener","GLI/Commands/MarkdownDocumentListener.html#method-i-options","()",""],["output_array","HookApp","HookApp.html#method-i-output_array","(hooks_arr, opts)","<p>Output an array of hooks in the given format.\n"],["program_desc","GLI::Commands::MarkdownDocumentListener","GLI/Commands/MarkdownDocumentListener.html#method-i-program_desc","(desc)","<p>Gives you the program description\n"],["program_long_desc","GLI::Commands::MarkdownDocumentListener","GLI/Commands/MarkdownDocumentListener.html#method-i-program_long_desc","(desc)",""],["restore_std","Hook::PromptSTD","Hook/PromptSTD.html#method-i-restore_std","()","<p>Restore silenced STDOUT and STDERR\n"],["search_bookmarks","HookApp","HookApp.html#method-i-search_bookmarks","(search, opts)","<p>Search bookmarks, using both names and addresses unless options contain “:names_only”. Return …\n"],["search_name","HookApp","HookApp.html#method-i-search_name","(search)","<p>Search boomark names/titles. Return array of bookmark hashes.\n"],["search_path_or_address","HookApp","HookApp.html#method-i-search_path_or_address","(search)","<p>Search bookmark paths and addresses. Return array of bookmark hashes.\n"],["select_hook","HookApp","HookApp.html#method-i-select_hook","(marks)","<p>Generate a menu of available hooks for selecting one or more hooks to operate on. Revamped to use `fzf`, …\n"],["silence_std","Hook::PromptSTD","Hook/PromptSTD.html#method-i-silence_std","(file = '/dev/null')","<p>Redirect STDOUT and STDERR to /dev/null or file\n<p>@param file [String] a file path to redirect to …\n"],["split_hook","String","String.html#method-i-split_hook","()",""],["split_hooks","String","String.html#method-i-split_hooks","()",""],["switch","GLI::Commands::MarkdownDocumentListener","GLI/Commands/MarkdownDocumentListener.html#method-i-switch","(name, aliases, desc, long_desc, negatable)","<p>Gives you a switch in the current context\n"],["uninstall_fzf","Hook::PromptFZF","Hook/PromptFZF.html#method-i-uninstall_fzf","()","<p>Remove fzf binary\n"],["valid_hook","String","String.html#method-i-valid_hook","()",""],["valid_hook!","String","String.html#method-i-valid_hook-21","()",""],["validate_format","HookApp","HookApp.html#method-i-validate_format","(fmt, options)","<p>Check if format fully matches or matches the first character of available options. Return full valid …\n"],["version","GLI::Commands::MarkdownDocumentListener","GLI/Commands/MarkdownDocumentListener.html#method-i-version","(version)","<p>Gives you the program version\n"],["which_fzf","Hook::PromptFZF","Hook/PromptFZF.html#method-i-which_fzf","()","<p>Return the path to the fzf binary\n<p>@return [String] Path to fzf\n"],["README","","README_rdoc.html","","<p>hookapp\n<p>A CLI for Hook.app on macOS.\n<p>hook - CLI interface for Hook.app (macOS)\n"]]}}
Binary file
@@ -116,6 +116,9 @@
116
116
  <li class="class">
117
117
  <a href="Hooker.html">Hooker</a>
118
118
  </li>
119
+ <li class="class">
120
+ <a href="Object.html">Object</a>
121
+ </li>
119
122
  <li class="class">
120
123
  <a href="String.html">String</a>
121
124
  </li>
data/lib/hook/hookapp.rb CHANGED
@@ -37,7 +37,7 @@ class HookApp
37
37
 
38
38
  begin
39
39
  mark = `osascript <<'APPLESCRIPT'
40
- tell application "Hook"
40
+ tell application "#{HOOK_APP}"
41
41
  set _hook to make bookmark with data "#{url}"
42
42
  if _hook is missing value
43
43
  return ""
@@ -60,7 +60,7 @@ class HookApp
60
60
  raise "Invalid target: #{url}" unless url
61
61
 
62
62
  hooks = `osascript <<'APPLESCRIPT'
63
- tell application "Hook"
63
+ tell application "#{HOOK_APP}"
64
64
  set _mark to make bookmark with data "#{url}"
65
65
  if _mark is missing value
66
66
  return ""
@@ -85,7 +85,7 @@ class HookApp
85
85
  tell application "System Events" to set front_app to name of first application process whose frontmost is true
86
86
  tell application "#{app}" to activate
87
87
  delay 2
88
- tell application "Hook"
88
+ tell application "#{HOOK_APP}"
89
89
  set _hook to (bookmark from active window)
90
90
  set _output to (name of _hook & "||" & address of _hook & "||" & path of _hook)
91
91
  end tell
@@ -106,7 +106,7 @@ class HookApp
106
106
  def search_name(search)
107
107
  `osascript <<'APPLESCRIPT'
108
108
  set searchString to "#{search.strip}"
109
- tell application "Hook"
109
+ tell application "#{HOOK_APP}"
110
110
  set _marks to every bookmark whose name contains searchString
111
111
  set _out to {}
112
112
  repeat with _hook in _marks
@@ -124,7 +124,7 @@ class HookApp
124
124
  def search_path_or_address(search)
125
125
  `osascript <<'APPLESCRIPT'
126
126
  set searchString to "#{search.strip}"
127
- tell application "Hook"
127
+ tell application "#{HOOK_APP}"
128
128
  set _marks to every bookmark whose path contains searchString or address contains searchString
129
129
  set _out to {}
130
130
  repeat with _hook in _marks
@@ -141,7 +141,7 @@ class HookApp
141
141
  # Get all known bookmarks. Return array of bookmark hashes.
142
142
  def all_bookmarks
143
143
  `osascript <<'APPLESCRIPT'
144
- tell application "Hook"
144
+ tell application "#{HOOK_APP}"
145
145
  set _marks to every bookmark
146
146
  set _out to {}
147
147
  repeat with _hook in _marks
@@ -316,7 +316,7 @@ class HookApp
316
316
  # Open the Hook GUI for browsing/performing actions on a file or url
317
317
  def open_gui(url)
318
318
  result = `osascript <<'APPLESCRIPT'
319
- tell application "Hook"
319
+ tell application "#{HOOK_APP}"
320
320
  set _mark to make bookmark with data "#{url.valid_hook}"
321
321
  if _mark is missing value
322
322
  return "Failed to create bookmark for #{url}"
@@ -365,7 +365,7 @@ class HookApp
365
365
 
366
366
  puts "Linking #{file} and #{target}..."
367
367
  `osascript <<'APPLESCRIPT'
368
- tell application "Hook"
368
+ tell application "#{HOOK_APP}"
369
369
  set _mark1 to make bookmark with data "#{file}"
370
370
  set _mark2 to make bookmark with data "#{target}"
371
371
  hook _mark1 and _mark2
@@ -385,7 +385,7 @@ class HookApp
385
385
  hooks = get_hooks(source)
386
386
  hooks.each do |hook|
387
387
  `osascript <<'APPLESCRIPT'
388
- tell application "Hook"
388
+ tell application "#{HOOK_APP}"
389
389
  set _mark1 to make bookmark with data "#{hook[:url]}"
390
390
  set _mark2 to make bookmark with data "#{target}"
391
391
  hook _mark1 and _mark2
@@ -409,7 +409,7 @@ class HookApp
409
409
  if res =~ /^y/i || force
410
410
  get_hooks(url).each do |hook|
411
411
  `osascript <<'APPLESCRIPT'
412
- tell application "Hook"
412
+ tell application "#{HOOK_APP}"
413
413
  set _mark1 to make bookmark with data "#{hook[:url]}"
414
414
  set _mark2 to make bookmark with data "#{url}"
415
415
  unhook _mark1 and _mark2
@@ -438,7 +438,7 @@ class HookApp
438
438
  source = urls[0]
439
439
  target = urls[1]
440
440
  `osascript <<'APPLESCRIPT'
441
- tell application "Hook"
441
+ tell application "#{HOOK_APP}"
442
442
  set _mark1 to make bookmark with data "#{source}"
443
443
  set _mark2 to make bookmark with data "#{target}"
444
444
  unhook _mark1 and _mark2
@@ -458,7 +458,7 @@ class HookApp
458
458
  link_to = args.dup.map(&:valid_hook).reject { |url| url == source }
459
459
  link_to.each do |url|
460
460
  `osascript <<'APPLESCRIPT'
461
- tell application "Hook"
461
+ tell application "#{HOOK_APP}"
462
462
  set _mark1 to make bookmark with data "#{source}"
463
463
  set _mark2 to make bookmark with data "#{url}"
464
464
  hook _mark1 and _mark2
@@ -556,7 +556,7 @@ class HookApp
556
556
 
557
557
  def encode(string)
558
558
  result = `osascript <<'APPLESCRIPT'
559
- tell application "Hook"
559
+ tell application "#{HOOK_APP}"
560
560
  percent encode "#{string.escape_quotes}"
561
561
  end tell
562
562
  APPLESCRIPT`.strip.gsub(/'/,'%27')
@@ -565,7 +565,7 @@ APPLESCRIPT`.strip.gsub(/'/,'%27')
565
565
 
566
566
  def decode(string)
567
567
  result = `osascript <<'APPLESCRIPT'
568
- tell application "Hook"
568
+ tell application "#{HOOK_APP}"
569
569
  percent decode "#{string.escape_quotes}"
570
570
  end tell
571
571
  APPLESCRIPT`.strip
data/lib/hook/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Hook
4
- VERSION = '2.0.16'
4
+ VERSION = '2.1.0'
5
5
  end
data/lib/hook.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+ HOOK_APP = "Hookmark"
2
3
 
3
4
  require 'hook/version'
4
5
  require 'tty-which'
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: 2.0.16
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brett Terpstra
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-08-23 00:00:00.000000000 Z
11
+ date: 2022-11-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aruba