hookapp 2.0.8 → 2.0.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/Gemfile.lock +35 -40
- data/README.md +10 -2
- data/bin/hook +9 -0
- data/hook.rdoc +5 -1
- data/hookapp.gemspec +1 -0
- data/html/App.html +1 -1
- data/html/GLI/Commands/Doc.html +1 -1
- data/html/GLI/Commands/MarkdownDocumentListener.html +1 -1
- data/html/GLI/Commands.html +1 -1
- data/html/GLI.html +1 -1
- data/html/Hook/Prompt.html +100 -0
- data/html/Hook/PromptFZF.html +243 -0
- data/html/Hook/PromptSTD.html +177 -0
- data/html/Hook.html +1 -1
- data/html/HookApp.html +75 -28
- data/html/Hooker.html +2 -2
- data/html/README_rdoc.html +9 -2
- data/html/String.html +1 -1
- data/html/created.rid +8 -7
- data/html/index.html +11 -2
- data/html/js/navigation.js.gz +0 -0
- 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 +55 -5
- data/lib/hook/hookapp.rb +27 -4
- data/lib/hook/hooker.rb +1 -0
- data/lib/hook/prompt.rb +113 -0
- data/lib/hook/version.rb +1 -1
- data/lib/hook.rb +2 -0
- data/test/hook_clip_test.rb +1 -1
- data/test/hook_link_test.rb +2 -1
- metadata +26 -3
- data/lib/helpers/fuzzyfilefinder +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2f462bf978c37d12aea3ce3a7295369efd033dc157a3c89a51d3f0d5033e27c5
|
4
|
+
data.tar.gz: 87b79ea00550040435fbd2eadf7eb06c328c5024c098783e5e2263f8a4c86ace
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ffa2690de523d14aeae2d2bfbe8b9d1e92e8bfd1ec9b225c480c17666633e1b204f1fac4a5b4789e114aab4280ce87effbbf95d0b674cf60cb55e18e9f917e04
|
7
|
+
data.tar.gz: a51a97bf835d892dcb300f904c701823a2de808a80c4ea24468ab0657c8b048dcc3fa85c0e5371fbd20120702d2d783f09b47c7b9cb4f39688881dcb363b86e1
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,8 +1,9 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
hookapp (2.0.
|
4
|
+
hookapp (2.0.11)
|
5
5
|
gli (~> 2.20.1)
|
6
|
+
tty-which (~> 0.5, >= 0.5.0)
|
6
7
|
|
7
8
|
GEM
|
8
9
|
remote: http://rubygems.org/
|
@@ -17,53 +18,47 @@ GEM
|
|
17
18
|
builder (3.2.4)
|
18
19
|
childprocess (3.0.0)
|
19
20
|
contracts (0.17)
|
20
|
-
cucumber (
|
21
|
+
cucumber (8.0.0)
|
21
22
|
builder (~> 3.2, >= 3.2.4)
|
22
|
-
cucumber-
|
23
|
-
cucumber-
|
24
|
-
cucumber-cucumber-expressions (~>
|
25
|
-
cucumber-gherkin (~>
|
26
|
-
cucumber-html-formatter (~>
|
27
|
-
cucumber-messages (~>
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
multi_test (~> 0.1, >= 0.1.2)
|
23
|
+
cucumber-ci-environment (~> 9.0, >= 9.0.4)
|
24
|
+
cucumber-core (~> 11.0, >= 11.0.0)
|
25
|
+
cucumber-cucumber-expressions (~> 15.1, >= 15.1.1)
|
26
|
+
cucumber-gherkin (~> 23.0, >= 23.0.1)
|
27
|
+
cucumber-html-formatter (~> 19.1, >= 19.1.0)
|
28
|
+
cucumber-messages (~> 18.0, >= 18.0.0)
|
29
|
+
diff-lcs (~> 1.5, >= 1.5.0)
|
30
|
+
mime-types (~> 3.4, >= 3.4.1)
|
31
|
+
multi_test (~> 1.1, >= 1.1.0)
|
32
32
|
sys-uname (~> 1.2, >= 1.2.2)
|
33
|
-
cucumber-
|
34
|
-
|
35
|
-
cucumber-
|
36
|
-
cucumber-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
cucumber-
|
42
|
-
cucumber-messages (~>
|
43
|
-
cucumber-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
cucumber-wire (6.1.1)
|
48
|
-
cucumber-core (~> 10.0, >= 10.0.1)
|
49
|
-
cucumber-cucumber-expressions (~> 12.1, >= 12.1.2)
|
50
|
-
cucumber-messages (~> 17.0, >= 17.0.1)
|
51
|
-
diff-lcs (1.4.4)
|
52
|
-
ffi (1.15.4)
|
33
|
+
cucumber-ci-environment (9.0.4)
|
34
|
+
cucumber-core (11.0.0)
|
35
|
+
cucumber-gherkin (~> 23.0, >= 23.0.1)
|
36
|
+
cucumber-messages (~> 18.0, >= 18.0.0)
|
37
|
+
cucumber-tag-expressions (~> 4.1, >= 4.1.0)
|
38
|
+
cucumber-cucumber-expressions (15.2.0)
|
39
|
+
cucumber-gherkin (23.0.1)
|
40
|
+
cucumber-messages (~> 18.0, >= 18.0.0)
|
41
|
+
cucumber-html-formatter (19.1.0)
|
42
|
+
cucumber-messages (~> 18.0, >= 18.0.0)
|
43
|
+
cucumber-messages (18.0.0)
|
44
|
+
cucumber-tag-expressions (4.1.0)
|
45
|
+
diff-lcs (1.5.0)
|
46
|
+
ffi (1.15.5)
|
53
47
|
gli (2.20.1)
|
54
|
-
mime-types (3.
|
48
|
+
mime-types (3.4.1)
|
55
49
|
mime-types-data (~> 3.2015)
|
56
|
-
mime-types-data (3.
|
57
|
-
multi_test (
|
50
|
+
mime-types-data (3.2022.0105)
|
51
|
+
multi_test (1.1.0)
|
58
52
|
rake (13.0.6)
|
59
|
-
rdoc (6.3.
|
60
|
-
rspec-expectations (3.
|
53
|
+
rdoc (6.3.3)
|
54
|
+
rspec-expectations (3.11.0)
|
61
55
|
diff-lcs (>= 1.2.0, < 2.0)
|
62
|
-
rspec-support (~> 3.
|
63
|
-
rspec-support (3.
|
56
|
+
rspec-support (~> 3.11.0)
|
57
|
+
rspec-support (3.11.0)
|
64
58
|
sys-uname (1.2.2)
|
65
59
|
ffi (~> 1.1)
|
66
|
-
thor (1.1
|
60
|
+
thor (1.2.1)
|
61
|
+
tty-which (0.5.0)
|
67
62
|
|
68
63
|
PLATFORMS
|
69
64
|
ruby
|
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.
|
9
|
+
*v2.0.11*
|
10
10
|
|
11
11
|
## Installation
|
12
12
|
|
@@ -101,6 +101,14 @@ Display the program version
|
|
101
101
|
|
102
102
|
## Commands
|
103
103
|
|
104
|
+
### `$ hook` <mark>`browse`</mark> `PATH_OR_GLOB`
|
105
|
+
|
106
|
+
*Browse hooks*
|
107
|
+
|
108
|
+
> Select a file to see its hooks, navigate through descendents
|
109
|
+
|
110
|
+
* * * * * *
|
111
|
+
|
104
112
|
### `$ hook` <mark>`clip|cp`</mark> `FILE_OR_URL`
|
105
113
|
|
106
114
|
*Copy Hook URL for file/url to clipboard*
|
@@ -358,5 +366,5 @@ This software is licensed under the MIT License.
|
|
358
366
|
THE SOFTWARE.
|
359
367
|
|
360
368
|
|
361
|
-
Documentation generated
|
369
|
+
Documentation generated 2022-07-19 14:13
|
362
370
|
|
data/bin/hook
CHANGED
@@ -242,6 +242,15 @@ filetype by macOS. Allows multiple selections with tab key, and type-ahead fuzzy
|
|
242
242
|
end
|
243
243
|
end
|
244
244
|
|
245
|
+
desc 'Browse hooks'
|
246
|
+
long_desc 'Select a file to see its hooks, navigate through descendents'
|
247
|
+
arg_name 'PATH_OR_GLOB'
|
248
|
+
command %i[browse] do |c|
|
249
|
+
c.action do |_, _, args|
|
250
|
+
hookapp.browse_bookmarks(args)
|
251
|
+
end
|
252
|
+
end
|
253
|
+
|
245
254
|
desc 'Open the specified file or url in Hook GUI'
|
246
255
|
long_desc 'Opens Hook.app on the specified file/URL for browsing and performing actions.
|
247
256
|
|
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.
|
7
|
+
v2.0.11
|
8
8
|
|
9
9
|
=== Global Options
|
10
10
|
=== --help
|
@@ -18,6 +18,10 @@ Display the program version
|
|
18
18
|
|
19
19
|
|
20
20
|
=== Commands
|
21
|
+
==== Command: <tt>browse PATH_OR_GLOB</tt>
|
22
|
+
Browse hooks
|
23
|
+
|
24
|
+
Select a file to see its hooks, navigate through descendents
|
21
25
|
==== Command: <tt>clip|cp FILE_OR_URL</tt>
|
22
26
|
Copy Hook URL for file/url to clipboard
|
23
27
|
|
data/hookapp.gemspec
CHANGED
data/html/App.html
CHANGED
@@ -101,7 +101,7 @@
|
|
101
101
|
|
102
102
|
<footer id="validator-badges" role="contentinfo">
|
103
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.
|
104
|
+
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.3.3.
|
105
105
|
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
106
106
|
</footer>
|
107
107
|
|
data/html/GLI/Commands/Doc.html
CHANGED
@@ -85,7 +85,7 @@
|
|
85
85
|
|
86
86
|
<footer id="validator-badges" role="contentinfo">
|
87
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.
|
88
|
+
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.3.3.
|
89
89
|
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
90
90
|
</footer>
|
91
91
|
|
@@ -515,7 +515,7 @@
|
|
515
515
|
|
516
516
|
<footer id="validator-badges" role="contentinfo">
|
517
517
|
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
518
|
-
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.3.
|
518
|
+
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.3.3.
|
519
519
|
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
520
520
|
</footer>
|
521
521
|
|
data/html/GLI/Commands.html
CHANGED
@@ -85,7 +85,7 @@
|
|
85
85
|
|
86
86
|
<footer id="validator-badges" role="contentinfo">
|
87
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.
|
88
|
+
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.3.3.
|
89
89
|
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
90
90
|
</footer>
|
91
91
|
|
data/html/GLI.html
CHANGED
@@ -85,7 +85,7 @@
|
|
85
85
|
|
86
86
|
<footer id="validator-badges" role="contentinfo">
|
87
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.
|
88
|
+
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.3.3.
|
89
89
|
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
90
90
|
</footer>
|
91
91
|
|
@@ -0,0 +1,100 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta charset="UTF-8">
|
6
|
+
|
7
|
+
<title>module Hook::Prompt - hookapp</title>
|
8
|
+
|
9
|
+
<script type="text/javascript">
|
10
|
+
var rdoc_rel_prefix = "../";
|
11
|
+
var index_rel_prefix = "../";
|
12
|
+
</script>
|
13
|
+
|
14
|
+
<script src="../js/navigation.js" defer></script>
|
15
|
+
<script src="../js/search.js" defer></script>
|
16
|
+
<script src="../js/search_index.js" defer></script>
|
17
|
+
<script src="../js/searcher.js" defer></script>
|
18
|
+
<script src="../js/darkfish.js" defer></script>
|
19
|
+
|
20
|
+
<link href="../css/fonts.css" rel="stylesheet">
|
21
|
+
<link href="../css/rdoc.css" rel="stylesheet">
|
22
|
+
|
23
|
+
|
24
|
+
<body id="top" role="document" class="module">
|
25
|
+
<nav role="navigation">
|
26
|
+
<div id="project-navigation">
|
27
|
+
<div id="home-section" role="region" title="Quick navigation" class="nav-section">
|
28
|
+
<h2>
|
29
|
+
<a href="../index.html" rel="home">Home</a>
|
30
|
+
</h2>
|
31
|
+
|
32
|
+
<div id="table-of-contents-navigation">
|
33
|
+
<a href="../table_of_contents.html#pages">Pages</a>
|
34
|
+
<a href="../table_of_contents.html#classes">Classes</a>
|
35
|
+
<a href="../table_of_contents.html#methods">Methods</a>
|
36
|
+
</div>
|
37
|
+
</div>
|
38
|
+
|
39
|
+
<div id="search-section" role="search" class="project-section initially-hidden">
|
40
|
+
<form action="#" method="get" accept-charset="utf-8">
|
41
|
+
<div id="search-field-wrapper">
|
42
|
+
<input id="search-field" role="combobox" aria-label="Search"
|
43
|
+
aria-autocomplete="list" aria-controls="search-results"
|
44
|
+
type="text" name="search" placeholder="Search" spellcheck="false"
|
45
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
46
|
+
</div>
|
47
|
+
|
48
|
+
<ul id="search-results" aria-label="Search Results"
|
49
|
+
aria-busy="false" aria-expanded="false"
|
50
|
+
aria-atomic="false" class="initially-hidden"></ul>
|
51
|
+
</form>
|
52
|
+
</div>
|
53
|
+
|
54
|
+
</div>
|
55
|
+
|
56
|
+
|
57
|
+
|
58
|
+
<div id="class-metadata">
|
59
|
+
|
60
|
+
|
61
|
+
|
62
|
+
<div id="includes-section" class="nav-section">
|
63
|
+
<h3>Included Modules</h3>
|
64
|
+
|
65
|
+
<ul class="link-list">
|
66
|
+
<li><a class="include" href="PromptSTD.html">Hook::PromptSTD</a>
|
67
|
+
<li><a class="include" href="PromptFZF.html">Hook::PromptFZF</a>
|
68
|
+
</ul>
|
69
|
+
</div>
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
</div>
|
74
|
+
</nav>
|
75
|
+
|
76
|
+
<main role="main" aria-labelledby="module-Hook::Prompt">
|
77
|
+
<h1 id="module-Hook::Prompt" class="module">
|
78
|
+
module Hook::Prompt
|
79
|
+
</h1>
|
80
|
+
|
81
|
+
<section class="description">
|
82
|
+
|
83
|
+
</section>
|
84
|
+
|
85
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
</section>
|
92
|
+
</main>
|
93
|
+
|
94
|
+
|
95
|
+
<footer id="validator-badges" role="contentinfo">
|
96
|
+
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
97
|
+
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.3.3.
|
98
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
99
|
+
</footer>
|
100
|
+
|
@@ -0,0 +1,243 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta charset="UTF-8">
|
6
|
+
|
7
|
+
<title>module Hook::PromptFZF - hookapp</title>
|
8
|
+
|
9
|
+
<script type="text/javascript">
|
10
|
+
var rdoc_rel_prefix = "../";
|
11
|
+
var index_rel_prefix = "../";
|
12
|
+
</script>
|
13
|
+
|
14
|
+
<script src="../js/navigation.js" defer></script>
|
15
|
+
<script src="../js/search.js" defer></script>
|
16
|
+
<script src="../js/search_index.js" defer></script>
|
17
|
+
<script src="../js/searcher.js" defer></script>
|
18
|
+
<script src="../js/darkfish.js" defer></script>
|
19
|
+
|
20
|
+
<link href="../css/fonts.css" rel="stylesheet">
|
21
|
+
<link href="../css/rdoc.css" rel="stylesheet">
|
22
|
+
|
23
|
+
|
24
|
+
<body id="top" role="document" class="module">
|
25
|
+
<nav role="navigation">
|
26
|
+
<div id="project-navigation">
|
27
|
+
<div id="home-section" role="region" title="Quick navigation" class="nav-section">
|
28
|
+
<h2>
|
29
|
+
<a href="../index.html" rel="home">Home</a>
|
30
|
+
</h2>
|
31
|
+
|
32
|
+
<div id="table-of-contents-navigation">
|
33
|
+
<a href="../table_of_contents.html#pages">Pages</a>
|
34
|
+
<a href="../table_of_contents.html#classes">Classes</a>
|
35
|
+
<a href="../table_of_contents.html#methods">Methods</a>
|
36
|
+
</div>
|
37
|
+
</div>
|
38
|
+
|
39
|
+
<div id="search-section" role="search" class="project-section initially-hidden">
|
40
|
+
<form action="#" method="get" accept-charset="utf-8">
|
41
|
+
<div id="search-field-wrapper">
|
42
|
+
<input id="search-field" role="combobox" aria-label="Search"
|
43
|
+
aria-autocomplete="list" aria-controls="search-results"
|
44
|
+
type="text" name="search" placeholder="Search" spellcheck="false"
|
45
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
46
|
+
</div>
|
47
|
+
|
48
|
+
<ul id="search-results" aria-label="Search Results"
|
49
|
+
aria-busy="false" aria-expanded="false"
|
50
|
+
aria-atomic="false" class="initially-hidden"></ul>
|
51
|
+
</form>
|
52
|
+
</div>
|
53
|
+
|
54
|
+
</div>
|
55
|
+
|
56
|
+
|
57
|
+
|
58
|
+
<div id="class-metadata">
|
59
|
+
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
|
64
|
+
<!-- Method Quickref -->
|
65
|
+
<div id="method-list-section" class="nav-section">
|
66
|
+
<h3>Methods</h3>
|
67
|
+
|
68
|
+
<ul class="link-list" role="directory">
|
69
|
+
<li ><a href="#method-i-fzf">#fzf</a>
|
70
|
+
<li ><a href="#method-i-install_fzf">#install_fzf</a>
|
71
|
+
<li ><a href="#method-i-uninstall_fzf">#uninstall_fzf</a>
|
72
|
+
<li ><a href="#method-i-which_fzf">#which_fzf</a>
|
73
|
+
</ul>
|
74
|
+
</div>
|
75
|
+
|
76
|
+
</div>
|
77
|
+
</nav>
|
78
|
+
|
79
|
+
<main role="main" aria-labelledby="module-Hook::PromptFZF">
|
80
|
+
<h1 id="module-Hook::PromptFZF" class="module">
|
81
|
+
module Hook::PromptFZF
|
82
|
+
</h1>
|
83
|
+
|
84
|
+
<section class="description">
|
85
|
+
|
86
|
+
<p>Methods for working installing/using FuzzyFileFinder</p>
|
87
|
+
|
88
|
+
</section>
|
89
|
+
|
90
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
|
96
|
+
<section id="public-instance-5Buntitled-5D-method-details" class="method-section">
|
97
|
+
<header>
|
98
|
+
<h3>Public Instance Methods</h3>
|
99
|
+
</header>
|
100
|
+
|
101
|
+
<div id="method-i-fzf" class="method-detail ">
|
102
|
+
<div class="method-heading">
|
103
|
+
<span class="method-name">fzf</span><span
|
104
|
+
class="method-args">()</span>
|
105
|
+
<span class="method-click-advice">click to toggle source</span>
|
106
|
+
</div>
|
107
|
+
|
108
|
+
<div class="method-description">
|
109
|
+
<p>Get path to fzf binary, installing if needed</p>
|
110
|
+
|
111
|
+
<p>@return [String] Path to fzf binary</p>
|
112
|
+
|
113
|
+
<div class="method-source-code" id="fzf-source">
|
114
|
+
<pre><span class="ruby-comment"># File lib/hook/prompt.rb, line 39</span>
|
115
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">fzf</span>
|
116
|
+
<span class="ruby-ivar">@fzf</span> <span class="ruby-operator">||=</span> <span class="ruby-identifier">install_fzf</span>
|
117
|
+
<span class="ruby-keyword">end</span></pre>
|
118
|
+
</div>
|
119
|
+
</div>
|
120
|
+
|
121
|
+
|
122
|
+
</div>
|
123
|
+
|
124
|
+
<div id="method-i-install_fzf" class="method-detail ">
|
125
|
+
<div class="method-heading">
|
126
|
+
<span class="method-name">install_fzf</span><span
|
127
|
+
class="method-args">(force: false)</span>
|
128
|
+
<span class="method-click-advice">click to toggle source</span>
|
129
|
+
</div>
|
130
|
+
|
131
|
+
<div class="method-description">
|
132
|
+
<p>Install fzf on the current system. Installs to a subdirectory of the gem</p>
|
133
|
+
|
134
|
+
<p>@param force [Boolean] If true, reinstall if</p>
|
135
|
+
|
136
|
+
<pre class="ruby"><span class="ruby-identifier">needed</span>
|
137
|
+
</pre>
|
138
|
+
|
139
|
+
<p>@return [String] Path to fzf binary</p>
|
140
|
+
|
141
|
+
<div class="method-source-code" id="install_fzf-source">
|
142
|
+
<pre><span class="ruby-comment"># File lib/hook/prompt.rb, line 74</span>
|
143
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">install_fzf</span>(<span class="ruby-value">force:</span> <span class="ruby-keyword">false</span>)
|
144
|
+
<span class="ruby-keyword">if</span> <span class="ruby-identifier">force</span>
|
145
|
+
<span class="ruby-identifier">uninstall_fzf</span>
|
146
|
+
<span class="ruby-keyword">elsif</span> <span class="ruby-identifier">which_fzf</span>
|
147
|
+
<span class="ruby-keyword">return</span> <span class="ruby-identifier">which_fzf</span>
|
148
|
+
<span class="ruby-keyword">end</span>
|
149
|
+
|
150
|
+
<span class="ruby-identifier">fzf_dir</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">dirname</span>(<span class="ruby-keyword">__FILE__</span>), <span class="ruby-string">'../helpers/fzf'</span>)
|
151
|
+
<span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">mkdir_p</span>(<span class="ruby-identifier">fzf_dir</span>) <span class="ruby-keyword">unless</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">directory?</span>(<span class="ruby-identifier">fzf_dir</span>)
|
152
|
+
<span class="ruby-identifier">fzf_bin</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-identifier">fzf_dir</span>, <span class="ruby-string">'bin/fzf'</span>)
|
153
|
+
<span class="ruby-keyword">return</span> <span class="ruby-identifier">fzf_bin</span> <span class="ruby-keyword">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span>(<span class="ruby-identifier">fzf_bin</span>)
|
154
|
+
|
155
|
+
<span class="ruby-identifier">warn</span> <span class="ruby-string">'fzf: Compiling and installing fzf -- this will only happen once'</span>
|
156
|
+
<span class="ruby-identifier">warn</span> <span class="ruby-string">'fzf: fzf is copyright Junegunn Choi, MIT License <https://github.com/junegunn/fzf/blob/master/LICENSE>'</span>
|
157
|
+
|
158
|
+
<span class="ruby-identifier">silence_std</span>
|
159
|
+
<span class="ruby-node">`'#{fzf_dir}/install' --bin --no-key-bindings --no-completion --no-update-rc --no-bash --no-zsh --no-fish &> /dev/null`</span>
|
160
|
+
<span class="ruby-keyword">unless</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span>(<span class="ruby-identifier">fzf_bin</span>)
|
161
|
+
<span class="ruby-identifier">restore_std</span>
|
162
|
+
<span class="ruby-identifier">warn</span> <span class="ruby-string">'Error installing, trying again as root'</span>
|
163
|
+
<span class="ruby-identifier">silence_std</span>
|
164
|
+
<span class="ruby-node">`sudo '#{fzf_dir}/install' --bin --no-key-bindings --no-completion --no-update-rc --no-bash --no-zsh --no-fish &> /dev/null`</span>
|
165
|
+
<span class="ruby-keyword">end</span>
|
166
|
+
<span class="ruby-identifier">restore_std</span>
|
167
|
+
<span class="ruby-keyword">unless</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span>(<span class="ruby-identifier">fzf_bin</span>)
|
168
|
+
<span class="ruby-identifier">puts</span> <span class="ruby-string">'fzf: unable to install fzf. You can install manually and Hook CLI will use the system version.'</span>
|
169
|
+
<span class="ruby-identifier">puts</span> <span class="ruby-string">'fzf: see https://github.com/junegunn/fzf#installation'</span>
|
170
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-constant">RuntimeError</span>.<span class="ruby-identifier">new</span>(<span class="ruby-string">'Error installing fzf, please report at https://github.com/ttscoff/hookapp/issues'</span>)
|
171
|
+
<span class="ruby-keyword">end</span>
|
172
|
+
|
173
|
+
<span class="ruby-identifier">warn</span> <span class="ruby-node">"fzf: installed to #{fzf}"</span>
|
174
|
+
<span class="ruby-identifier">fzf_bin</span>
|
175
|
+
<span class="ruby-keyword">end</span></pre>
|
176
|
+
</div>
|
177
|
+
</div>
|
178
|
+
|
179
|
+
|
180
|
+
</div>
|
181
|
+
|
182
|
+
<div id="method-i-uninstall_fzf" class="method-detail ">
|
183
|
+
<div class="method-heading">
|
184
|
+
<span class="method-name">uninstall_fzf</span><span
|
185
|
+
class="method-args">()</span>
|
186
|
+
<span class="method-click-advice">click to toggle source</span>
|
187
|
+
</div>
|
188
|
+
|
189
|
+
<div class="method-description">
|
190
|
+
<p>Remove fzf binary</p>
|
191
|
+
|
192
|
+
<div class="method-source-code" id="uninstall_fzf-source">
|
193
|
+
<pre><span class="ruby-comment"># File lib/hook/prompt.rb, line 46</span>
|
194
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">uninstall_fzf</span>
|
195
|
+
<span class="ruby-identifier">fzf_bin</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">dirname</span>(<span class="ruby-keyword">__FILE__</span>), <span class="ruby-string">'../helpers/fzf/bin/fzf'</span>)
|
196
|
+
<span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">rm_f</span>(<span class="ruby-identifier">fzf_bin</span>) <span class="ruby-keyword">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span>(<span class="ruby-identifier">fzf_bin</span>)
|
197
|
+
<span class="ruby-identifier">warn</span> <span class="ruby-string">'fzf: removed #{fzf_bin}'</span>
|
198
|
+
<span class="ruby-keyword">end</span></pre>
|
199
|
+
</div>
|
200
|
+
</div>
|
201
|
+
|
202
|
+
|
203
|
+
</div>
|
204
|
+
|
205
|
+
<div id="method-i-which_fzf" class="method-detail ">
|
206
|
+
<div class="method-heading">
|
207
|
+
<span class="method-name">which_fzf</span><span
|
208
|
+
class="method-args">()</span>
|
209
|
+
<span class="method-click-advice">click to toggle source</span>
|
210
|
+
</div>
|
211
|
+
|
212
|
+
<div class="method-description">
|
213
|
+
<p>Return the path to the fzf binary</p>
|
214
|
+
|
215
|
+
<p>@return [String] Path to fzf</p>
|
216
|
+
|
217
|
+
<div class="method-source-code" id="which_fzf-source">
|
218
|
+
<pre><span class="ruby-comment"># File lib/hook/prompt.rb, line 57</span>
|
219
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">which_fzf</span>
|
220
|
+
<span class="ruby-identifier">fzf_dir</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">dirname</span>(<span class="ruby-keyword">__FILE__</span>), <span class="ruby-string">'../helpers/fzf'</span>)
|
221
|
+
<span class="ruby-identifier">fzf_bin</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-identifier">fzf_dir</span>, <span class="ruby-string">'bin/fzf'</span>)
|
222
|
+
<span class="ruby-keyword">return</span> <span class="ruby-identifier">fzf_bin</span> <span class="ruby-keyword">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span>(<span class="ruby-identifier">fzf_bin</span>)
|
223
|
+
|
224
|
+
<span class="ruby-constant">TTY</span><span class="ruby-operator">::</span><span class="ruby-constant">Which</span>.<span class="ruby-identifier">which</span>(<span class="ruby-string">'fzf'</span>)
|
225
|
+
<span class="ruby-keyword">end</span></pre>
|
226
|
+
</div>
|
227
|
+
</div>
|
228
|
+
|
229
|
+
|
230
|
+
</div>
|
231
|
+
|
232
|
+
</section>
|
233
|
+
|
234
|
+
</section>
|
235
|
+
</main>
|
236
|
+
|
237
|
+
|
238
|
+
<footer id="validator-badges" role="contentinfo">
|
239
|
+
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
240
|
+
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.3.3.
|
241
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
242
|
+
</footer>
|
243
|
+
|