rufio 0.40.1 → 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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7961605c57b1bb4e31ac73107f636984fe654a9d7a2114b91776c2faf94493be
4
- data.tar.gz: fb3ed53e99f7697c33d53ee6bffa42f3744442c7171dc914127e860fab310987
3
+ metadata.gz: d3c498939bce28d320a22b6c702a489a2104735703ba4510ad6e81457451f9b5
4
+ data.tar.gz: 16b83c1e9046f78ffe672f4cf7dcfcbfc9a1e4bcde1d2928dcfaab48e9f33cfe
5
5
  SHA512:
6
- metadata.gz: 6e50fb55d6ad7bceebe4d4df16c5afd0a398e8bfdd90957ed0dfc57db7eaa93210346ace773550ab9ad04aef496caa902229c4ccf917c26bf058d65637ec6a16
7
- data.tar.gz: 29b9d79d0cd35cb897eb61d115aac5ad817cbdba003a80d9c5d21ad4370280be72bc8f228a5ab56bd25148649e5ba9ba13c245a669722161c639eb1dd96575d4
6
+ metadata.gz: 1a50608548e316135b5de39fa2b974cdf95682c80656153a96bf450d65c833967bdea84f3597eee7c1bb049f2daf4791ed60ab926400f7a54dbfaafd14753ae4
7
+ data.tar.gz: b4bb9b1e61ec2594a039e43c17e1d4d3d90f91ef382161ac7cb2df75e7b37f301e1312e4b6456af6c91941553a11119db11b0d1d415d42142785c13166bf13c0
data/CHANGELOG.md CHANGED
@@ -7,6 +7,31 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.41.0] - 2026-01-13
11
+
12
+ ### Changed
13
+ - **⚡ FPS Optimization**: Changed target frame rate from 60 FPS to 30 FPS (33.33ms/frame)
14
+ - Reduced CPU usage while maintaining smooth UI responsiveness
15
+ - More efficient for terminal-based applications
16
+ - Consistent frame pacing with `min_sleep_interval = 0.0333`
17
+
18
+ ### Fixed
19
+ - **🐛 Exit Confirmation Bug**: Fixed confirmation dialog not preventing exit when selecting "No"
20
+ - `terminal_ui.rb`: Now checks `exit_request` return value before setting `@running = false`
21
+ - Selecting "No" or pressing ESC properly cancels the exit operation
22
+ - Fixed in both `handle_input_nonblocking` and `handle_input` methods
23
+
24
+ - **📊 FPS Display Bug**: Fixed FPS counter showing incorrect 1 FPS value
25
+ - FPS calculation now updates every frame instead of every second
26
+ - `frame_time` and `last_frame_time` updated on each loop iteration
27
+ - Display update throttled to once per second to prevent flicker
28
+
29
+ ### Added
30
+ - **🎮 Experimental Async UI**: Initial implementation of asynchronous UI rendering
31
+ - Non-blocking input processing with IO.select (1ms timeout)
32
+ - Frame-based rendering with differential updates
33
+ - FPS counter display with `--test` flag for performance monitoring
34
+
10
35
  ## [0.40.0] - 2026-01-11
11
36
 
12
37
  ### Added
data/README.md CHANGED
@@ -6,7 +6,7 @@ Ruby製のターミナルベースファイルマネージャー
6
6
 
7
7
  ## 概要
8
8
 
9
- rufioは、Yaziにインスパイアされたターミナル上で動作するファイルマネージャーです。Rubyで実装されており、プラグインサポートを備えています。軽量で高速な操作性を提供し、ファイルの閲覧・管理・検索機能を備えています。
9
+ rufioは、Yaziにインスパイアされたターミナル上で動作するファイルマネージャーです。Rubyで実装されており、DSLコマンドによる拡張機能を備えています。軽量で高速な操作性を提供し、ファイルの閲覧・管理・検索機能を備えています。
10
10
 
11
11
  ### 🚀 v0.33.0の重要な更新
12
12
 
@@ -20,12 +20,12 @@ rufioは、Yaziにインスパイアされたターミナル上で動作する
20
20
 
21
21
  - **軽量でシンプル**: Rubyで書かれた軽量なファイルマネージャー
22
22
  - **直感的な操作**: Vimライクなキーバインド
23
- - **プラグインシステム**: 拡張可能なプラグインアーキテクチャ
23
+ - **DSLコマンドシステム** (v0.50.0): 拡張可能なDSLベースのコマンド定義
24
24
  - **強力なコマンドモード** (v0.32.0):
25
25
  - シェルコマンド実行 (`!ls`, `!git status` など)
26
26
  - コマンド履歴(上下矢印キーでナビゲーション)
27
27
  - インテリジェントなTab補完(候補リスト表示)
28
- - Rubyプラグインによる拡張可能なコマンド
28
+ - DSLコマンドによる拡張可能なコマンド
29
29
  - **バックグラウンドコマンド実行** (v0.33.0):
30
30
  - `:!command` でシェルコマンドを非同期実行
31
31
  - 実行中もrufioの操作が可能
@@ -249,9 +249,10 @@ rufio --help # ヘルプメッセージを表示
249
249
  - 完了時に通知メッセージを3秒間表示
250
250
  - 実行結果は自動的に `~/.config/rufio/log/` に保存
251
251
 
252
- **Rubyコマンド** (v0.32.0):
252
+ **DSLコマンド** (v0.50.0):
253
253
  ```
254
- :hello # Hello プラグインを実行
254
+ :hello # Hello DSLコマンドを実行
255
+ :stop # rufioを終了
255
256
  ```
256
257
 
257
258
  #### ログビューワ (v0.33.0)
@@ -507,7 +508,7 @@ apt install zoxide
507
508
 
508
509
  #### 利用可能なコマンド
509
510
 
510
- コマンドはプラグインによって提供されます。プラグインシステムの詳細については後述の「プラグインシステム」セクションを参照してください。
511
+ コマンドはDSLで定義されます。DSLコマンドシステムの詳細については後述の「DSLコマンドシステム」セクションを参照してください。
511
512
 
512
513
  ### 必要な外部ツール
513
514
 
@@ -589,188 +590,93 @@ COLORS = {
589
590
  - `selected`: 選択中の項目の色
590
591
  - `preview`: プレビューパネルの色
591
592
 
592
- ## プラグインシステム
593
+ ## DSLコマンドシステム
593
594
 
594
- rufioは拡張可能なプラグインシステムを備えており、独自の機能を簡単に追加できます。
595
+ rufioはDSLベースのコマンドシステムを備えており、独自のコマンドを簡単に追加できます。
595
596
 
596
- ### プラグインの配置場所
597
+ ### コマンド定義ファイル
597
598
 
598
- #### 1. 本体同梱プラグイン
599
- ```
600
- lib/rufio/plugins/*.rb
601
- ```
602
- rufioに標準で含まれるプラグイン。外部gem依存なしの基本機能を提供。
599
+ ユーザー定義コマンドは以下のファイルに記述します:
603
600
 
604
- #### 2. ユーザープラグイン
605
601
  ```
606
- ~/.rufio/plugins/*.rb
602
+ ~/.config/rufio/commands.rb
607
603
  ```
608
- ユーザーが自由に追加できるプラグイン。GitHub GistやrawURLから取得可能。
609
604
 
610
- ### プラグインの作成方法
605
+ ### コマンドの作成方法
611
606
 
612
- #### シンプルなプラグイン例
607
+ #### Rubyコードを実行するコマンド
613
608
 
614
609
  ```ruby
615
- # ~/.rufio/plugins/hello.rb
616
- module Rufio
617
- module Plugins
618
- class Hello < Plugin
619
- def name
620
- 'Hello'
621
- end
622
-
623
- def description
624
- 'シンプルな挨拶プラグイン'
625
- end
626
-
627
- def commands
628
- {
629
- hello: method(:say_hello)
630
- }
631
- end
632
-
633
- private
634
-
635
- def say_hello
636
- "Hello from rufio!"
637
- end
638
- end
639
- end
610
+ # ~/.config/rufio/commands.rb
611
+ command "hello" do
612
+ ruby { "Hello from rufio!" }
613
+ description "挨拶コマンド"
640
614
  end
641
- ```
642
-
643
- **プラグインの使い方:**
644
-
645
- 1. rufioを起動
646
- 2. `:`キーでコマンドモードを起動
647
- 3. `hello`と入力(または`he`と入力してTabキーで補完)
648
- 4. Enterキーで実行
649
- 5. フローティングウィンドウに"Hello from rufio!"が表示される
650
615
 
651
- #### 外部gemに依存するプラグイン例
652
-
653
- ```ruby
654
- # ~/.rufio/plugins/ai_helper.rb
655
- module Rufio
656
- module Plugins
657
- class AiHelper < Plugin
658
- requires 'anthropic' # 依存gem宣言
659
-
660
- def name
661
- 'AiHelper'
662
- end
663
-
664
- def description
665
- 'Claude APIを使ったAIアシスタント'
666
- end
667
-
668
- def commands
669
- {
670
- ai: method(:ask_ai)
671
- }
672
- end
673
-
674
- def initialize
675
- super # 依存チェック実行
676
- @client = Anthropic::Client.new(
677
- api_key: ENV['ANTHROPIC_API_KEY']
678
- )
679
- end
680
-
681
- private
682
-
683
- def ask_ai
684
- response = @client.messages.create(
685
- model: "claude-3-5-sonnet-20241022",
686
- max_tokens: 1024,
687
- messages: [{role: "user", content: "Hello, Claude!"}]
688
- )
689
- response.content.first.text
690
- end
691
- end
692
- end
616
+ command "time" do
617
+ ruby { Time.now.strftime("%Y-%m-%d %H:%M:%S") }
618
+ description "現在時刻を表示"
693
619
  end
694
620
  ```
695
621
 
696
- **プラグインの使い方:**
697
-
698
- 1. 依存gemをインストール: `gem install anthropic`
699
- 2. 環境変数を設定: `export ANTHROPIC_API_KEY=your_api_key`
700
- 3. rufioを起動
701
- 4. `:`キーでコマンドモードを起動
702
- 5. `ai`と入力してEnterキーで実行
703
- 6. フローティングウィンドウにClaude APIからの応答が表示される
704
-
705
- ### プラグインの管理
622
+ #### シェルコマンドを実行するコマンド
706
623
 
707
- #### プラグインの有効/無効設定
708
-
709
- `~/.rufio/config.yml`でプラグインの有効/無効を制御できます:
624
+ ```ruby
625
+ command "status" do
626
+ shell "git status"
627
+ description "Gitステータスを表示"
628
+ end
710
629
 
711
- ```yaml
712
- plugins:
713
- fileoperations:
714
- enabled: true
715
- ai_helper:
716
- enabled: true
717
- my_custom:
718
- enabled: false
630
+ command "disk" do
631
+ shell "df -h"
632
+ description "ディスク使用量を表示"
633
+ end
719
634
  ```
720
635
 
721
- #### デフォルト動作
722
-
723
- - `config.yml`が存在しない → 全プラグイン有効
724
- - プラグインの設定がない → 有効とみなす
725
- - `enabled: false`が明示的に設定されている → 無効
726
-
727
- ### プラグインの配布方法
728
-
729
- #### GitHub Gistで共有
636
+ #### 外部スクリプトを実行するコマンド
730
637
 
731
- ```bash
732
- # プラグイン作者
733
- 1. GitHub Gistに.rbファイルをアップロード
734
- 2. Raw URLをユーザーに共有
735
-
736
- # ユーザー
737
- $ mkdir -p ~/.rufio/plugins
738
- $ curl -o ~/.rufio/plugins/my_plugin.rb [RAW_URL]
739
- $ rufio
740
- ✓ my_plugin 読み込み完了
638
+ ```ruby
639
+ command "build" do
640
+ script "~/.config/rufio/scripts/build.rb"
641
+ description "プロジェクトをビルド"
642
+ end
741
643
  ```
742
644
 
743
- #### GitHubリポジトリで共有
645
+ ### コマンドの使い方
744
646
 
745
- ```bash
746
- # プラグイン作者
747
- rufio-plugins/
748
- ├── plugin1.rb
749
- └── plugin2.rb
750
-
751
- # ユーザー
752
- $ curl -o ~/.rufio/plugins/plugin1.rb https://raw.githubusercontent.com/user/rufio-plugins/main/plugin1.rb
753
- ```
647
+ 1. rufioを起動
648
+ 2. `:`キーでコマンドモードを起動
649
+ 3. コマンド名を入力(または一部を入力してTabキーで補完)
650
+ 4. Enterキーで実行
651
+ 5. フローティングウィンドウに結果が表示される
754
652
 
755
- ### プラグインの主要機能
653
+ ### 組み込みコマンド
756
654
 
757
- #### 必須メソッド
655
+ rufioには以下のコマンドがデフォルトで組み込まれています:
758
656
 
759
- - `name`: プラグイン名(必須)
760
- - `description`: プラグインの説明(オプション、デフォルト: "")
761
- - `version`: プラグインのバージョン(オプション、デフォルト: "1.0.0")
762
- - `commands`: コマンド定義(オプション、デフォルト: {})
657
+ | コマンド | 説明 |
658
+ | -------- | ---- |
659
+ | `hello` | 挨拶メッセージを表示 |
660
+ | `stop` | rufioを終了 |
661
+ | `touch` | ファイルを作成 |
662
+ | `mkdir` | ディレクトリを作成 |
763
663
 
764
- #### 依存gem管理
664
+ ### DSLコマンドの種類
765
665
 
766
- - `requires 'gem_name'`: 依存gemを宣言
767
- - 依存gemが不足している場合、警告を表示してプラグインを無効化
768
- - rufio本体は正常に起動継続
666
+ 1. **ruby**: Rubyコードをインラインで実行
667
+ 2. **shell**: シェルコマンドを実行
668
+ 3. **script**: 外部スクリプトファイルを実行
769
669
 
770
- #### 自動登録機能
670
+ ### 設定ファイル構成
771
671
 
772
- - `Plugin`クラスを継承すると自動的に`PluginManager`に登録
773
- - 複雑な登録処理は不要
672
+ ```
673
+ ~/.config/rufio/
674
+ ├── config.rb # カラー設定
675
+ ├── commands.rb # DSLコマンド定義
676
+ ├── bookmarks.json # ブックマーク
677
+ ├── scripts/ # スクリプトファイル
678
+ └── log/ # 実行ログ
679
+ ```
774
680
 
775
681
  ## 開発
776
682
 
data/bin/rufio CHANGED
@@ -3,19 +3,22 @@
3
3
 
4
4
  require_relative '../lib/rufio'
5
5
 
6
- # プラグインを読み込む
7
- Rufio::PluginManager.load_all
8
-
9
6
  # YJITを早期に有効化(引数をチェック)
10
7
  if ARGV.include?('--yjit') && defined?(RubyVM::YJIT)
11
8
  RubyVM::YJIT.enable
12
9
  end
13
10
 
11
+ # ZJITを早期に有効化(引数をチェック)
12
+ if ARGV.include?('--zjit') && defined?(RubyVM::ZJIT)
13
+ RubyVM::ZJIT.enable
14
+ end
15
+
14
16
  # コマンドライン引数のパース
15
17
  native_mode = nil
16
18
  start_directory = nil
17
19
  test_mode = false
18
20
  yjit_mode = false
21
+ zjit_mode = false
19
22
  skip_next = false
20
23
 
21
24
  ARGV.each_with_index do |arg, idx|
@@ -29,6 +32,8 @@ ARGV.each_with_index do |arg, idx|
29
32
  test_mode = true
30
33
  when '--yjit'
31
34
  yjit_mode = true
35
+ when '--zjit'
36
+ zjit_mode = true
32
37
  when '--native'
33
38
  # 次の引数がモード指定かチェック
34
39
  if idx + 1 < ARGV.length && !ARGV[idx + 1].start_with?('--') && !ARGV[idx + 1].start_with?('/')
@@ -44,7 +49,7 @@ ARGV.each_with_index do |arg, idx|
44
49
  end
45
50
  when /^--native=(rust|go|auto|ruby)$/
46
51
  native_mode = $1
47
- when '-c', '--check-health', '--help', '-h', '--yjit'
52
+ when '-c', '--check-health', '--help', '-h', '--yjit', '--zjit'
48
53
  # これらは後で処理
49
54
  when /^--/
50
55
  # 未知のオプションは無視
@@ -81,6 +86,7 @@ elsif ARGV.include?('--help') || ARGV.include?('-h')
81
86
  puts " -h, --help Show this help message"
82
87
  puts " --test Show FPS counter in footer (for performance testing)"
83
88
  puts " --yjit Enable YJIT JIT compiler (Ruby 3.1+)"
89
+ puts " --zjit Enable ZJIT JIT compiler (Ruby 3.4+)"
84
90
  if defined?(Rufio::NativeScanner)
85
91
  puts " --native[=MODE] Enable native scanner (experimental)"
86
92
  puts " MODE: auto|rust|go (default: auto)"
@@ -103,6 +109,7 @@ elsif ARGV.include?('--help') || ARGV.include?('-h')
103
109
  puts " rufio /path/to/dir # Start in specific directory"
104
110
  puts " rufio --test # Show FPS counter for performance testing"
105
111
  puts " rufio --yjit # Enable YJIT for better performance"
112
+ puts " rufio --zjit # Enable ZJIT for better performance"
106
113
  if defined?(Rufio::NativeScanner)
107
114
  puts " rufio --native # Use native scanner (auto-detect)"
108
115
  puts " rufio --native=rust # Use Rust scanner"