rufio 0.31.0 → 0.33.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 +132 -12
- data/README.md +84 -10
- data/README_EN.md +55 -2
- data/docs/CHANGELOG_v0.32.0.md +288 -0
- data/docs/CHANGELOG_v0.33.0.md +444 -0
- data/{CHANGELOG_v0.4.0.md → docs/CHANGELOG_v0.4.0.md} +2 -2
- data/{CHANGELOG_v0.5.0.md → docs/CHANGELOG_v0.5.0.md} +3 -0
- data/{CHANGELOG_v0.7.0.md → docs/CHANGELOG_v0.7.0.md} +1 -1
- data/{CHANGELOG_v0.8.0.md → docs/CHANGELOG_v0.8.0.md} +1 -1
- data/{CHANGELOG_v0.9.0.md → docs/CHANGELOG_v0.9.0.md} +1 -1
- data/docs/file-preview-optimization-analysis.md +759 -0
- data/docs/file-preview-performance-issue-FIXED.md +547 -0
- data/lib/rufio/application.rb +9 -1
- data/lib/rufio/background_command_executor.rb +98 -0
- data/lib/rufio/command_completion.rb +101 -0
- data/lib/rufio/command_history.rb +109 -0
- data/lib/rufio/command_logger.rb +118 -0
- data/lib/rufio/command_mode.rb +51 -1
- data/lib/rufio/command_mode_ui.rb +48 -15
- data/lib/rufio/config_loader.rb +9 -0
- data/lib/rufio/directory_listing.rb +60 -12
- data/lib/rufio/keybind_handler.rb +73 -2
- data/lib/rufio/native/rufio_native.bundle +0 -0
- data/lib/rufio/native/rufio_zig.bundle +0 -0
- data/lib/rufio/native_scanner.rb +306 -0
- data/lib/rufio/native_scanner_magnus.rb +194 -0
- data/lib/rufio/native_scanner_zig.rb +221 -0
- data/lib/rufio/plugins/hello.rb +30 -0
- data/lib/rufio/shell_command_completion.rb +120 -0
- data/lib/rufio/terminal_ui.rb +155 -20
- data/lib/rufio/version.rb +1 -1
- data/lib/rufio.rb +11 -0
- data/lib_rust/rufio_native/.cargo/config.toml +2 -0
- data/lib_rust/rufio_native/Cargo.lock +346 -0
- data/lib_rust/rufio_native/Cargo.toml +18 -0
- data/lib_rust/rufio_native/build.rs +46 -0
- data/lib_rust/rufio_native/src/lib.rs +197 -0
- data/lib_zig/rufio_native/Makefile +33 -0
- data/lib_zig/rufio_native/build.zig +45 -0
- data/lib_zig/rufio_native/src/main.zig +167 -0
- metadata +36 -13
- /data/{CHANGELOG_v0.10.0.md → docs/CHANGELOG_v0.10.0.md} +0 -0
- /data/{CHANGELOG_v0.20.0.md → docs/CHANGELOG_v0.20.0.md} +0 -0
- /data/{CHANGELOG_v0.21.0.md → docs/CHANGELOG_v0.21.0.md} +0 -0
- /data/{CHANGELOG_v0.30.0.md → docs/CHANGELOG_v0.30.0.md} +0 -0
- /data/{CHANGELOG_v0.31.0.md → docs/CHANGELOG_v0.31.0.md} +0 -0
- /data/{CHANGELOG_v0.6.0.md → docs/CHANGELOG_v0.6.0.md} +0 -0
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
# rufio v0.32.0 - Command Mode Enhancements
|
|
2
|
+
|
|
3
|
+
**Release Date**: 2026-01-02
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
Version 0.32.0 introduces comprehensive command mode enhancements, including shell command execution, command history, intelligent Tab completion, and the plugin system foundation with a sample Hello plugin. This release focuses on making command mode a powerful interface for daily operations.
|
|
8
|
+
|
|
9
|
+
## 🎯 Major Features
|
|
10
|
+
|
|
11
|
+
### 1. Shell Command Execution
|
|
12
|
+
|
|
13
|
+
Execute shell commands directly from command mode using the `!` prefix.
|
|
14
|
+
|
|
15
|
+
**Usage:**
|
|
16
|
+
```
|
|
17
|
+
:!ls -la # List files with details
|
|
18
|
+
:!git status # Check git status
|
|
19
|
+
:!grep pattern * # Search for patterns
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
**Features:**
|
|
23
|
+
- ✅ Safe execution with `Open3.capture3`
|
|
24
|
+
- ✅ Separate stdout and stderr display
|
|
25
|
+
- ✅ Exit code tracking and error handling
|
|
26
|
+
- ✅ Result display in floating window
|
|
27
|
+
|
|
28
|
+
**Implementation:**
|
|
29
|
+
- `lib/rufio/command_mode.rb`: Added `execute_shell_command` method
|
|
30
|
+
- `lib/rufio/command_mode_ui.rb`: Hash-based result formatting
|
|
31
|
+
|
|
32
|
+
### 2. Command History
|
|
33
|
+
|
|
34
|
+
Navigate through previously executed commands using arrow keys.
|
|
35
|
+
|
|
36
|
+
**Usage:**
|
|
37
|
+
- `↑` (Up Arrow): Previous command
|
|
38
|
+
- `↓` (Down Arrow): Next command
|
|
39
|
+
|
|
40
|
+
**Features:**
|
|
41
|
+
- ✅ File persistence (`~/.rufio/command_history.txt`)
|
|
42
|
+
- ✅ Duplicate filtering
|
|
43
|
+
- ✅ Configurable history size (default: 1000)
|
|
44
|
+
- ✅ Automatic save on command execution
|
|
45
|
+
|
|
46
|
+
**Configuration:**
|
|
47
|
+
```ruby
|
|
48
|
+
# ~/.config/rufio/config.rb
|
|
49
|
+
COMMAND_HISTORY_SIZE = 500 # Default: 1000
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
**Implementation:**
|
|
53
|
+
- `lib/rufio/command_history.rb`: History management class
|
|
54
|
+
- `lib/rufio/config_loader.rb`: Configuration support
|
|
55
|
+
- `lib/rufio/terminal_ui.rb`: Integration with command mode
|
|
56
|
+
|
|
57
|
+
### 3. Intelligent Tab Completion
|
|
58
|
+
|
|
59
|
+
Smart Tab completion with multiple behavior modes.
|
|
60
|
+
|
|
61
|
+
**Behavior:**
|
|
62
|
+
|
|
63
|
+
1. **Single candidate**: Auto-complete
|
|
64
|
+
```
|
|
65
|
+
Input: !lsbo [Tab]
|
|
66
|
+
Result: !lsbom
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
2. **Multiple candidates with common prefix**: Complete to common prefix
|
|
70
|
+
```
|
|
71
|
+
Input: !lsap [Tab]
|
|
72
|
+
Result: !lsappinfo
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
3. **Multiple candidates, no common prefix**: Display candidate list
|
|
76
|
+
```
|
|
77
|
+
Input: !l [Tab]
|
|
78
|
+
Result: Shows list of 115 commands starting with 'l'
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
**Features:**
|
|
82
|
+
- ✅ Internal command completion
|
|
83
|
+
- ✅ Shell command completion (PATH-based)
|
|
84
|
+
- ✅ File path completion with tilde expansion
|
|
85
|
+
- ✅ History-based completion
|
|
86
|
+
- ✅ Case-insensitive matching
|
|
87
|
+
- ✅ Candidate list display (max 20 items)
|
|
88
|
+
|
|
89
|
+
**Implementation:**
|
|
90
|
+
- `lib/rufio/command_completion.rb`: Main completion logic
|
|
91
|
+
- `lib/rufio/shell_command_completion.rb`: Shell-specific completion
|
|
92
|
+
- `lib/rufio/terminal_ui.rb`: Tab key handling with candidate display
|
|
93
|
+
|
|
94
|
+
### 4. Hello Plugin (Ruby Command Example)
|
|
95
|
+
|
|
96
|
+
Simple example plugin demonstrating how to create custom Ruby commands.
|
|
97
|
+
|
|
98
|
+
**Usage:**
|
|
99
|
+
```
|
|
100
|
+
:hello # Execute the hello command
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
**Output:**
|
|
104
|
+
```
|
|
105
|
+
Hello, World! 🌍
|
|
106
|
+
|
|
107
|
+
このコマンドはRubyで実装されています。
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
**Features:**
|
|
111
|
+
- ✅ Automatic plugin loading from `lib/rufio/plugins/`
|
|
112
|
+
- ✅ Tab completion support
|
|
113
|
+
- ✅ Command history integration
|
|
114
|
+
- ✅ Comprehensive test coverage
|
|
115
|
+
|
|
116
|
+
**Creating Your Own Plugin:**
|
|
117
|
+
```ruby
|
|
118
|
+
# lib/rufio/plugins/my_plugin.rb
|
|
119
|
+
module Rufio
|
|
120
|
+
module Plugins
|
|
121
|
+
class MyPlugin < Plugin
|
|
122
|
+
def name
|
|
123
|
+
"MyPlugin"
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
def description
|
|
127
|
+
"Description of my plugin"
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
def commands
|
|
131
|
+
{
|
|
132
|
+
mycommand: method(:execute_command)
|
|
133
|
+
}
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
private
|
|
137
|
+
|
|
138
|
+
def execute_command
|
|
139
|
+
"Command result"
|
|
140
|
+
end
|
|
141
|
+
end
|
|
142
|
+
end
|
|
143
|
+
end
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
**Implementation:**
|
|
147
|
+
- `lib/rufio/plugins/hello.rb`: Hello plugin
|
|
148
|
+
- `lib/rufio.rb`: Automatic plugin loading via `PluginManager.load_all`
|
|
149
|
+
- `test/test_plugins_hello.rb`: Plugin tests
|
|
150
|
+
|
|
151
|
+
### 5. Command Mode UI Improvements
|
|
152
|
+
|
|
153
|
+
Cleaner and more intuitive command mode interface.
|
|
154
|
+
|
|
155
|
+
**Changes:**
|
|
156
|
+
- ✅ Removed "補完候補:" label (candidates shown only on Tab)
|
|
157
|
+
- ✅ Floating window for candidate display
|
|
158
|
+
- ✅ Better visual feedback for Tab completion
|
|
159
|
+
- ✅ Color-coded windows (blue for input, yellow for candidates, green/red for results)
|
|
160
|
+
|
|
161
|
+
## 📊 Technical Details
|
|
162
|
+
|
|
163
|
+
### File Changes
|
|
164
|
+
|
|
165
|
+
**New Files:**
|
|
166
|
+
- `lib/rufio/command_history.rb` - Command history management
|
|
167
|
+
- `lib/rufio/command_completion.rb` - Command completion logic
|
|
168
|
+
- `lib/rufio/shell_command_completion.rb` - Shell command completion
|
|
169
|
+
- `lib/rufio/plugins/hello.rb` - Hello plugin example
|
|
170
|
+
- `test/test_command_history.rb` - Command history tests
|
|
171
|
+
- `test/test_command_completion.rb` - Completion tests
|
|
172
|
+
- `test/test_shell_command_completion.rb` - Shell completion tests
|
|
173
|
+
- `test/test_plugins_hello.rb` - Hello plugin tests
|
|
174
|
+
|
|
175
|
+
**Modified Files:**
|
|
176
|
+
- `lib/rufio.rb` - Added plugin loading
|
|
177
|
+
- `lib/rufio/command_mode.rb` - Shell command execution
|
|
178
|
+
- `lib/rufio/command_mode_ui.rb` - UI improvements, Hash result formatting
|
|
179
|
+
- `lib/rufio/terminal_ui.rb` - History and completion integration
|
|
180
|
+
- `lib/rufio/config_loader.rb` - Command history size configuration
|
|
181
|
+
|
|
182
|
+
### Test Coverage
|
|
183
|
+
|
|
184
|
+
```
|
|
185
|
+
390 runs, 1663 assertions, 0 failures, 0 errors, 1 skips
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
All features are fully tested with comprehensive test coverage.
|
|
189
|
+
|
|
190
|
+
### Performance
|
|
191
|
+
|
|
192
|
+
- Command history: O(1) access for previous/next
|
|
193
|
+
- Tab completion: O(n) where n = number of PATH commands
|
|
194
|
+
- File path completion: Uses efficient Dir.glob with patterns
|
|
195
|
+
- Shell execution: Non-blocking with Open3.capture3
|
|
196
|
+
|
|
197
|
+
## 🔧 Configuration
|
|
198
|
+
|
|
199
|
+
### Command History Size
|
|
200
|
+
|
|
201
|
+
```ruby
|
|
202
|
+
# ~/.config/rufio/config.rb
|
|
203
|
+
COMMAND_HISTORY_SIZE = 1000 # Default: 1000
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
### History File Location
|
|
207
|
+
|
|
208
|
+
```
|
|
209
|
+
~/.rufio/command_history.txt
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
## 🎓 Usage Examples
|
|
213
|
+
|
|
214
|
+
### Shell Command Execution
|
|
215
|
+
```
|
|
216
|
+
:!ls # List files
|
|
217
|
+
:!pwd # Print working directory
|
|
218
|
+
:!git log --oneline # Git log
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
### Tab Completion
|
|
222
|
+
```
|
|
223
|
+
:h[Tab] # Complete to 'hello'
|
|
224
|
+
:!l[Tab] # Show list of commands starting with 'l'
|
|
225
|
+
:!ls /tm[Tab] # Complete to '!ls /tmp'
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
### Command History
|
|
229
|
+
```
|
|
230
|
+
:[↑] # Previous command
|
|
231
|
+
:[↓] # Next command
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
### Ruby Commands
|
|
235
|
+
```
|
|
236
|
+
:hello # Execute hello plugin
|
|
237
|
+
:copy # File operations (future)
|
|
238
|
+
:move # File operations (future)
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
## 🐛 Bug Fixes
|
|
242
|
+
|
|
243
|
+
- Fixed Tab completion not working for shell commands
|
|
244
|
+
- Fixed command input display showing candidates unnecessarily
|
|
245
|
+
- Fixed ConfigLoader method access (class method vs instance method)
|
|
246
|
+
|
|
247
|
+
## 🔄 Migration Guide
|
|
248
|
+
|
|
249
|
+
No breaking changes. All existing functionality remains compatible.
|
|
250
|
+
|
|
251
|
+
**New users:**
|
|
252
|
+
- Command history will be automatically created on first command execution
|
|
253
|
+
- No configuration required for basic usage
|
|
254
|
+
|
|
255
|
+
**Existing users:**
|
|
256
|
+
- Command history feature works automatically
|
|
257
|
+
- Previous command mode behavior preserved
|
|
258
|
+
- New Tab completion enhances existing workflow
|
|
259
|
+
|
|
260
|
+
## 📝 Known Limitations
|
|
261
|
+
|
|
262
|
+
- Command arguments not yet supported for internal commands
|
|
263
|
+
- Shell command completion limited to PATH commands
|
|
264
|
+
- History limited to command strings (no metadata)
|
|
265
|
+
|
|
266
|
+
## 🚀 Future Enhancements
|
|
267
|
+
|
|
268
|
+
- Command arguments support
|
|
269
|
+
- Command aliases
|
|
270
|
+
- Custom keybindings for command mode
|
|
271
|
+
- Command history search (Ctrl+R style)
|
|
272
|
+
- More built-in plugins
|
|
273
|
+
- Plugin dependency management
|
|
274
|
+
|
|
275
|
+
## 👏 Credits
|
|
276
|
+
|
|
277
|
+
Implemented following TDD (Test-Driven Development) methodology:
|
|
278
|
+
1. Write tests first
|
|
279
|
+
2. Run tests to confirm failures
|
|
280
|
+
3. Implement features
|
|
281
|
+
4. Verify all tests pass
|
|
282
|
+
5. Commit
|
|
283
|
+
|
|
284
|
+
All features developed with comprehensive test coverage and documentation.
|
|
285
|
+
|
|
286
|
+
---
|
|
287
|
+
|
|
288
|
+
For the main changelog, see [CHANGELOG.md](../CHANGELOG.md)
|