rufio 0.41.0 → 0.50.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.
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rufio
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.41.0
4
+ version: 0.50.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - masisz
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-01-17 00:00:00.000000000 Z
11
+ date: 2026-01-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: io-console
@@ -134,6 +134,7 @@ files:
134
134
  - docs/CHANGELOG_v0.40.0.md
135
135
  - docs/CHANGELOG_v0.41.0.md
136
136
  - docs/CHANGELOG_v0.5.0.md
137
+ - docs/CHANGELOG_v0.50.0.md
137
138
  - docs/CHANGELOG_v0.6.0.md
138
139
  - docs/CHANGELOG_v0.7.0.md
139
140
  - docs/CHANGELOG_v0.8.0.md
@@ -150,6 +151,7 @@ files:
150
151
  - lib/rufio/background_command_executor.rb
151
152
  - lib/rufio/bookmark.rb
152
153
  - lib/rufio/bookmark_manager.rb
154
+ - lib/rufio/builtin_commands.rb
153
155
  - lib/rufio/color_helper.rb
154
156
  - lib/rufio/command_completion.rb
155
157
  - lib/rufio/command_history.rb
@@ -160,29 +162,27 @@ files:
160
162
  - lib/rufio/config_loader.rb
161
163
  - lib/rufio/dialog_renderer.rb
162
164
  - lib/rufio/directory_listing.rb
165
+ - lib/rufio/dsl_command.rb
166
+ - lib/rufio/dsl_command_loader.rb
163
167
  - lib/rufio/file_opener.rb
164
168
  - lib/rufio/file_operations.rb
165
169
  - lib/rufio/file_preview.rb
166
170
  - lib/rufio/filter_manager.rb
167
171
  - lib/rufio/health_checker.rb
168
172
  - lib/rufio/info_notice.rb
173
+ - lib/rufio/interpreter_resolver.rb
169
174
  - lib/rufio/keybind_handler.rb
170
175
  - lib/rufio/logger.rb
171
176
  - lib/rufio/native/rufio_zig.bundle
172
177
  - lib/rufio/native_scanner.rb
173
178
  - lib/rufio/native_scanner_zig.rb
174
179
  - lib/rufio/parallel_scanner.rb
175
- - lib/rufio/plugin.rb
176
- - lib/rufio/plugin_config.rb
177
- - lib/rufio/plugin_manager.rb
178
- - lib/rufio/plugins/file_operations.rb
179
- - lib/rufio/plugins/hello.rb
180
- - lib/rufio/plugins/stop.rb
181
180
  - lib/rufio/project_command.rb
182
181
  - lib/rufio/project_log.rb
183
182
  - lib/rufio/project_mode.rb
184
183
  - lib/rufio/renderer.rb
185
184
  - lib/rufio/screen.rb
185
+ - lib/rufio/script_executor.rb
186
186
  - lib/rufio/selection_manager.rb
187
187
  - lib/rufio/shell_command_completion.rb
188
188
  - lib/rufio/terminal_ui.rb
data/lib/rufio/plugin.rb DELETED
@@ -1,89 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Rufio
4
- # プラグインを格納するモジュール
5
- module Plugins
6
- end
7
-
8
- # プラグインの基底クラス
9
- class Plugin
10
- # 依存gemが不足している場合に投げられるエラー
11
- class DependencyError < StandardError; end
12
-
13
- class << self
14
- # 継承時に自動的にPluginManagerに登録する
15
- def inherited(subclass)
16
- super
17
- PluginManager.register(subclass)
18
- end
19
-
20
- # 依存gemを宣言する
21
- def requires(*gems)
22
- @required_gems ||= []
23
- @required_gems.concat(gems)
24
- end
25
-
26
- # 宣言された依存gemのリストを取得する
27
- def required_gems
28
- @required_gems || []
29
- end
30
- end
31
-
32
- # 初期化時に依存gemをチェックする
33
- def initialize
34
- check_dependencies!
35
- end
36
-
37
- # プラグイン名(必須オーバーライド)
38
- def name
39
- raise NotImplementedError, "#{self.class}#name must be implemented"
40
- end
41
-
42
- # プラグインの説明(オプション)
43
- def description
44
- ""
45
- end
46
-
47
- # プラグインのバージョン(オプション)
48
- def version
49
- "1.0.0"
50
- end
51
-
52
- # コマンド定義(オプション)
53
- # { command_name: method(:method_name) } の形式で返す
54
- def commands
55
- {}
56
- end
57
-
58
- private
59
-
60
- # 依存gemが全て利用可能かチェックする
61
- def check_dependencies!
62
- required_gems = self.class.required_gems
63
- return if required_gems.empty?
64
-
65
- missing_gems = []
66
-
67
- required_gems.each do |gem_name|
68
- begin
69
- Gem::Specification.find_by_name(gem_name)
70
- rescue Gem::LoadError
71
- missing_gems << gem_name
72
- end
73
- end
74
-
75
- return if missing_gems.empty?
76
-
77
- # 不足しているgemがある場合はエラーを投げる
78
- error_message = <<~ERROR
79
- Plugin '#{name}' は以下のgemに依存していますが、インストールされていません:
80
- - #{missing_gems.join("\n - ")}
81
-
82
- 以下のコマンドでインストールしてください:
83
- gem install #{missing_gems.join(' ')}
84
- ERROR
85
-
86
- raise DependencyError, error_message
87
- end
88
- end
89
- end
@@ -1,59 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'yaml'
4
-
5
- module Rufio
6
- # プラグインの設定を管理するクラス
7
- class PluginConfig
8
- class << self
9
- # 設定ファイルを読み込む
10
- def load
11
- config_path = File.expand_path('~/.rufio/config.yml')
12
-
13
- if File.exist?(config_path)
14
- begin
15
- @config = YAML.load_file(config_path) || {}
16
- rescue StandardError => e
17
- warn "⚠️ Failed to load config file: #{e.message}"
18
- @config = {}
19
- end
20
- else
21
- # 設定ファイルが存在しない場合はデフォルト設定(空のハッシュ)
22
- @config = {}
23
- end
24
- end
25
-
26
- # プラグインが有効かどうかをチェックする
27
- def plugin_enabled?(name)
28
- # 設定が未読み込みの場合は読み込む
29
- load if @config.nil?
30
-
31
- # pluginsセクションがない場合は全プラグイン有効
32
- return true unless @config.is_a?(Hash) && @config['plugins']
33
-
34
- plugins_config = @config['plugins']
35
- return true unless plugins_config.is_a?(Hash)
36
-
37
- # プラグイン名を小文字に統一して検索
38
- normalized_name = name.to_s.downcase
39
-
40
- # 設定のキーも小文字に変換して検索
41
- plugin_setting = nil
42
- plugins_config.each do |key, value|
43
- if key.downcase == normalized_name
44
- plugin_setting = value
45
- break
46
- end
47
- end
48
-
49
- # 設定が存在しない場合は有効とみなす
50
- return true if plugin_setting.nil?
51
-
52
- # enabled設定を確認(デフォルトはtrue)
53
- return true unless plugin_setting.is_a?(Hash)
54
-
55
- plugin_setting.fetch('enabled', true)
56
- end
57
- end
58
- end
59
- end
@@ -1,84 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Rufio
4
- # プラグインを管理するクラス
5
- class PluginManager
6
- class << self
7
- # 登録済みプラグインクラスのリスト
8
- def plugins
9
- @plugins ||= []
10
- end
11
-
12
- # プラグインを登録する
13
- def register(plugin_class)
14
- @plugins ||= []
15
- @plugins << plugin_class unless @plugins.include?(plugin_class)
16
- end
17
-
18
- # 全プラグインを読み込む(本体同梱 + ユーザープラグイン)
19
- def load_all
20
- load_builtin_plugins
21
- load_user_plugins
22
- end
23
-
24
- # 有効なプラグインインスタンスのリストを取得
25
- def enabled_plugins
26
- return @enabled_plugins if @enabled_plugins
27
-
28
- @enabled_plugins = []
29
-
30
- plugins.each do |plugin_class|
31
- # プラグイン名を取得(クラス名から推測)
32
- plugin_name = plugin_class.name.split('::').last
33
-
34
- # PluginConfigで有効かチェック
35
- next unless PluginConfig.plugin_enabled?(plugin_name)
36
-
37
- # プラグインのインスタンスを作成
38
- begin
39
- plugin_instance = plugin_class.new
40
- @enabled_plugins << plugin_instance
41
- rescue Plugin::DependencyError => e
42
- warn "⚠️ #{e.message}"
43
- # プラグインは無効化されるが、rufioは起動継続
44
- rescue StandardError => e
45
- warn "⚠️ Failed to load plugin #{plugin_name}: #{e.message}"
46
- end
47
- end
48
-
49
- @enabled_plugins
50
- end
51
-
52
- private
53
-
54
- # 本体同梱プラグインを読み込む
55
- def load_builtin_plugins
56
- # plugin_manager.rbは/lib/rufio/にあるので、pluginsディレクトリは同じディレクトリ内
57
- builtin_plugins_dir = File.join(__dir__, 'plugins')
58
- return unless Dir.exist?(builtin_plugins_dir)
59
-
60
- Dir.glob(File.join(builtin_plugins_dir, '*.rb')).sort.each do |file|
61
- begin
62
- require file
63
- rescue StandardError => e
64
- warn "⚠️ Failed to load builtin plugin #{File.basename(file)}: #{e.message}"
65
- end
66
- end
67
- end
68
-
69
- # ユーザープラグインを読み込む
70
- def load_user_plugins
71
- user_plugins_dir = File.expand_path('~/.rufio/plugins')
72
- return unless Dir.exist?(user_plugins_dir)
73
-
74
- Dir.glob(File.join(user_plugins_dir, '*.rb')).sort.each do |file|
75
- begin
76
- require file
77
- rescue SyntaxError, StandardError => e
78
- warn "⚠️ Failed to load user plugin #{File.basename(file)}: #{e.message}"
79
- end
80
- end
81
- end
82
- end
83
- end
84
- end
@@ -1,44 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Rufio
4
- module Plugins
5
- # 基本的なファイル操作を提供するプラグイン
6
- class FileOperations < Plugin
7
- def name
8
- "FileOperations"
9
- end
10
-
11
- def description
12
- "基本的なファイル操作(コピー、移動、削除)"
13
- end
14
-
15
- def commands
16
- {
17
- copy: method(:copy),
18
- move: method(:move),
19
- delete: method(:delete)
20
- }
21
- end
22
-
23
- private
24
-
25
- # ファイルコピー(スタブ実装)
26
- def copy
27
- # 実装は将来追加
28
- nil
29
- end
30
-
31
- # ファイル移動(スタブ実装)
32
- def move
33
- # 実装は将来追加
34
- nil
35
- end
36
-
37
- # ファイル削除(スタブ実装)
38
- def delete
39
- # 実装は将来追加
40
- nil
41
- end
42
- end
43
- end
44
- end
@@ -1,30 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Rufio
4
- module Plugins
5
- # Hello コマンドを提供するプラグイン
6
- # Rubyコードで挨拶を返す簡単な例
7
- class Hello < Plugin
8
- def name
9
- "Hello"
10
- end
11
-
12
- def description
13
- "Rubyで実装された挨拶コマンドの例"
14
- end
15
-
16
- def commands
17
- {
18
- hello: method(:say_hello)
19
- }
20
- end
21
-
22
- private
23
-
24
- # 挨拶メッセージを返す
25
- def say_hello
26
- "Hello, World! 🌍\n\nこのコマンドはRubyで実装されています。"
27
- end
28
- end
29
- end
30
- end
@@ -1,32 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Rufio
4
- module Plugins
5
- # Hello コマンドを提供するプラグイン
6
- # Rubyコードで挨拶を返す簡単な例
7
- class Stop < Plugin
8
- def name
9
- 'Stop'
10
- end
11
-
12
- def description
13
- 'Rubyで実装された挨拶コマンドの例'
14
- end
15
-
16
- def commands
17
- {
18
- stop: method(:say_hello)
19
- }
20
- end
21
-
22
- private
23
-
24
- # 挨拶メッセージを返す
25
- def say_hello
26
- 'stop 5seconds'
27
- sleep 5
28
- 'done'
29
- end
30
- end
31
- end
32
- end