beniya 0.8.0 โ 0.9.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_v0.9.0.md +279 -0
- data/lib/beniya/command_mode_ui.rb +46 -0
- data/lib/beniya/terminal_ui.rb +5 -34
- data/lib/beniya/text_utils.rb +2 -2
- data/lib/beniya/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3b0ea5bde3e8a89c5d0cd771802f0dbe39bd7b56282a58c291ddf984474f722d
|
|
4
|
+
data.tar.gz: 2212bd6b8276cf569336aac01473b39cf38674998a554e732de2f13283e56f94
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 06454beb835ed04922af61ad68ba3f400ff061db1c23566cbd4034e41d6e965d6d3e3e7532de0000fcfd1241c09ff277e014e4b01d1c3068287ac6845e0a7b4e
|
|
7
|
+
data.tar.gz: 484dd36cd019d4926827e6e929599db57cb5a1b10f720032736df7157ad1518bd44fd2db61c568c78c5e450aa36f89efa8717f572909f0661295bf81d27d76fb
|
data/CHANGELOG_v0.9.0.md
ADDED
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
# CHANGELOG - beniya v0.9.0
|
|
2
|
+
|
|
3
|
+
**Release Date**: 2024-12-13
|
|
4
|
+
|
|
5
|
+
## ๐ New Features
|
|
6
|
+
|
|
7
|
+
### Command Mode Input Floating Window
|
|
8
|
+
|
|
9
|
+
- **Floating Window for Command Input**: Command mode input now displays in a modern floating window
|
|
10
|
+
- Moved from bottom line to centered floating window
|
|
11
|
+
- Consistent with other UI elements (bookmarks, results)
|
|
12
|
+
- Blue border for clear visual identification
|
|
13
|
+
- Always-visible keyboard shortcuts help text
|
|
14
|
+
|
|
15
|
+
- **Integrated Completion Suggestions**: Tab completion suggestions display directly in the input window
|
|
16
|
+
- Real-time suggestion list updates as you type
|
|
17
|
+
- Clear visual separation between input and suggestions
|
|
18
|
+
- No need to guess available commands
|
|
19
|
+
|
|
20
|
+
- **Enhanced Visual Feedback**:
|
|
21
|
+
- Input prompt with cursor indicator
|
|
22
|
+
- Automatic window sizing based on content
|
|
23
|
+
- Clean, uncluttered interface
|
|
24
|
+
- Professional appearance matching beniya's design language
|
|
25
|
+
|
|
26
|
+
### CommandModeUI Enhancements
|
|
27
|
+
|
|
28
|
+
- **New Method** (`show_input_prompt`): Displays command input in floating window
|
|
29
|
+
- `show_input_prompt(input, suggestions)`: Shows input prompt with optional completion suggestions
|
|
30
|
+
- Automatic integration with TerminalUI
|
|
31
|
+
- Consistent color scheme (blue border, white content)
|
|
32
|
+
|
|
33
|
+
## ๐จ UI/UX Improvements
|
|
34
|
+
|
|
35
|
+
### Modern Command Input Experience
|
|
36
|
+
|
|
37
|
+
Before (v0.8.0):
|
|
38
|
+
```
|
|
39
|
+
[File listing...]
|
|
40
|
+
[Footer...]
|
|
41
|
+
:helloโ โ Input at bottom of screen
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
After (v0.9.0):
|
|
45
|
+
```
|
|
46
|
+
[File listing centered behind floating window...]
|
|
47
|
+
|
|
48
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
49
|
+
โ ใณใใณใใขใผใ โ (Blue)
|
|
50
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
|
|
51
|
+
โ โ
|
|
52
|
+
โ hello_ โ
|
|
53
|
+
โ โ
|
|
54
|
+
โ ่ฃๅฎๅ่ฃ: โ
|
|
55
|
+
โ hello โ
|
|
56
|
+
โ help โ
|
|
57
|
+
โ health โ
|
|
58
|
+
โ โ
|
|
59
|
+
โ Tab: ่ฃๅฎ | Enter: ๅฎ่ก | ESC: ใญใฃใณใปใซ โ
|
|
60
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### Key Improvements
|
|
64
|
+
|
|
65
|
+
- **Centered Display**: Input window appears in screen center for better focus
|
|
66
|
+
- **Contextual Help**: Keyboard shortcuts always visible
|
|
67
|
+
- **Live Suggestions**: Completion suggestions update in real-time
|
|
68
|
+
- **Consistent Design**: Matches bookmark and result windows
|
|
69
|
+
- **No Screen Clutter**: Floating window doesn't interfere with file listing
|
|
70
|
+
|
|
71
|
+
## ๐ง Technical Improvements
|
|
72
|
+
|
|
73
|
+
### Architecture
|
|
74
|
+
|
|
75
|
+
- **Removed Legacy Methods**:
|
|
76
|
+
- Removed `draw_command_input`: Bottom-line input rendering (obsolete)
|
|
77
|
+
- Removed `draw_command_result`: Bottom-line result display (obsolete)
|
|
78
|
+
- Cleaner codebase with focused responsibilities
|
|
79
|
+
|
|
80
|
+
- **TextUtils Enhancement**:
|
|
81
|
+
- Added Unicode ranges for box drawing characters (\u2500-\u257F)
|
|
82
|
+
- Added Unicode ranges for block elements (\u2580-\u259F)
|
|
83
|
+
- Improved width calculation for special characters
|
|
84
|
+
|
|
85
|
+
### Integration
|
|
86
|
+
|
|
87
|
+
- **Automatic Display**: Command mode floating window shows automatically when activated
|
|
88
|
+
- **Suggestion Integration**: Autocomplete suggestions fetched and displayed seamlessly
|
|
89
|
+
- **Screen Refresh**: Proper screen redraw after command execution
|
|
90
|
+
|
|
91
|
+
## ๐ Bug Fixes
|
|
92
|
+
|
|
93
|
+
### Display Width Issues
|
|
94
|
+
|
|
95
|
+
- **Fixed Cursor Symbol Display**: Changed from โ (full-width block) to _ (half-width underscore)
|
|
96
|
+
- Resolved right border misalignment in command input window
|
|
97
|
+
- Full-width block characters (โ) have ambiguous width in different terminals
|
|
98
|
+
- Underscore (_) ensures consistent width across all terminal emulators
|
|
99
|
+
|
|
100
|
+
- **Improved Character Width Detection**:
|
|
101
|
+
- Added support for box drawing characters in TextUtils
|
|
102
|
+
- Added support for block elements in TextUtils
|
|
103
|
+
- More accurate display width calculation
|
|
104
|
+
|
|
105
|
+
- **Removed Colon Prefix**: Removed redundant `:` from input display
|
|
106
|
+
- Window title already indicates "ใณใใณใใขใผใ"
|
|
107
|
+
- Cleaner, less cluttered appearance
|
|
108
|
+
|
|
109
|
+
## ๐งช Testing
|
|
110
|
+
|
|
111
|
+
### Test-Driven Development
|
|
112
|
+
|
|
113
|
+
- **TDD Approach**: All features developed following strict TDD methodology
|
|
114
|
+
1. Wrote comprehensive tests first (4 new tests)
|
|
115
|
+
2. Verified tests failed as expected
|
|
116
|
+
3. Implemented features to pass tests
|
|
117
|
+
4. Committed tests before implementation
|
|
118
|
+
|
|
119
|
+
### New Tests Added
|
|
120
|
+
|
|
121
|
+
- **Command Input Floating Window Tests** (`test/test_command_mode_ui.rb`):
|
|
122
|
+
- `test_show_input_prompt_basic`: Basic input prompt display
|
|
123
|
+
- `test_show_input_prompt_empty_input`: Empty input handling
|
|
124
|
+
- `test_show_input_prompt_with_suggestions`: Suggestions display
|
|
125
|
+
- `test_show_input_prompt_color`: Border color verification
|
|
126
|
+
|
|
127
|
+
### Test Coverage
|
|
128
|
+
|
|
129
|
+
- **20 tests, 60 assertions**: Comprehensive coverage of CommandModeUI
|
|
130
|
+
- **261 total tests, 1137 assertions**: Full test suite
|
|
131
|
+
- **All tests passing**: 100% success rate
|
|
132
|
+
|
|
133
|
+
## ๐ฆ Dependencies
|
|
134
|
+
|
|
135
|
+
### No New Dependencies
|
|
136
|
+
|
|
137
|
+
- Uses existing Ruby standard library
|
|
138
|
+
- Leverages existing beniya components:
|
|
139
|
+
- `DialogRenderer`: For floating window rendering
|
|
140
|
+
- `CommandMode`: For command execution
|
|
141
|
+
- `TextUtils`: For text width calculations
|
|
142
|
+
|
|
143
|
+
## ๐ Compatibility
|
|
144
|
+
|
|
145
|
+
### Backward Compatibility
|
|
146
|
+
|
|
147
|
+
- **No Breaking Changes**: All existing features work as before
|
|
148
|
+
- **Enhanced UI**: Command mode now has better UX without changing functionality
|
|
149
|
+
- **Existing Keybindings Preserved**: `:` still activates command mode
|
|
150
|
+
|
|
151
|
+
### Platform Support
|
|
152
|
+
|
|
153
|
+
- **macOS**: Full support โ
|
|
154
|
+
- **Linux**: Full support โ
|
|
155
|
+
- **Windows**: Full support โ
|
|
156
|
+
|
|
157
|
+
## โก Performance
|
|
158
|
+
|
|
159
|
+
### Optimizations
|
|
160
|
+
|
|
161
|
+
- **No Performance Impact**: Floating window rendering is fast and efficient
|
|
162
|
+
- **Cached Calculations**: Window dimensions calculated once per render
|
|
163
|
+
- **Minimal Overhead**: Features only active when command mode is engaged
|
|
164
|
+
|
|
165
|
+
## ๐ Usage Examples
|
|
166
|
+
|
|
167
|
+
### Using the New Command Input
|
|
168
|
+
|
|
169
|
+
```bash
|
|
170
|
+
# Launch beniya
|
|
171
|
+
beniya
|
|
172
|
+
|
|
173
|
+
# Activate command mode
|
|
174
|
+
Press ':'
|
|
175
|
+
|
|
176
|
+
# Floating window appears in center:
|
|
177
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
178
|
+
โ ใณใใณใใขใผใ โ
|
|
179
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
|
|
180
|
+
โ โ
|
|
181
|
+
โ _ โ
|
|
182
|
+
โ โ
|
|
183
|
+
โ Tab: ่ฃๅฎ | Enter: ๅฎ่ก | ESC: ใญใฃใณใปใซ โ
|
|
184
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
185
|
+
|
|
186
|
+
# Type partial command
|
|
187
|
+
Type "he"
|
|
188
|
+
|
|
189
|
+
# Window updates with suggestions:
|
|
190
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
191
|
+
โ ใณใใณใใขใผใ โ
|
|
192
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
|
|
193
|
+
โ โ
|
|
194
|
+
โ he_ โ
|
|
195
|
+
โ โ
|
|
196
|
+
โ ่ฃๅฎๅ่ฃ: โ
|
|
197
|
+
โ hello โ
|
|
198
|
+
โ help โ
|
|
199
|
+
โ health โ
|
|
200
|
+
โ โ
|
|
201
|
+
โ Tab: ่ฃๅฎ | Enter: ๅฎ่ก | ESC: ใญใฃใณใปใซ โ
|
|
202
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
203
|
+
|
|
204
|
+
# Press Tab to complete
|
|
205
|
+
# Press Enter to execute
|
|
206
|
+
# Press ESC to cancel
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
### Visual Improvements
|
|
210
|
+
|
|
211
|
+
**Before (v0.8.0)**: Input at bottom of screen, suggestions not visible
|
|
212
|
+
**After (v0.9.0)**: Input in centered floating window, suggestions always visible
|
|
213
|
+
|
|
214
|
+
## ๐ฎ Future Plans
|
|
215
|
+
|
|
216
|
+
### Planned Enhancements
|
|
217
|
+
|
|
218
|
+
- **Command History**: Navigate through previously executed commands with โ/โ arrows
|
|
219
|
+
- **Command Arguments**: Support for commands with parameters
|
|
220
|
+
- **Auto-complete Menu**: Visual menu showing all available completions
|
|
221
|
+
- **Command Aliases**: User-defined shortcuts for frequently used commands
|
|
222
|
+
- **Inline Help**: Show command descriptions during completion
|
|
223
|
+
|
|
224
|
+
## ๐ Acknowledgments
|
|
225
|
+
|
|
226
|
+
Main contributions in this version:
|
|
227
|
+
|
|
228
|
+
- **Test-Driven Development**: Strict TDD methodology ensuring code quality
|
|
229
|
+
- **Consistent UI/UX**: Unified floating window design across all features
|
|
230
|
+
- **User Experience Focus**: Improved command discoverability and feedback
|
|
231
|
+
- **Cross-platform Compatibility**: Cursor symbol fix for all terminal emulators
|
|
232
|
+
|
|
233
|
+
## ๐ Detailed Changes
|
|
234
|
+
|
|
235
|
+
### Files Modified
|
|
236
|
+
|
|
237
|
+
- `lib/beniya/command_mode_ui.rb`:
|
|
238
|
+
- Added `show_input_prompt` method
|
|
239
|
+
- Removed obsolete display code
|
|
240
|
+
- `lib/beniya/terminal_ui.rb`:
|
|
241
|
+
- Integrated floating window for command input
|
|
242
|
+
- Removed `draw_command_input` method
|
|
243
|
+
- Removed `draw_command_result` method
|
|
244
|
+
- `lib/beniya/text_utils.rb`:
|
|
245
|
+
- Enhanced character width detection
|
|
246
|
+
- Added box drawing and block element ranges
|
|
247
|
+
- `test/test_command_mode_ui.rb`:
|
|
248
|
+
- Added 4 new tests for input prompt display
|
|
249
|
+
|
|
250
|
+
### Files Created
|
|
251
|
+
|
|
252
|
+
- None (all changes to existing files)
|
|
253
|
+
|
|
254
|
+
### Lines of Code
|
|
255
|
+
|
|
256
|
+
- **Added**: ~50 lines (implementation)
|
|
257
|
+
- **Modified**: ~10 lines
|
|
258
|
+
- **Removed**: ~30 lines (obsolete methods)
|
|
259
|
+
- **Net Change**: ~30 lines added
|
|
260
|
+
|
|
261
|
+
### Commit History
|
|
262
|
+
|
|
263
|
+
```
|
|
264
|
+
478971b fix: ใซใผใฝใซ่จๅทใโใใ_ใซๅคๆดใใฆ่กจ็คบๅดฉใใไฟฎๆญฃ
|
|
265
|
+
d09831f fix: ็ฝซ็ทๆๅญใจใใญใใฏ่ฆ็ด ใฎ่กจ็คบๅน
ใไฟฎๆญฃ
|
|
266
|
+
2ba2785 refactor: ใณใใณใใขใผใๅ
ฅๅใใใณใญใณใๅ้ค
|
|
267
|
+
f89693a feat: ใณใใณใๅ
ฅๅใใใญใผใใฃใณใฐใฆใฃใณใใฆใซๅคๆด
|
|
268
|
+
3ab01af test: ใณใใณใๅ
ฅๅใใญใผใใฃใณใฐใฆใฃใณใใฆใฎใในใใ่ฟฝๅ
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
## ๐ฏ Summary
|
|
272
|
+
|
|
273
|
+
Version 0.9.0 brings a significant UI/UX improvement to command mode by introducing a modern floating window interface for command input. This change provides better visual feedback, integrates completion suggestions directly into the input window, and maintains consistency with other beniya features. All changes were developed using TDD methodology and are fully tested with 100% test pass rate.
|
|
274
|
+
|
|
275
|
+
---
|
|
276
|
+
|
|
277
|
+
**Note**: This version focuses on UI/UX polish and consistency. The command mode functionality remains the same, but the user experience is significantly enhanced with the new floating window interface.
|
|
278
|
+
|
|
279
|
+
**GitHub Issues**: [https://github.com/masisz/beniya/issues](https://github.com/masisz/beniya/issues)
|
|
@@ -40,6 +40,52 @@ module Beniya
|
|
|
40
40
|
find_common_prefix(suggestions)
|
|
41
41
|
end
|
|
42
42
|
|
|
43
|
+
# ใณใใณใๅ
ฅๅใใญใณใใใใใญใผใใฃใณใฐใฆใฃใณใใฆใง่กจ็คบ
|
|
44
|
+
# @param input [String] ็พๅจใฎๅ
ฅๅๆๅญๅ
|
|
45
|
+
# @param suggestions [Array<String>] ่ฃๅฎๅ่ฃ๏ผใชใใทใงใณ๏ผ
|
|
46
|
+
def show_input_prompt(input, suggestions = [])
|
|
47
|
+
# ใฟใคใใซ
|
|
48
|
+
title = "ใณใใณใใขใผใ"
|
|
49
|
+
|
|
50
|
+
# ใณใณใใณใ่กใๆง็ฏ
|
|
51
|
+
content_lines = [""]
|
|
52
|
+
content_lines << "#{input}_" # ใซใผใฝใซใ_ใง่กจ็พ
|
|
53
|
+
content_lines << ""
|
|
54
|
+
|
|
55
|
+
# ่ฃๅฎๅ่ฃใใใๅ ดๅใฏ่กจ็คบ
|
|
56
|
+
unless suggestions.empty?
|
|
57
|
+
content_lines << "่ฃๅฎๅ่ฃ:"
|
|
58
|
+
suggestions.each do |suggestion|
|
|
59
|
+
content_lines << " #{suggestion}"
|
|
60
|
+
end
|
|
61
|
+
content_lines << ""
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
content_lines << "Tab: ่ฃๅฎ | Enter: ๅฎ่ก | ESC: ใญใฃใณใปใซ"
|
|
65
|
+
|
|
66
|
+
# ใฆใฃใณใใฆใฎ่ฒ่จญๅฎ๏ผ้๏ผ
|
|
67
|
+
border_color = "\e[34m" # Blue
|
|
68
|
+
title_color = "\e[1;34m" # Bold blue
|
|
69
|
+
content_color = "\e[37m" # White
|
|
70
|
+
|
|
71
|
+
# ใฆใฃใณใใฆใตใคใบใ่จ็ฎ
|
|
72
|
+
width, height = @dialog_renderer.calculate_dimensions(content_lines, {
|
|
73
|
+
title: title,
|
|
74
|
+
min_width: 50,
|
|
75
|
+
max_width: 80
|
|
76
|
+
})
|
|
77
|
+
|
|
78
|
+
# ไธญๅคฎไฝ็ฝฎใ่จ็ฎ
|
|
79
|
+
x, y = @dialog_renderer.calculate_center(width, height)
|
|
80
|
+
|
|
81
|
+
# ใใญใผใใฃใณใฐใฆใฃใณใใฆใๆ็ป
|
|
82
|
+
@dialog_renderer.draw_floating_window(x, y, width, height, title, content_lines, {
|
|
83
|
+
border_color: border_color,
|
|
84
|
+
title_color: title_color,
|
|
85
|
+
content_color: content_color
|
|
86
|
+
})
|
|
87
|
+
end
|
|
88
|
+
|
|
43
89
|
# ใณใใณใๅฎ่ก็ตๆใใใญใผใใฃใณใฐใฆใฃใณใใฆใง่กจ็คบ
|
|
44
90
|
# @param result [String, nil] ใณใใณใๅฎ่ก็ตๆ
|
|
45
91
|
def show_result(result)
|
data/lib/beniya/terminal_ui.rb
CHANGED
|
@@ -131,12 +131,12 @@ module Beniya
|
|
|
131
131
|
# footer
|
|
132
132
|
draw_footer
|
|
133
133
|
|
|
134
|
-
#
|
|
135
|
-
draw_command_result
|
|
136
|
-
|
|
137
|
-
# ใณใใณใใขใผใใใขใฏใใฃใใชๅ ดๅใฏใณใใณใๅ
ฅๅๆฌใ่กจ็คบ
|
|
134
|
+
# ใณใใณใใขใผใใใขใฏใใฃใใชๅ ดๅใฏใณใใณใๅ
ฅๅใฆใฃใณใใฆใ่กจ็คบ
|
|
138
135
|
if @command_mode_active
|
|
139
|
-
|
|
136
|
+
# ่ฃๅฎๅ่ฃใๅๅพ
|
|
137
|
+
suggestions = @command_mode_ui.autocomplete(@command_input)
|
|
138
|
+
# ใใญใผใใฃใณใฐใฆใฃใณใใฆใง่กจ็คบ
|
|
139
|
+
@command_mode_ui.show_input_prompt(@command_input, suggestions)
|
|
140
140
|
else
|
|
141
141
|
# move cursor to invisible position
|
|
142
142
|
print "\e[#{@screen_height};#{@screen_width}H"
|
|
@@ -625,35 +625,6 @@ module Beniya
|
|
|
625
625
|
# ็ป้ขใๅๆ็ป
|
|
626
626
|
draw_screen
|
|
627
627
|
end
|
|
628
|
-
|
|
629
|
-
# ใณใใณใๅ
ฅๅๆฌใๆ็ป
|
|
630
|
-
def draw_command_input
|
|
631
|
-
# ็ป้ขๆไธ้จใซๆ็ป
|
|
632
|
-
print "\e[#{@screen_height};1H"
|
|
633
|
-
print "\e[2K" # ่กใใฏใชใข
|
|
634
|
-
|
|
635
|
-
# ใณใใณใใใญใณใใใจๅ
ฅๅใ่กจ็คบ
|
|
636
|
-
prompt = ":"
|
|
637
|
-
print "#{prompt}#{@command_input}"
|
|
638
|
-
|
|
639
|
-
# ใซใผใฝใซใ่กจ็คบ
|
|
640
|
-
print "\e[?25h"
|
|
641
|
-
end
|
|
642
|
-
|
|
643
|
-
# ใณใใณใๅฎ่ก็ตๆใๆ็ป
|
|
644
|
-
def draw_command_result
|
|
645
|
-
return unless @command_result && @command_result_time
|
|
646
|
-
|
|
647
|
-
# 3็ง้ใ ใ่กจ็คบ
|
|
648
|
-
if Time.now - @command_result_time < 3
|
|
649
|
-
print "\e[#{@screen_height - 1};1H"
|
|
650
|
-
print "\e[2K" # ่กใใฏใชใข
|
|
651
|
-
print @command_result
|
|
652
|
-
else
|
|
653
|
-
@command_result = nil
|
|
654
|
-
@command_result_time = nil
|
|
655
|
-
end
|
|
656
|
-
end
|
|
657
628
|
end
|
|
658
629
|
end
|
|
659
630
|
|
data/lib/beniya/text_utils.rb
CHANGED
|
@@ -23,8 +23,8 @@ module Beniya
|
|
|
23
23
|
def display_width(string)
|
|
24
24
|
string.each_char.map do |char|
|
|
25
25
|
case char
|
|
26
|
-
when /[\u3000-\u303F\u3040-\u309F\u30A0-\u30FF\u4E00-\u9FAF\uFF00-\uFFEF]/
|
|
27
|
-
FULLWIDTH_CHAR_WIDTH # Japanese characters (hiragana, katakana, kanji, full-width symbols)
|
|
26
|
+
when /[\u3000-\u303F\u3040-\u309F\u30A0-\u30FF\u4E00-\u9FAF\uFF00-\uFFEF\u2500-\u257F\u2580-\u259F]/
|
|
27
|
+
FULLWIDTH_CHAR_WIDTH # Japanese characters (hiragana, katakana, kanji, full-width symbols, box drawing, block elements)
|
|
28
28
|
when /[\u0020-\u007E]/
|
|
29
29
|
HALFWIDTH_CHAR_WIDTH # ASCII characters
|
|
30
30
|
else
|
data/lib/beniya/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: beniya
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.9.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- masisz
|
|
8
8
|
bindir: bin
|
|
9
9
|
cert_chain: []
|
|
10
|
-
date: 2025-12-
|
|
10
|
+
date: 2025-12-13 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
13
|
name: io-console
|
|
@@ -122,6 +122,7 @@ files:
|
|
|
122
122
|
- CHANGELOG_v0.6.0.md
|
|
123
123
|
- CHANGELOG_v0.7.0.md
|
|
124
124
|
- CHANGELOG_v0.8.0.md
|
|
125
|
+
- CHANGELOG_v0.9.0.md
|
|
125
126
|
- README.md
|
|
126
127
|
- README_EN.md
|
|
127
128
|
- Rakefile
|