beniya 0.9.0 → 0.9.1
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/README.md +2 -0
- data/README_EN.md +2 -0
- data/beniya.gemspec +17 -1
- data/lib/beniya/deprecation_notice.rb +105 -0
- data/lib/beniya/terminal_ui.rb +45 -0
- data/lib/beniya/version.rb +1 -1
- data/lib/beniya.rb +1 -0
- data/test_notice.rb +57 -0
- metadata +20 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3ed952c2b36c035a5a7ae8aa48a0dd9660474662f4ae4e3dc655e77b328b92ba
|
|
4
|
+
data.tar.gz: 4a5c3a7574b283a46cc5a91cde33ef1638d9be8c92d6a44b9dddf907a3c0bbd4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3bc682b199597c239ba1a71ab9254f271232ac74a5d4f07eb6ba4ba53b505ca714bfc5efb5e7f9ab9e058527f5c5f724e4c30b4357a1ca057b200227bac30262
|
|
7
|
+
data.tar.gz: 4b6804dc73b11b8c31ceee249c587d2c2f2306e720d16629b0456a0594f4960e3dda87414df325fb714b32daf3b23e92eb6335e1e127b30b4d4c46a9fffc57cb
|
data/README.md
CHANGED
data/README_EN.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# beniya
|
|
2
2
|
|
|
3
|
+
> **Notice**: This project has been migrated to [rufio](https://github.com/masisz/rufio). Future development and maintenance will be done in rufio. beniya is now in maintenance mode and no new features will be added.
|
|
4
|
+
|
|
3
5
|
A terminal-based file manager written in Ruby
|
|
4
6
|
|
|
5
7
|
[日本語版](./README.md) | **English**
|
data/beniya.gemspec
CHANGED
|
@@ -9,7 +9,7 @@ Gem::Specification.new do |spec|
|
|
|
9
9
|
spec.email = ['masisz.1567@gmail.com']
|
|
10
10
|
|
|
11
11
|
spec.summary = 'Ruby file manager'
|
|
12
|
-
spec.description = 'A terminal-based file manager inspired by Yazi, written in Ruby with plugin support'
|
|
12
|
+
spec.description = '[DEPRECATED] This project has been migrated to rufio (https://github.com/masisz/rufio). A terminal-based file manager inspired by Yazi, written in Ruby with plugin support'
|
|
13
13
|
spec.homepage = 'https://github.com/masisz/beniya'
|
|
14
14
|
spec.license = 'MIT'
|
|
15
15
|
spec.required_ruby_version = '>= 2.7.0'
|
|
@@ -19,6 +19,22 @@ Gem::Specification.new do |spec|
|
|
|
19
19
|
spec.metadata['source_code_uri'] = 'https://github.com/masisz/beniya'
|
|
20
20
|
spec.metadata['changelog_uri'] = 'https://github.com/masisz/beniya/blob/main/CHANGELOG.md'
|
|
21
21
|
|
|
22
|
+
spec.post_install_message = <<~MSG
|
|
23
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
24
|
+
│ │
|
|
25
|
+
│ ⚠️ DEPRECATED: beniya has been migrated to rufio │
|
|
26
|
+
│ │
|
|
27
|
+
│ This project is now in maintenance mode. │
|
|
28
|
+
│ Please use rufio for new features and active development. │
|
|
29
|
+
│ │
|
|
30
|
+
│ Install rufio: │
|
|
31
|
+
│ gem install rufio │
|
|
32
|
+
│ │
|
|
33
|
+
│ More info: https://github.com/masisz/rufio │
|
|
34
|
+
│ │
|
|
35
|
+
└─────────────────────────────────────────────────────────────┘
|
|
36
|
+
MSG
|
|
37
|
+
|
|
22
38
|
spec.files = Dir.chdir(__dir__) do
|
|
23
39
|
`git ls-files -z`.split("\x0").reject do |f|
|
|
24
40
|
(File.expand_path(f) == __FILE__) ||
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'fileutils'
|
|
4
|
+
|
|
5
|
+
module Beniya
|
|
6
|
+
# Manages the deprecation notice for the transition from beniya to rufio
|
|
7
|
+
class DeprecationNotice
|
|
8
|
+
NOTICE_FILE = File.join(Dir.home, '.beniya', '.deprecation_notice_shown')
|
|
9
|
+
|
|
10
|
+
def initialize
|
|
11
|
+
ensure_config_directory
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
# Check if the notice should be shown
|
|
15
|
+
# @return [Boolean] true if the notice should be shown
|
|
16
|
+
def should_show?
|
|
17
|
+
!File.exist?(NOTICE_FILE)
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
# Mark the notice as shown
|
|
21
|
+
def mark_as_shown
|
|
22
|
+
FileUtils.touch(NOTICE_FILE)
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
# Get the notice title
|
|
26
|
+
# @return [String] The notice title
|
|
27
|
+
def title
|
|
28
|
+
ConfigLoader.message('deprecation.title')
|
|
29
|
+
rescue StandardError
|
|
30
|
+
'重要なお知らせ / Important Notice'
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# Get the notice content lines
|
|
34
|
+
# @return [Array<String>] The notice content lines
|
|
35
|
+
def content
|
|
36
|
+
if ConfigLoader.language == 'ja'
|
|
37
|
+
japanese_content
|
|
38
|
+
else
|
|
39
|
+
english_content
|
|
40
|
+
end
|
|
41
|
+
rescue StandardError
|
|
42
|
+
# Fallback content if ConfigLoader fails
|
|
43
|
+
fallback_content
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
private
|
|
47
|
+
|
|
48
|
+
def ensure_config_directory
|
|
49
|
+
config_dir = File.join(Dir.home, '.beniya')
|
|
50
|
+
FileUtils.mkdir_p(config_dir) unless Dir.exist?(config_dir)
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
def japanese_content
|
|
54
|
+
[
|
|
55
|
+
'',
|
|
56
|
+
'beniyaはrufioに改名されました。',
|
|
57
|
+
'',
|
|
58
|
+
'今後の開発とサポートはrufioで継続されます。',
|
|
59
|
+
'beniyaは非推奨となり、将来的に削除される予定です。',
|
|
60
|
+
'',
|
|
61
|
+
'移行方法:',
|
|
62
|
+
' 1. gem uninstall beniya',
|
|
63
|
+
' 2. gem install rufio',
|
|
64
|
+
'',
|
|
65
|
+
'詳細: https://github.com/masisz/rufio',
|
|
66
|
+
'',
|
|
67
|
+
'任意のキーを押して続行...',
|
|
68
|
+
''
|
|
69
|
+
]
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
def english_content
|
|
73
|
+
[
|
|
74
|
+
'',
|
|
75
|
+
'beniya has been renamed to rufio.',
|
|
76
|
+
'',
|
|
77
|
+
'Future development and support will continue as rufio.',
|
|
78
|
+
'beniya is now deprecated and will be removed in the future.',
|
|
79
|
+
'',
|
|
80
|
+
'Migration steps:',
|
|
81
|
+
' 1. gem uninstall beniya',
|
|
82
|
+
' 2. gem install rufio',
|
|
83
|
+
'',
|
|
84
|
+
'More info: https://github.com/masisz/rufio',
|
|
85
|
+
'',
|
|
86
|
+
'Press any key to continue...',
|
|
87
|
+
''
|
|
88
|
+
]
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
def fallback_content
|
|
92
|
+
[
|
|
93
|
+
'',
|
|
94
|
+
'beniya has been renamed to rufio.',
|
|
95
|
+
'beniyaはrufioに改名されました。',
|
|
96
|
+
'',
|
|
97
|
+
'Please install rufio instead:',
|
|
98
|
+
' gem install rufio',
|
|
99
|
+
'',
|
|
100
|
+
'Press any key to continue...',
|
|
101
|
+
''
|
|
102
|
+
]
|
|
103
|
+
end
|
|
104
|
+
end
|
|
105
|
+
end
|
data/lib/beniya/terminal_ui.rb
CHANGED
|
@@ -60,6 +60,9 @@ module Beniya
|
|
|
60
60
|
@running = true
|
|
61
61
|
setup_terminal
|
|
62
62
|
|
|
63
|
+
# Show deprecation notice if needed
|
|
64
|
+
show_deprecation_notice_if_needed
|
|
65
|
+
|
|
63
66
|
begin
|
|
64
67
|
main_loop
|
|
65
68
|
ensure
|
|
@@ -625,6 +628,48 @@ module Beniya
|
|
|
625
628
|
# 画面を再描画
|
|
626
629
|
draw_screen
|
|
627
630
|
end
|
|
631
|
+
|
|
632
|
+
# Show deprecation notice if it hasn't been shown yet
|
|
633
|
+
def show_deprecation_notice_if_needed
|
|
634
|
+
notice = DeprecationNotice.new
|
|
635
|
+
return unless notice.should_show?
|
|
636
|
+
|
|
637
|
+
# Calculate window dimensions
|
|
638
|
+
width = [@screen_width - 10, 70].min
|
|
639
|
+
height = 18
|
|
640
|
+
x = (@screen_width - width) / 2
|
|
641
|
+
y = (@screen_height - height) / 2
|
|
642
|
+
|
|
643
|
+
# Display the notice window
|
|
644
|
+
@dialog_renderer.draw_floating_window(
|
|
645
|
+
x, y, width, height,
|
|
646
|
+
notice.title,
|
|
647
|
+
notice.content,
|
|
648
|
+
{
|
|
649
|
+
border_color: "\e[33m", # Yellow
|
|
650
|
+
title_color: "\e[1;33m", # Bold yellow
|
|
651
|
+
content_color: "\e[37m" # White
|
|
652
|
+
}
|
|
653
|
+
)
|
|
654
|
+
|
|
655
|
+
# Force flush to ensure display
|
|
656
|
+
$stdout.flush
|
|
657
|
+
|
|
658
|
+
# Wait for any key press (using IO.console for better compatibility)
|
|
659
|
+
require 'io/console'
|
|
660
|
+
IO.console.getch
|
|
661
|
+
|
|
662
|
+
# Mark as shown
|
|
663
|
+
notice.mark_as_shown
|
|
664
|
+
|
|
665
|
+
# Clear screen for main display
|
|
666
|
+
print "\e[2J\e[H"
|
|
667
|
+
rescue StandardError => e
|
|
668
|
+
# If notice display fails, mark it as shown to avoid repeated errors
|
|
669
|
+
notice.mark_as_shown if notice
|
|
670
|
+
# Log error to stderr for debugging
|
|
671
|
+
$stderr.puts "Warning: Failed to display deprecation notice: #{e.message}"
|
|
672
|
+
end
|
|
628
673
|
end
|
|
629
674
|
end
|
|
630
675
|
|
data/lib/beniya/version.rb
CHANGED
data/lib/beniya.rb
CHANGED
|
@@ -20,6 +20,7 @@ require_relative "beniya/terminal_ui"
|
|
|
20
20
|
require_relative "beniya/application"
|
|
21
21
|
require_relative "beniya/file_opener"
|
|
22
22
|
require_relative "beniya/health_checker"
|
|
23
|
+
require_relative "beniya/deprecation_notice"
|
|
23
24
|
|
|
24
25
|
# プラグインシステム
|
|
25
26
|
require_relative "beniya/plugin_config"
|
data/test_notice.rb
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
require_relative 'lib/beniya'
|
|
5
|
+
|
|
6
|
+
puts "Testing deprecation notice..."
|
|
7
|
+
puts "Checking if notice should show: #{Beniya::DeprecationNotice.new.should_show?}"
|
|
8
|
+
|
|
9
|
+
# Simulate terminal UI setup
|
|
10
|
+
system('tput smcup') # alternate screen
|
|
11
|
+
system('tput civis') # cursor invisible
|
|
12
|
+
print "\e[2J\e[H" # clear screen
|
|
13
|
+
|
|
14
|
+
begin
|
|
15
|
+
notice = Beniya::DeprecationNotice.new
|
|
16
|
+
|
|
17
|
+
if notice.should_show?
|
|
18
|
+
puts "Notice should be shown, displaying..."
|
|
19
|
+
|
|
20
|
+
# Get screen size
|
|
21
|
+
require 'io/console'
|
|
22
|
+
screen_width, screen_height = IO.console.winsize.reverse
|
|
23
|
+
|
|
24
|
+
# Calculate window dimensions
|
|
25
|
+
width = [screen_width - 10, 70].min
|
|
26
|
+
height = 18
|
|
27
|
+
x = (screen_width - width) / 2
|
|
28
|
+
y = (screen_height - height) / 2
|
|
29
|
+
|
|
30
|
+
dialog_renderer = Beniya::DialogRenderer.new
|
|
31
|
+
|
|
32
|
+
# Display the notice window
|
|
33
|
+
dialog_renderer.draw_floating_window(
|
|
34
|
+
x, y, width, height,
|
|
35
|
+
notice.title,
|
|
36
|
+
notice.content,
|
|
37
|
+
{
|
|
38
|
+
border_color: "\e[33m", # Yellow
|
|
39
|
+
title_color: "\e[1;33m", # Bold yellow
|
|
40
|
+
content_color: "\e[37m" # White
|
|
41
|
+
}
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
# Wait for any key press
|
|
45
|
+
puts "\n\n[DEBUG] Waiting for key press..."
|
|
46
|
+
$stdin.getch
|
|
47
|
+
|
|
48
|
+
# Mark as shown
|
|
49
|
+
notice.mark_as_shown
|
|
50
|
+
puts "\n[DEBUG] Notice marked as shown"
|
|
51
|
+
else
|
|
52
|
+
puts "Notice already shown, skipping"
|
|
53
|
+
end
|
|
54
|
+
ensure
|
|
55
|
+
system('tput rmcup') # normal screen
|
|
56
|
+
system('tput cnorm') # cursor normal
|
|
57
|
+
end
|
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.9.
|
|
4
|
+
version: 0.9.1
|
|
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-20 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
13
|
name: io-console
|
|
@@ -107,8 +107,8 @@ dependencies:
|
|
|
107
107
|
- - "~>"
|
|
108
108
|
- !ruby/object:Gem::Version
|
|
109
109
|
version: '1.21'
|
|
110
|
-
description:
|
|
111
|
-
plugin support
|
|
110
|
+
description: "[DEPRECATED] This project has been migrated to rufio (https://github.com/masisz/rufio).
|
|
111
|
+
A terminal-based file manager inspired by Yazi, written in Ruby with plugin support"
|
|
112
112
|
email:
|
|
113
113
|
- masisz.1567@gmail.com
|
|
114
114
|
executables:
|
|
@@ -140,6 +140,7 @@ files:
|
|
|
140
140
|
- lib/beniya/command_mode_ui.rb
|
|
141
141
|
- lib/beniya/config.rb
|
|
142
142
|
- lib/beniya/config_loader.rb
|
|
143
|
+
- lib/beniya/deprecation_notice.rb
|
|
143
144
|
- lib/beniya/dialog_renderer.rb
|
|
144
145
|
- lib/beniya/directory_listing.rb
|
|
145
146
|
- lib/beniya/file_opener.rb
|
|
@@ -161,6 +162,7 @@ files:
|
|
|
161
162
|
- publish_gem.zsh
|
|
162
163
|
- test_delete/test1.txt
|
|
163
164
|
- test_delete/test2.txt
|
|
165
|
+
- test_notice.rb
|
|
164
166
|
homepage: https://github.com/masisz/beniya
|
|
165
167
|
licenses:
|
|
166
168
|
- MIT
|
|
@@ -169,6 +171,20 @@ metadata:
|
|
|
169
171
|
homepage_uri: https://github.com/masisz/beniya
|
|
170
172
|
source_code_uri: https://github.com/masisz/beniya
|
|
171
173
|
changelog_uri: https://github.com/masisz/beniya/blob/main/CHANGELOG.md
|
|
174
|
+
post_install_message: |
|
|
175
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
176
|
+
│ │
|
|
177
|
+
│ ⚠️ DEPRECATED: beniya has been migrated to rufio │
|
|
178
|
+
│ │
|
|
179
|
+
│ This project is now in maintenance mode. │
|
|
180
|
+
│ Please use rufio for new features and active development. │
|
|
181
|
+
│ │
|
|
182
|
+
│ Install rufio: │
|
|
183
|
+
│ gem install rufio │
|
|
184
|
+
│ │
|
|
185
|
+
│ More info: https://github.com/masisz/rufio │
|
|
186
|
+
│ │
|
|
187
|
+
└─────────────────────────────────────────────────────────────┘
|
|
172
188
|
rdoc_options: []
|
|
173
189
|
require_paths:
|
|
174
190
|
- lib
|