fuzz 0.1.2 → 0.2.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 +4 -4
- data/README.md +23 -25
- data/lib/fuzz/peco_picker.rb +9 -0
- data/lib/fuzz/selecta_picker.rb +9 -0
- data/lib/fuzz/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f98b1a90c7d969b3844cfcc64615c90d5b1d378e5cd76e79811d2272b727f904
|
4
|
+
data.tar.gz: '08db792fa58a84d9b17d8d688355a34c8e0dbc2509ab99b56df9e3be52bceb54'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f7cc07b5edaa679982db909227ea627721c200e376cd58ca96df9f964f4f6d343a278eb2785d141121233f4d5bebe643dd89273d6f476b9b8a1fdb3fa8600690
|
7
|
+
data.tar.gz: b3bc45fe924fe680a39a3629c22578788fc66447fd507473af0075451585e01da54406908a06b75c2220d7a5b69ba6d275a8902bfa0e1ae9bb81aad5d95c6825
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
## Fuzz:
|
1
|
+
## Fuzz: A Ruby wrapper around interactive filtering tools
|
2
2
|
|
3
3
|
[](https://travis-ci.org/hrs/fuzz)
|
4
4
|
[](https://codeclimate.com/github/hrs/fuzz/maintainability)
|
@@ -11,7 +11,7 @@ or just an arbitrary object.
|
|
11
11
|
|
12
12
|
[rofi][] and [dmenu][] are really cool tools for that! They provide a visual way
|
13
13
|
for a user to use fuzzy searching to choose among a selection of strings.
|
14
|
-
[pick][]
|
14
|
+
[pick][], [peco][], and [selecta][] provide similar services on the command line.
|
15
15
|
|
16
16
|
Unfortunately, though, these tools do *just* choose between strings. But my
|
17
17
|
scripts would often be a lot simpler if the user were able to select arbitrary
|
@@ -23,9 +23,16 @@ scripts.
|
|
23
23
|
[rofi]: https://github.com/DaveDavenport/rofi
|
24
24
|
[dmenu]: https://tools.suckless.org/dmenu
|
25
25
|
[pick]: https://github.com/calleerlandsson/pick
|
26
|
+
[peco]: https://github.com/peco/peco
|
27
|
+
[selecta]: https://github.com/garybernhardt/selecta
|
26
28
|
|
27
29
|
### For example
|
28
30
|
|
31
|
+
There are more [interesting examples in the wiki][], but here's a simple one to
|
32
|
+
get started.
|
33
|
+
|
34
|
+
[interesting examples in the wiki]: https://github.com/hrs/fuzz/wiki
|
35
|
+
|
29
36
|
I'm a fan of the excellent [RubyTapas screencasts][], and I'd like a script to
|
30
37
|
let me interactively search through their titles to pick one to play. Here's a
|
31
38
|
way I could do that:
|
@@ -92,8 +99,17 @@ Fuzz::Selector.new(
|
|
92
99
|
|
93
100
|
### Choosing a different picker
|
94
101
|
|
95
|
-
Fuzz ships with support for
|
96
|
-
takes an optional `picker:` argument
|
102
|
+
Fuzz ships with support for numerous fuzzy-matching tools, which it calls
|
103
|
+
"pickers." The `Fuzz::Selector` constructor takes an optional `picker:` argument
|
104
|
+
to pick a picker.
|
105
|
+
|
106
|
+
| Executable | Creating an instance |
|
107
|
+
|------------|----------------------------------|
|
108
|
+
| `dmenu` | `Fuzz::DmenuPicker.new` |
|
109
|
+
| `peco` | `Fuzz::PecoPicker.new` |
|
110
|
+
| `pick` | `Fuzz::PickPicker.new` |
|
111
|
+
| `rofi` | `Fuzz::RofiPicker.new` (default) |
|
112
|
+
| `selecta` | `Fuzz::SelectaPicker.new` |
|
97
113
|
|
98
114
|
For example, to use `dmenu` as your picker:
|
99
115
|
|
@@ -104,27 +120,9 @@ Fuzz::Selector.new(
|
|
104
120
|
)
|
105
121
|
```
|
106
122
|
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
Fuzz::Selector.new(
|
112
|
-
some_objects,
|
113
|
-
picker: Fuzz::PickPicker.new,
|
114
|
-
)
|
115
|
-
```
|
116
|
-
|
117
|
-
The `rofi` picker is the default, but you can also explicitly specify it:
|
118
|
-
|
119
|
-
```ruby
|
120
|
-
Fuzz::Selector.new(
|
121
|
-
some_objects,
|
122
|
-
picker: Fuzz::RofiPicker.new,
|
123
|
-
)
|
124
|
-
```
|
125
|
-
|
126
|
-
If your chosen picker can't be found (perhaps it's not installed, or not in your
|
127
|
-
`$PATH`), `Fuzz::Selector#pick` will raise a `Fuzz::MissingExecutableError`.
|
123
|
+
If the executable associated with your chosen picker can't be found (perhaps
|
124
|
+
it's not installed, or not in your `$PATH`), `Fuzz::Selector#pick` will raise a
|
125
|
+
`Fuzz::MissingExecutableError`.
|
128
126
|
|
129
127
|
### Extending `fuzz` with new pickers
|
130
128
|
|
data/lib/fuzz/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fuzz
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Harry Schwartz
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-03-
|
11
|
+
date: 2018-03-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -91,8 +91,10 @@ files:
|
|
91
91
|
- lib/fuzz/entry.rb
|
92
92
|
- lib/fuzz/executable.rb
|
93
93
|
- lib/fuzz/null_cache.rb
|
94
|
+
- lib/fuzz/peco_picker.rb
|
94
95
|
- lib/fuzz/pick_picker.rb
|
95
96
|
- lib/fuzz/rofi_picker.rb
|
97
|
+
- lib/fuzz/selecta_picker.rb
|
96
98
|
- lib/fuzz/selector.rb
|
97
99
|
- lib/fuzz/version.rb
|
98
100
|
homepage: https://github.com/hrs/fuzz
|