rufio 0.61.0 → 0.62.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/CHANGELOG.md +48 -18
- data/README.md +191 -150
- data/README_ja.md +331 -0
- data/examples/bookmarks.yml +14 -0
- data/examples/config.rb +68 -0
- data/examples/script_paths.yml +11 -0
- data/lib/rufio/application.rb +1 -1
- data/lib/rufio/bookmark_manager.rb +3 -3
- data/lib/rufio/bookmark_storage.rb +61 -60
- data/lib/rufio/config.rb +214 -0
- data/lib/rufio/config_loader.rb +144 -37
- data/lib/rufio/keybind_handler.rb +14 -9
- data/lib/rufio/script_config_loader.rb +27 -12
- data/lib/rufio/script_path_manager.rb +50 -89
- data/lib/rufio/version.rb +1 -1
- metadata +6 -14
- data/README_EN.md +0 -610
- data/config_example.rb +0 -88
- data/examples/config.yml +0 -8
- data/scripts/test_jobs/build_simulation.sh +0 -29
- data/scripts/test_jobs/deploy_simulation.sh +0 -37
- data/scripts/test_jobs/quick.sh +0 -11
- data/scripts/test_jobs/random_result.sh +0 -23
- data/scripts/test_jobs/slow_fail.sh +0 -10
- data/scripts/test_jobs/slow_success.sh +0 -10
- data/scripts/test_jobs/very_slow.sh +0 -19
- data/test_delete/test1.txt +0 -1
- data/test_delete/test2.txt +0 -1
data/README_EN.md
DELETED
|
@@ -1,610 +0,0 @@
|
|
|
1
|
-
# rufio
|
|
2
|
-
|
|
3
|
-
A terminal-based file manager written in Ruby
|
|
4
|
-
|
|
5
|
-
[日本語版](./README.md) | **English**
|
|
6
|
-
|
|
7
|
-
## Overview
|
|
8
|
-
|
|
9
|
-
rufio is a terminal-based file manager inspired by Yazi. It's implemented in Ruby with plugin support, providing lightweight and fast operations for file browsing, management, and searching.
|
|
10
|
-
|
|
11
|
-
## Features
|
|
12
|
-
|
|
13
|
-
- **Lightweight & Simple**: A lightweight file manager written in Ruby
|
|
14
|
-
- **Intuitive Operation**: Vim-like key bindings
|
|
15
|
-
- **Plugin System**: Extensible plugin architecture
|
|
16
|
-
- **Powerful Command Mode** (v0.32.0):
|
|
17
|
-
- Shell command execution (`!ls`, `!git status`, etc.)
|
|
18
|
-
- Command history (navigate with arrow keys)
|
|
19
|
-
- Intelligent Tab completion (with candidate list display)
|
|
20
|
-
- Extensible commands via Ruby plugins
|
|
21
|
-
- **Background Command Execution** (v0.33.0):
|
|
22
|
-
- Execute shell commands asynchronously with `:!command`
|
|
23
|
-
- rufio remains operational during execution
|
|
24
|
-
- Displays completion notification
|
|
25
|
-
- Automatically saves execution results to log files
|
|
26
|
-
- **Execution Log Viewer** (v0.33.0):
|
|
27
|
-
- View command execution logs with `L` key
|
|
28
|
-
- Timestamp-based log file management
|
|
29
|
-
- Intuitive UI similar to help mode
|
|
30
|
-
- **File Preview**: View text file contents on the fly
|
|
31
|
-
- **File Selection & Operations**: Select multiple files, move, copy, and delete
|
|
32
|
-
- **Real-time Filter**: Filter files by name using f key
|
|
33
|
-
- **Advanced Search**: Powerful search using fzf and rga
|
|
34
|
-
- **Multi-platform**: Runs on macOS, Linux, and Windows
|
|
35
|
-
- **External Editor Integration**: Open files with your favorite editor
|
|
36
|
-
- **English Interface**: Clean English interface
|
|
37
|
-
- **Health Check**: System dependency verification
|
|
38
|
-
|
|
39
|
-
## Installation
|
|
40
|
-
|
|
41
|
-
```bash
|
|
42
|
-
gem install rufio
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
Or add it to your Gemfile:
|
|
46
|
-
|
|
47
|
-
```ruby
|
|
48
|
-
gem 'rufio'
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
## Usage
|
|
52
|
-
|
|
53
|
-
### Basic Launch
|
|
54
|
-
|
|
55
|
-
```bash
|
|
56
|
-
rufio # Launch in current directory
|
|
57
|
-
rufio /path/to # Launch in specified directory
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
### Health Check
|
|
61
|
-
|
|
62
|
-
```bash
|
|
63
|
-
rufio -c # Check system dependencies
|
|
64
|
-
rufio --check-health # Same as above
|
|
65
|
-
rufio --help # Show help message
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
### Key Bindings
|
|
69
|
-
|
|
70
|
-
#### Basic Navigation
|
|
71
|
-
|
|
72
|
-
| Key | Function |
|
|
73
|
-
| ------------- | ----------------------------- |
|
|
74
|
-
| `j` | Move down |
|
|
75
|
-
| `k` | Move up |
|
|
76
|
-
| `h` | Move to parent directory |
|
|
77
|
-
| `l` / `Enter` | Enter directory / Select file |
|
|
78
|
-
|
|
79
|
-
#### Quick Navigation
|
|
80
|
-
|
|
81
|
-
| Key | Function |
|
|
82
|
-
| --- | ---------------------- |
|
|
83
|
-
| `g` | Move to top of list |
|
|
84
|
-
| `G` | Move to bottom of list |
|
|
85
|
-
|
|
86
|
-
#### File Operations
|
|
87
|
-
|
|
88
|
-
| Key | Function |
|
|
89
|
-
| --- | --------------------------------------- |
|
|
90
|
-
| `o` | Open selected file with external editor |
|
|
91
|
-
| `e` | Open current directory in file explorer |
|
|
92
|
-
| `r` | Refresh directory contents |
|
|
93
|
-
| `a` | Create new file |
|
|
94
|
-
| `A` | Create new directory |
|
|
95
|
-
|
|
96
|
-
#### File Selection & Operations
|
|
97
|
-
|
|
98
|
-
| Key | Function |
|
|
99
|
-
| ------- | ------------------------------------------- |
|
|
100
|
-
| `Space` | Select/deselect files and directories |
|
|
101
|
-
| `m` | Move selected items to current directory |
|
|
102
|
-
| `c` | Copy selected items to current directory |
|
|
103
|
-
| `x` | Delete selected items |
|
|
104
|
-
|
|
105
|
-
#### Real-time Filter
|
|
106
|
-
|
|
107
|
-
| Key | Function |
|
|
108
|
-
| ----------- | -------------------------------------- |
|
|
109
|
-
| `s` | Start filter mode / Re-edit filter |
|
|
110
|
-
| Text input | Filter files by name (in filter mode) |
|
|
111
|
-
| `Enter` | Keep filter and return to normal mode |
|
|
112
|
-
| `ESC` | Clear filter and return to normal mode |
|
|
113
|
-
| `Backspace` | Delete character (in filter mode) |
|
|
114
|
-
|
|
115
|
-
#### Search Functions
|
|
116
|
-
|
|
117
|
-
| Key | Function |
|
|
118
|
-
| --- | ---------------------------------------- |
|
|
119
|
-
| `f` | File name search with fzf (with preview) |
|
|
120
|
-
| `F` | File content search with rga |
|
|
121
|
-
|
|
122
|
-
#### Bookmark Functions
|
|
123
|
-
|
|
124
|
-
| Key | Function |
|
|
125
|
-
| ------- | ------------------------------- |
|
|
126
|
-
| `b` | Show bookmark menu |
|
|
127
|
-
| `P` | Enter project mode (Changed in v0.33.0) |
|
|
128
|
-
| `1`-`9` | Go to corresponding bookmark |
|
|
129
|
-
|
|
130
|
-
#### zoxide Integration
|
|
131
|
-
|
|
132
|
-
| Key | Function |
|
|
133
|
-
| --- | ---------------------------------- |
|
|
134
|
-
| `z` | Select directory from zoxide history |
|
|
135
|
-
|
|
136
|
-
#### Command Mode (v0.32.0 Enhanced)
|
|
137
|
-
|
|
138
|
-
| Key | Function |
|
|
139
|
-
| ------- | ----------------------------------------- |
|
|
140
|
-
| `:` | Activate command mode |
|
|
141
|
-
| `Tab` | Command completion / Show candidate list |
|
|
142
|
-
| `↑` | Previous command (in command mode) |
|
|
143
|
-
| `↓` | Next command (in command mode) |
|
|
144
|
-
| `Enter` | Execute command (in command mode) |
|
|
145
|
-
| `ESC` | Cancel command mode (in command mode) |
|
|
146
|
-
|
|
147
|
-
**Shell Command Execution** (v0.32.0):
|
|
148
|
-
```
|
|
149
|
-
:!ls -la # List files with details
|
|
150
|
-
:!git status # Check git status
|
|
151
|
-
:!pwd # Print working directory
|
|
152
|
-
```
|
|
153
|
-
|
|
154
|
-
**Background Execution** (v0.33.0):
|
|
155
|
-
- Execute shell commands asynchronously with `:!command`
|
|
156
|
-
- rufio remains operational during execution
|
|
157
|
-
- Displays completion notification for 3 seconds
|
|
158
|
-
- Execution results automatically saved to `~/.config/rufio/log/`
|
|
159
|
-
|
|
160
|
-
**Ruby Commands** (v0.32.0):
|
|
161
|
-
```
|
|
162
|
-
:hello # Execute Hello plugin
|
|
163
|
-
```
|
|
164
|
-
|
|
165
|
-
#### Log Viewer (v0.33.0)
|
|
166
|
-
|
|
167
|
-
| Key | Function |
|
|
168
|
-
| ----- | ---------------------------- |
|
|
169
|
-
| `L` | View command execution logs |
|
|
170
|
-
| `ESC` | Exit log viewer mode |
|
|
171
|
-
|
|
172
|
-
Command execution logs are saved to `~/.config/rufio/log/` and can be viewed with the `L` key.
|
|
173
|
-
|
|
174
|
-
#### System Operations
|
|
175
|
-
|
|
176
|
-
| Key | Function |
|
|
177
|
-
| --- | ----------- |
|
|
178
|
-
| `q` | Quit rufio |
|
|
179
|
-
|
|
180
|
-
### File Selection & Operations
|
|
181
|
-
|
|
182
|
-
#### File and Directory Selection (`Space`)
|
|
183
|
-
|
|
184
|
-
- **Select/Deselect**: Use `Space` key to select or deselect files and directories
|
|
185
|
-
- **Multiple Selection**: Select multiple files and directories simultaneously
|
|
186
|
-
- **Visual Display**: Selected items are marked with ✓ and highlighted in green
|
|
187
|
-
|
|
188
|
-
#### File Operations
|
|
189
|
-
|
|
190
|
-
| Operation | Key | Function |
|
|
191
|
-
| --------- | --- | --------------------------------------- |
|
|
192
|
-
| **Move** | `m` | Move selected items to current directory |
|
|
193
|
-
| **Copy** | `c` | Copy selected items to current directory |
|
|
194
|
-
| **Delete** | `x` | Delete selected items |
|
|
195
|
-
|
|
196
|
-
#### Delete Operation Details
|
|
197
|
-
|
|
198
|
-
- **Floating Dialog Confirmation**: Modern floating window with clear options
|
|
199
|
-
- **Visual Feedback**: Red border and warning colors for attention
|
|
200
|
-
- **Safe Operation**: Double confirmation before deletion
|
|
201
|
-
- **Comprehensive Error Handling**: Detailed error messages for failed deletions
|
|
202
|
-
- **Real-time Result Display**: Shows success/failure count in floating dialog
|
|
203
|
-
- **File System Verification**: Confirms actual deletion before reporting success
|
|
204
|
-
- **Debug Support**: Optional debug logging with BENIYA_DEBUG=1
|
|
205
|
-
|
|
206
|
-
#### Operation Workflow
|
|
207
|
-
|
|
208
|
-
```
|
|
209
|
-
1. Space → Select files/directories (multiple selection possible)
|
|
210
|
-
2. Choose operation key:
|
|
211
|
-
- m → Move to current directory
|
|
212
|
-
- c → Copy to current directory
|
|
213
|
-
- x → Delete
|
|
214
|
-
3. Floating Dialog → Confirm with Y/N, ESC to cancel
|
|
215
|
-
4. Result Display → Review operation results in floating window
|
|
216
|
-
```
|
|
217
|
-
|
|
218
|
-
#### Safety Features
|
|
219
|
-
|
|
220
|
-
- **Floating Confirmation Dialog**: Modern floating window interface for confirmations
|
|
221
|
-
- **Visual Warning System**: Red borders and colors for dangerous operations
|
|
222
|
-
- **Duplicate Check**: Automatically skip files with same names
|
|
223
|
-
- **Error Handling**: Proper handling of permission errors and other issues
|
|
224
|
-
- **Operation Log**: Detailed display of operation results in floating dialogs
|
|
225
|
-
- **Post-deletion Verification**: Confirms files are actually deleted from filesystem
|
|
226
|
-
|
|
227
|
-
### Filter Feature
|
|
228
|
-
|
|
229
|
-
#### Real-time Filter (`s`)
|
|
230
|
-
|
|
231
|
-
- **Start Filter**: Press `s` to enter filter mode
|
|
232
|
-
- **Text Input Filtering**: Supports Japanese, English, numbers, and symbols
|
|
233
|
-
- **Real-time Updates**: Display updates with each character typed
|
|
234
|
-
- **Keep Filter**: Press `Enter` to maintain filter while returning to normal operations
|
|
235
|
-
- **Clear Filter**: Press `ESC` to clear filter and return to normal display
|
|
236
|
-
- **Re-edit**: Press `s` again while filter is active to re-edit
|
|
237
|
-
- **Character Deletion**: Use `Backspace` to delete characters, auto-clear when empty
|
|
238
|
-
|
|
239
|
-
#### Usage Example
|
|
240
|
-
|
|
241
|
-
```
|
|
242
|
-
1. s → Start filter mode
|
|
243
|
-
2. ".rb" → Show only Ruby files
|
|
244
|
-
3. Enter → Keep filter, return to normal operations
|
|
245
|
-
4. j/k → Navigate within filtered results
|
|
246
|
-
5. s → Re-edit filter
|
|
247
|
-
6. ESC → Clear filter
|
|
248
|
-
```
|
|
249
|
-
|
|
250
|
-
### Search Features
|
|
251
|
-
|
|
252
|
-
#### File Name Search (`f`)
|
|
253
|
-
|
|
254
|
-
- Interactive file name search using `fzf`
|
|
255
|
-
- Real-time preview display
|
|
256
|
-
- Selected files automatically open in external editor
|
|
257
|
-
|
|
258
|
-
#### File Content Search (`F`)
|
|
259
|
-
|
|
260
|
-
- Advanced file content search using `rga` (ripgrep-all)
|
|
261
|
-
- Searches PDFs, Word documents, text in images, and more
|
|
262
|
-
- Filter results with fzf and jump to specific lines
|
|
263
|
-
|
|
264
|
-
### Bookmark Features
|
|
265
|
-
|
|
266
|
-
#### Bookmark Operations (`b`)
|
|
267
|
-
|
|
268
|
-
- **Add Bookmark**: `[A]` - Add current directory to bookmarks
|
|
269
|
-
- **List Bookmarks**: `[L]` - Display registered bookmarks
|
|
270
|
-
- **Remove Bookmark**: `[R]` - Remove a bookmark
|
|
271
|
-
- **Number Jump**: `1-9` - Jump directly to corresponding bookmark
|
|
272
|
-
|
|
273
|
-
#### Quick Navigation (`1`-`9`)
|
|
274
|
-
|
|
275
|
-
- Jump directly to bookmarks without going through the bookmark menu
|
|
276
|
-
- Supports up to 9 bookmarks
|
|
277
|
-
- Bookmark information is displayed at the top of the screen
|
|
278
|
-
|
|
279
|
-
#### Bookmark Persistence
|
|
280
|
-
|
|
281
|
-
- Bookmark information is automatically saved to `~/.config/rufio/bookmarks.json`
|
|
282
|
-
- Bookmark information is preserved after rufio restarts
|
|
283
|
-
- JSON file can be edited directly
|
|
284
|
-
|
|
285
|
-
### zoxide Integration Features
|
|
286
|
-
|
|
287
|
-
#### zoxide History Navigation (`z`)
|
|
288
|
-
|
|
289
|
-
- **Smart History**: Display directory navigation history recorded by zoxide
|
|
290
|
-
- **Frequency Order**: More frequently used directories appear higher in the list
|
|
291
|
-
- **Interactive Selection**: Select from history using floating window
|
|
292
|
-
- **Quick Navigation**: Select directories directly with number keys
|
|
293
|
-
- **Abbreviated Path Display**: Home directory shown as `~` for readability
|
|
294
|
-
|
|
295
|
-
#### Usage Example
|
|
296
|
-
|
|
297
|
-
```
|
|
298
|
-
1. z → Display zoxide history menu
|
|
299
|
-
2. 1-20 → Select directory by displayed number
|
|
300
|
-
3. ESC → Cancel and return to original screen
|
|
301
|
-
```
|
|
302
|
-
|
|
303
|
-
#### About zoxide
|
|
304
|
-
|
|
305
|
-
[zoxide](https://github.com/ajeetdsouza/zoxide) is a smart cd command that learns your directory navigation habits.
|
|
306
|
-
|
|
307
|
-
```bash
|
|
308
|
-
# Installing zoxide
|
|
309
|
-
# macOS (Homebrew)
|
|
310
|
-
brew install zoxide
|
|
311
|
-
|
|
312
|
-
# Ubuntu/Debian
|
|
313
|
-
apt install zoxide
|
|
314
|
-
|
|
315
|
-
# For other installation methods, see official documentation
|
|
316
|
-
# https://github.com/ajeetdsouza/zoxide#installation
|
|
317
|
-
```
|
|
318
|
-
|
|
319
|
-
#### Requirements
|
|
320
|
-
|
|
321
|
-
- zoxide must be installed on the system
|
|
322
|
-
- Appropriate message is displayed when zoxide is not available
|
|
323
|
-
- Empty history is handled gracefully
|
|
324
|
-
|
|
325
|
-
### Required External Tools
|
|
326
|
-
|
|
327
|
-
The following tools are required for search and history functionality:
|
|
328
|
-
|
|
329
|
-
```bash
|
|
330
|
-
# macOS (Homebrew)
|
|
331
|
-
brew install fzf rga zoxide
|
|
332
|
-
|
|
333
|
-
# Ubuntu/Debian
|
|
334
|
-
apt install fzf zoxide
|
|
335
|
-
# rga requires separate installation: https://github.com/phiresky/ripgrep-all
|
|
336
|
-
|
|
337
|
-
# Other Linux distributions
|
|
338
|
-
# Installation via package manager or manual installation required
|
|
339
|
-
```
|
|
340
|
-
|
|
341
|
-
#### Tool Usage
|
|
342
|
-
|
|
343
|
-
- **fzf**: File name search functionality (`f` key)
|
|
344
|
-
- **rga**: File content search functionality (`F` key)
|
|
345
|
-
- **zoxide**: Directory history navigation functionality (`z` key)
|
|
346
|
-
|
|
347
|
-
## Configuration
|
|
348
|
-
|
|
349
|
-
### Color Configuration (Customization)
|
|
350
|
-
|
|
351
|
-
rufio allows you to customize colors for file types and UI elements. It supports intuitive color specification using the HSL color model.
|
|
352
|
-
|
|
353
|
-
#### Supported Color Formats
|
|
354
|
-
|
|
355
|
-
```ruby
|
|
356
|
-
# HSL (Hue, Saturation, Lightness) - Recommended format
|
|
357
|
-
{hsl: [220, 80, 60]} # Hue 220°, Saturation 80%, Lightness 60%
|
|
358
|
-
|
|
359
|
-
# RGB (Red, Green, Blue)
|
|
360
|
-
{rgb: [100, 150, 200]}
|
|
361
|
-
|
|
362
|
-
# HEX (Hexadecimal)
|
|
363
|
-
{hex: "#6496c8"}
|
|
364
|
-
|
|
365
|
-
# Traditional symbols
|
|
366
|
-
:blue, :red, :green, :yellow, :cyan, :magenta, :white, :black
|
|
367
|
-
|
|
368
|
-
# ANSI color codes
|
|
369
|
-
"34" or 34
|
|
370
|
-
```
|
|
371
|
-
|
|
372
|
-
#### Configuration Example
|
|
373
|
-
|
|
374
|
-
```ruby
|
|
375
|
-
# ~/.config/rufio/config.rb
|
|
376
|
-
COLORS = {
|
|
377
|
-
# HSL color specification (intuitive and easy to adjust)
|
|
378
|
-
directory: {hsl: [220, 80, 60]}, # Blue-ish for directories
|
|
379
|
-
file: {hsl: [0, 0, 90]}, # Light gray for regular files
|
|
380
|
-
executable: {hsl: [120, 70, 50]}, # Green-ish for executable files
|
|
381
|
-
selected: {hsl: [50, 90, 70]}, # Yellow for selected items
|
|
382
|
-
preview: {hsl: [180, 60, 65]}, # Cyan for preview panel
|
|
383
|
-
|
|
384
|
-
# You can also mix different formats
|
|
385
|
-
# directory: :blue, # Symbol
|
|
386
|
-
# file: {rgb: [200, 200, 200]}, # RGB
|
|
387
|
-
# executable: {hex: "#00aa00"}, # HEX
|
|
388
|
-
}
|
|
389
|
-
```
|
|
390
|
-
|
|
391
|
-
#### About HSL Color Model
|
|
392
|
-
|
|
393
|
-
- **Hue**: 0-360 degrees (0=red, 120=green, 240=blue)
|
|
394
|
-
- **Saturation**: 0-100% (0=gray, 100=vivid)
|
|
395
|
-
- **Lightness**: 0-100% (0=black, 50=normal, 100=white)
|
|
396
|
-
|
|
397
|
-
#### Configurable Items
|
|
398
|
-
|
|
399
|
-
- `directory`: Directory color
|
|
400
|
-
- `file`: Regular file color
|
|
401
|
-
- `executable`: Executable file color
|
|
402
|
-
- `selected`: Selected item color
|
|
403
|
-
- `preview`: Preview panel color
|
|
404
|
-
|
|
405
|
-
## Plugin System
|
|
406
|
-
|
|
407
|
-
rufio features an extensible plugin system that allows you to easily add custom functionality.
|
|
408
|
-
|
|
409
|
-
### Plugin Locations
|
|
410
|
-
|
|
411
|
-
#### 1. Built-in Plugins
|
|
412
|
-
```
|
|
413
|
-
lib/rufio/plugins/*.rb
|
|
414
|
-
```
|
|
415
|
-
Plugins included with rufio by default. Provides basic functionality without external gem dependencies.
|
|
416
|
-
|
|
417
|
-
#### 2. User Plugins
|
|
418
|
-
```
|
|
419
|
-
~/.rufio/plugins/*.rb
|
|
420
|
-
```
|
|
421
|
-
Plugins you can freely add. Can be obtained from GitHub Gist or raw URLs.
|
|
422
|
-
|
|
423
|
-
### Creating Plugins
|
|
424
|
-
|
|
425
|
-
#### Simple Plugin Example
|
|
426
|
-
|
|
427
|
-
```ruby
|
|
428
|
-
# ~/.rufio/plugins/hello.rb
|
|
429
|
-
module Rufio
|
|
430
|
-
module Plugins
|
|
431
|
-
class Hello < Plugin
|
|
432
|
-
def name
|
|
433
|
-
'Hello'
|
|
434
|
-
end
|
|
435
|
-
|
|
436
|
-
def description
|
|
437
|
-
'Simple greeting plugin'
|
|
438
|
-
end
|
|
439
|
-
|
|
440
|
-
def commands
|
|
441
|
-
{
|
|
442
|
-
hello: method(:say_hello)
|
|
443
|
-
}
|
|
444
|
-
end
|
|
445
|
-
|
|
446
|
-
private
|
|
447
|
-
|
|
448
|
-
def say_hello
|
|
449
|
-
puts "Hello from rufio!"
|
|
450
|
-
end
|
|
451
|
-
end
|
|
452
|
-
end
|
|
453
|
-
end
|
|
454
|
-
```
|
|
455
|
-
|
|
456
|
-
#### Plugin with External Gem Dependencies
|
|
457
|
-
|
|
458
|
-
```ruby
|
|
459
|
-
# ~/.rufio/plugins/ai_helper.rb
|
|
460
|
-
module Rufio
|
|
461
|
-
module Plugins
|
|
462
|
-
class AiHelper < Plugin
|
|
463
|
-
requires 'anthropic' # Declare gem dependency
|
|
464
|
-
|
|
465
|
-
def name
|
|
466
|
-
'AiHelper'
|
|
467
|
-
end
|
|
468
|
-
|
|
469
|
-
def description
|
|
470
|
-
'AI assistant using Claude API'
|
|
471
|
-
end
|
|
472
|
-
|
|
473
|
-
def commands
|
|
474
|
-
{
|
|
475
|
-
ai: method(:ask_ai)
|
|
476
|
-
}
|
|
477
|
-
end
|
|
478
|
-
|
|
479
|
-
def initialize
|
|
480
|
-
super # Run dependency check
|
|
481
|
-
@client = Anthropic::Client.new(
|
|
482
|
-
api_key: ENV['ANTHROPIC_API_KEY']
|
|
483
|
-
)
|
|
484
|
-
end
|
|
485
|
-
|
|
486
|
-
private
|
|
487
|
-
|
|
488
|
-
def ask_ai(question)
|
|
489
|
-
# AI processing
|
|
490
|
-
end
|
|
491
|
-
end
|
|
492
|
-
end
|
|
493
|
-
end
|
|
494
|
-
```
|
|
495
|
-
|
|
496
|
-
### Plugin Management
|
|
497
|
-
|
|
498
|
-
#### Enable/Disable Plugins
|
|
499
|
-
|
|
500
|
-
You can control plugin activation in `~/.rufio/config.yml`:
|
|
501
|
-
|
|
502
|
-
```yaml
|
|
503
|
-
plugins:
|
|
504
|
-
fileoperations:
|
|
505
|
-
enabled: true
|
|
506
|
-
ai_helper:
|
|
507
|
-
enabled: true
|
|
508
|
-
my_custom:
|
|
509
|
-
enabled: false
|
|
510
|
-
```
|
|
511
|
-
|
|
512
|
-
#### Default Behavior
|
|
513
|
-
|
|
514
|
-
- No `config.yml` → All plugins enabled
|
|
515
|
-
- Plugin not in config → Enabled by default
|
|
516
|
-
- `enabled: false` explicitly set → Disabled
|
|
517
|
-
|
|
518
|
-
### Plugin Distribution
|
|
519
|
-
|
|
520
|
-
#### Share via GitHub Gist
|
|
521
|
-
|
|
522
|
-
```bash
|
|
523
|
-
# Plugin author
|
|
524
|
-
1. Upload .rb file to GitHub Gist
|
|
525
|
-
2. Share Raw URL with users
|
|
526
|
-
|
|
527
|
-
# User
|
|
528
|
-
$ mkdir -p ~/.rufio/plugins
|
|
529
|
-
$ curl -o ~/.rufio/plugins/my_plugin.rb [RAW_URL]
|
|
530
|
-
$ rufio
|
|
531
|
-
✓ my_plugin loaded successfully
|
|
532
|
-
```
|
|
533
|
-
|
|
534
|
-
#### Share via GitHub Repository
|
|
535
|
-
|
|
536
|
-
```bash
|
|
537
|
-
# Plugin author
|
|
538
|
-
rufio-plugins/
|
|
539
|
-
├── plugin1.rb
|
|
540
|
-
└── plugin2.rb
|
|
541
|
-
|
|
542
|
-
# User
|
|
543
|
-
$ curl -o ~/.rufio/plugins/plugin1.rb https://raw.githubusercontent.com/user/rufio-plugins/main/plugin1.rb
|
|
544
|
-
```
|
|
545
|
-
|
|
546
|
-
### Plugin Key Features
|
|
547
|
-
|
|
548
|
-
#### Required Methods
|
|
549
|
-
|
|
550
|
-
- `name`: Plugin name (required)
|
|
551
|
-
- `description`: Plugin description (optional, default: "")
|
|
552
|
-
- `version`: Plugin version (optional, default: "1.0.0")
|
|
553
|
-
- `commands`: Command definitions (optional, default: {})
|
|
554
|
-
|
|
555
|
-
#### Dependency Management
|
|
556
|
-
|
|
557
|
-
- `requires 'gem_name'`: Declare gem dependencies
|
|
558
|
-
- If dependencies are missing, displays warning and disables plugin
|
|
559
|
-
- rufio continues to start normally
|
|
560
|
-
|
|
561
|
-
#### Auto-registration
|
|
562
|
-
|
|
563
|
-
- Inheriting from `Plugin` class automatically registers with `PluginManager`
|
|
564
|
-
- No complex registration process needed
|
|
565
|
-
|
|
566
|
-
## Development
|
|
567
|
-
|
|
568
|
-
### Requirements
|
|
569
|
-
|
|
570
|
-
- Ruby 2.7.0 or later
|
|
571
|
-
- Required gems: io-console, pastel, tty-cursor, tty-screen
|
|
572
|
-
|
|
573
|
-
### Running Development Version
|
|
574
|
-
|
|
575
|
-
```bash
|
|
576
|
-
git clone https://github.com/masisz/rufio
|
|
577
|
-
cd rufio
|
|
578
|
-
bundle install
|
|
579
|
-
./exe/rufio
|
|
580
|
-
```
|
|
581
|
-
|
|
582
|
-
### Running Tests
|
|
583
|
-
|
|
584
|
-
```bash
|
|
585
|
-
bundle exec rake test
|
|
586
|
-
```
|
|
587
|
-
|
|
588
|
-
## Supported Platforms
|
|
589
|
-
|
|
590
|
-
- **macOS**: Native support
|
|
591
|
-
- **Linux**: Native support
|
|
592
|
-
- **Windows**: Basic functionality supported
|
|
593
|
-
|
|
594
|
-
## Contributing
|
|
595
|
-
|
|
596
|
-
Bug reports and feature requests are welcome at [GitHub Issues](https://github.com/masisz/rufio/issues).
|
|
597
|
-
|
|
598
|
-
Pull requests are also welcome!
|
|
599
|
-
|
|
600
|
-
### Development Guidelines
|
|
601
|
-
|
|
602
|
-
1. Follow existing code style and conventions
|
|
603
|
-
2. Add tests for new features
|
|
604
|
-
3. Update documentation as needed
|
|
605
|
-
4. Test on multiple platforms when possible
|
|
606
|
-
|
|
607
|
-
## License
|
|
608
|
-
|
|
609
|
-
MIT License
|
|
610
|
-
|
data/config_example.rb
DELETED
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
# rufio configuration example
|
|
4
|
-
# Copy this file to ~/.config/rufio/config.rb to customize your settings
|
|
5
|
-
|
|
6
|
-
# Cross-platform file opener method
|
|
7
|
-
def get_system_open_command
|
|
8
|
-
case RbConfig::CONFIG['host_os']
|
|
9
|
-
when /mswin|mingw|cygwin/
|
|
10
|
-
'start' # Windows
|
|
11
|
-
when /darwin/
|
|
12
|
-
'open' # macOS
|
|
13
|
-
when /linux|bsd/
|
|
14
|
-
'xdg-open' # Linux/BSD
|
|
15
|
-
else
|
|
16
|
-
'open' # Fallback to open
|
|
17
|
-
end
|
|
18
|
-
end
|
|
19
|
-
|
|
20
|
-
# Get the appropriate open command for current platform
|
|
21
|
-
SYSTEM_OPEN = get_system_open_command
|
|
22
|
-
|
|
23
|
-
# Language setting
|
|
24
|
-
# Available languages: 'en' (English), 'ja' (Japanese)
|
|
25
|
-
# If not specified, language will be auto-detected from environment variables
|
|
26
|
-
LANGUAGE = 'en' # or 'ja'
|
|
27
|
-
|
|
28
|
-
# Application associations
|
|
29
|
-
# Define which applications to use for opening different file types
|
|
30
|
-
APPLICATIONS = {
|
|
31
|
-
# Text files - open with 'code' (VS Code)
|
|
32
|
-
%w[txt md rb py js ts html css json xml yaml yml] => 'code',
|
|
33
|
-
|
|
34
|
-
# Image files - open with default system app
|
|
35
|
-
%w[jpg jpeg png gif bmp svg webp] => SYSTEM_OPEN,
|
|
36
|
-
|
|
37
|
-
# Video files - open with default system app
|
|
38
|
-
%w[mp4 avi mkv mov wmv] => SYSTEM_OPEN,
|
|
39
|
-
|
|
40
|
-
# Documents - open with default system app
|
|
41
|
-
%w[pdf doc docx xls xlsx ppt pptx] => SYSTEM_OPEN,
|
|
42
|
-
|
|
43
|
-
# Default application for unspecified file types
|
|
44
|
-
:default => SYSTEM_OPEN
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
# Color scheme
|
|
48
|
-
# Define colors for different types of files and UI elements
|
|
49
|
-
# You can use various color formats:
|
|
50
|
-
# - Symbols: :blue, :red, :green, :yellow, :cyan, :magenta, :white, :black
|
|
51
|
-
# - HSL: {hsl: [hue(0-360), saturation(0-100), lightness(0-100)]}
|
|
52
|
-
# - RGB: {rgb: [red(0-255), green(0-255), blue(0-255)]}
|
|
53
|
-
# - HEX: {hex: "#ff0000"}
|
|
54
|
-
# - ANSI codes: "34" or 34
|
|
55
|
-
COLORS = {
|
|
56
|
-
# HSL color examples (Hue: 0-360, Saturation: 0-100%, Lightness: 0-100%)
|
|
57
|
-
directory: { hsl: [220, 80, 60] }, # Blue directory entries
|
|
58
|
-
file: { hsl: [0, 0, 90] }, # Light gray regular files
|
|
59
|
-
executable: { hsl: [120, 70, 50] }, # Green executable files
|
|
60
|
-
selected: { hsl: [50, 90, 70] }, # Yellow currently selected item
|
|
61
|
-
preview: { hsl: [180, 60, 65] }, # Cyan preview panel
|
|
62
|
-
|
|
63
|
-
# You can also mix different formats:
|
|
64
|
-
# directory: :blue, # Traditional symbol
|
|
65
|
-
# file: {rgb: [200, 200, 200]}, # RGB format
|
|
66
|
-
# executable: {hex: "#00ff00"}, # HEX format
|
|
67
|
-
# selected: "93", # ANSI code (bright yellow)
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
# Key bindings
|
|
71
|
-
# Customize keyboard shortcuts (not yet fully implemented)
|
|
72
|
-
KEYBINDS = {
|
|
73
|
-
quit: %w[q ESC],
|
|
74
|
-
up: %w[k UP],
|
|
75
|
-
down: %w[j DOWN],
|
|
76
|
-
left: %w[h LEFT],
|
|
77
|
-
right: %w[l RIGHT ENTER],
|
|
78
|
-
top: %w[g],
|
|
79
|
-
bottom: %w[G],
|
|
80
|
-
refresh: %w[r],
|
|
81
|
-
search: %w[/],
|
|
82
|
-
open_file: %w[o SPACE]
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
# You can also set language via environment variable:
|
|
86
|
-
# export BENIYA_LANG=ja # Set to 'ja' for Japanese, 'en' for English
|
|
87
|
-
# Note: Only BENIYA_LANG is used for language detection
|
|
88
|
-
# System LANG variable is ignored to ensure English is the default
|