rufio 0.11.0 → 0.21.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.
@@ -104,5 +104,54 @@ module Rufio
104
104
 
105
105
  space_break_point || punct_break_point || best_break_point
106
106
  end
107
+
108
+ # Wrap preview lines to fit within max_width
109
+ # @param lines [Array<String>] Lines to wrap
110
+ # @param max_width [Integer] Maximum width for each line
111
+ # @return [Array<String>] Wrapped lines
112
+ def wrap_preview_lines(lines, max_width)
113
+ return lines if max_width <= 0
114
+
115
+ wrapped = []
116
+ lines.each do |line|
117
+ # Remove trailing whitespace
118
+ line = line.rstrip
119
+
120
+ # If line is empty, keep it
121
+ if line.empty?
122
+ wrapped << ''
123
+ next
124
+ end
125
+
126
+ # If line fits within max_width, keep it as is
127
+ if display_width(line) <= max_width
128
+ wrapped << line
129
+ next
130
+ end
131
+
132
+ # Split long lines
133
+ current_line = []
134
+ current_width = 0
135
+
136
+ line.each_char do |char|
137
+ char_width = display_width(char)
138
+
139
+ if current_width + char_width > max_width
140
+ # Start a new line
141
+ wrapped << current_line.join
142
+ current_line = [char]
143
+ current_width = char_width
144
+ else
145
+ current_line << char
146
+ current_width += char_width
147
+ end
148
+ end
149
+
150
+ # Add remaining characters
151
+ wrapped << current_line.join unless current_line.empty?
152
+ end
153
+
154
+ wrapped
155
+ end
107
156
  end
108
157
  end
data/lib/rufio/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Rufio
4
- VERSION = '0.11.0'
4
+ VERSION = '0.21.0'
5
5
  end
data/lib/rufio.rb CHANGED
@@ -28,6 +28,11 @@ require_relative "rufio/plugin_manager"
28
28
  require_relative "rufio/command_mode"
29
29
  require_relative "rufio/command_mode_ui"
30
30
 
31
+ # プロジェクトモード
32
+ require_relative "rufio/project_mode"
33
+ require_relative "rufio/project_command"
34
+ require_relative "rufio/project_log"
35
+
31
36
  module Rufio
32
37
  class Error < StandardError; end
33
38
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rufio
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.0
4
+ version: 0.21.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - masisz
@@ -118,6 +118,8 @@ extra_rdoc_files: []
118
118
  files:
119
119
  - CHANGELOG.md
120
120
  - CHANGELOG_v0.10.0.md
121
+ - CHANGELOG_v0.20.0.md
122
+ - CHANGELOG_v0.21.0.md
121
123
  - CHANGELOG_v0.4.0.md
122
124
  - CHANGELOG_v0.5.0.md
123
125
  - CHANGELOG_v0.6.0.md
@@ -155,6 +157,9 @@ files:
155
157
  - lib/rufio/plugin_config.rb
156
158
  - lib/rufio/plugin_manager.rb
157
159
  - lib/rufio/plugins/file_operations.rb
160
+ - lib/rufio/project_command.rb
161
+ - lib/rufio/project_log.rb
162
+ - lib/rufio/project_mode.rb
158
163
  - lib/rufio/selection_manager.rb
159
164
  - lib/rufio/terminal_ui.rb
160
165
  - lib/rufio/text_utils.rb