hyperlist 1.1.7 → 1.2.2

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.
@@ -1,112 +0,0 @@
1
- # Debugging HyperList Issues
2
-
3
- ## For the user experiencing startup crashes:
4
-
5
- ### 1. First, verify you have the latest versions:
6
-
7
- ```bash
8
- gem list hyperlist
9
- # Should show: hyperlist (1.1.3)
10
-
11
- gem list rcurses
12
- # Should show: rcurses (5.1.4) or higher
13
- ```
14
-
15
- ### 2. If not, update to the latest:
16
-
17
- ```bash
18
- gem update hyperlist
19
- gem update rcurses
20
- ```
21
-
22
- ### 3. Run with debug mode to see errors:
23
-
24
- ```bash
25
- # Set debug environment variable
26
- export RCURSES_DEBUG=1
27
- export DEBUG=1
28
-
29
- # Then run hyperlist
30
- hyperlist
31
-
32
- # Or run in one line:
33
- DEBUG=1 RCURSES_DEBUG=1 hyperlist
34
- ```
35
-
36
- ### 4. Alternative: Run with Ruby directly to see errors:
37
-
38
- ```bash
39
- # Find where hyperlist is installed
40
- which hyperlist
41
-
42
- # Run it directly with Ruby to see any errors
43
- ruby $(which hyperlist)
44
- ```
45
-
46
- ### 5. Check Ruby version compatibility:
47
-
48
- ```bash
49
- ruby --version
50
- # HyperList requires Ruby 3.0.0 or higher
51
- ```
52
-
53
- ### 6. Try running with verbose Ruby output:
54
-
55
- ```bash
56
- ruby -w $(which hyperlist)
57
- ```
58
-
59
- ### 7. Check for missing dependencies:
60
-
61
- ```bash
62
- # This will show if rcurses is properly installed
63
- ruby -e "require 'rcurses'; puts 'rcurses loaded successfully'"
64
- ```
65
-
66
- ### 8. Create a simple test file to isolate the issue:
67
-
68
- Create a file called `test_hyperlist.rb`:
69
-
70
- ```ruby
71
- #!/usr/bin/env ruby
72
-
73
- puts "Ruby version: #{RUBY_VERSION}"
74
- puts "Testing rcurses..."
75
-
76
- begin
77
- require 'rcurses'
78
- puts "✓ rcurses loaded successfully (version from gem)"
79
- rescue LoadError => e
80
- puts "✗ Failed to load rcurses: #{e.message}"
81
- exit 1
82
- end
83
-
84
- puts "\nTesting basic rcurses functionality..."
85
- begin
86
- include Rcurses
87
- puts "✓ Rcurses module included"
88
- puts "✓ All basic checks passed!"
89
- rescue => e
90
- puts "✗ Error: #{e.message}"
91
- exit 1
92
- end
93
- ```
94
-
95
- Run it with:
96
- ```bash
97
- ruby test_hyperlist.rb
98
- ```
99
-
100
- ### 9. If all else fails, capture output:
101
-
102
- ```bash
103
- # Run with script to capture all output
104
- script -c "hyperlist" hyperlist_output.txt
105
-
106
- # Then send us the hyperlist_output.txt file
107
- ```
108
-
109
- ## Notes:
110
- - GDB won't work with Ruby scripts (it's for compiled binaries)
111
- - The new error handling in rcurses 5.1.4+ should show errors after terminal cleanup
112
- - Setting DEBUG=1 or RCURSES_DEBUG=1 will show full stack traces
data/diagnose.rb DELETED
@@ -1,115 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # HyperList Diagnostic Script
3
- # Run this to help diagnose installation/startup issues
4
-
5
- puts "=" * 60
6
- puts "HyperList Diagnostic Report"
7
- puts "=" * 60
8
-
9
- # Check Ruby version
10
- puts "\n1. Ruby Version:"
11
- puts " #{RUBY_VERSION} (#{RUBY_PLATFORM})"
12
- if RUBY_VERSION < "3.0.0"
13
- puts " ⚠️ WARNING: HyperList requires Ruby 3.0.0 or higher"
14
- else
15
- puts " ✓ Ruby version OK"
16
- end
17
-
18
- # Check gem versions
19
- puts "\n2. Gem Versions:"
20
- begin
21
- hyperlist_version = `gem list hyperlist --local`.match(/hyperlist \(([\d.]+)\)/)[1] rescue "not found"
22
- rcurses_version = `gem list rcurses --local`.match(/rcurses \(([\d.]+(?:,\s*[\d.]+)*)\)/)[1] rescue "not found"
23
-
24
- puts " hyperlist: #{hyperlist_version}"
25
- if hyperlist_version >= "1.1.3"
26
- puts " ✓ HyperList version OK"
27
- else
28
- puts " ⚠️ Please update: gem update hyperlist"
29
- end
30
-
31
- puts " rcurses: #{rcurses_version}"
32
- if rcurses_version.include?("5.1.4") || rcurses_version >= "5.1.4"
33
- puts " ✓ rcurses version OK"
34
- else
35
- puts " ⚠️ Please update: gem update rcurses"
36
- end
37
- rescue => e
38
- puts " Error checking gems: #{e.message}"
39
- end
40
-
41
- # Test loading rcurses
42
- puts "\n3. Testing rcurses load:"
43
- begin
44
- require 'rcurses'
45
- puts " ✓ rcurses loaded successfully"
46
-
47
- # Check if we can access rcurses modules
48
- include Rcurses
49
- puts " ✓ Rcurses modules accessible"
50
- rescue LoadError => e
51
- puts " ✗ Failed to load rcurses: #{e.message}"
52
- puts " Try: gem install rcurses"
53
- rescue => e
54
- puts " ✗ Error with rcurses: #{e.message}"
55
- end
56
-
57
- # Test terminal capabilities
58
- puts "\n4. Terminal Check:"
59
- puts " TERM: #{ENV['TERM'] || 'not set'}"
60
- puts " TTY: #{$stdin.tty? ? 'Yes' : 'No'}"
61
- puts " Encoding: #{Encoding.default_external}"
62
-
63
- # Check for HyperList executable
64
- puts "\n5. HyperList Installation:"
65
- hyperlist_path = `which hyperlist`.strip
66
- if hyperlist_path.empty?
67
- puts " ✗ hyperlist command not found in PATH"
68
- puts " Try: gem install hyperlist"
69
- else
70
- puts " ✓ Found at: #{hyperlist_path}"
71
-
72
- # Check if it's executable
73
- if File.executable?(hyperlist_path)
74
- puts " ✓ File is executable"
75
- else
76
- puts " ⚠️ File is not executable"
77
- puts " Try: chmod +x #{hyperlist_path}"
78
- end
79
- end
80
-
81
- # Try to load core dependencies
82
- puts "\n6. Core Dependencies:"
83
- deps = ['io/console', 'date', 'cgi', 'openssl', 'digest', 'base64']
84
- deps.each do |dep|
85
- begin
86
- require dep
87
- puts " ✓ #{dep}"
88
- rescue LoadError => e
89
- puts " ✗ #{dep}: #{e.message}"
90
- end
91
- end
92
-
93
- # Test creating a basic rcurses pane (without initializing terminal)
94
- puts "\n7. Testing Rcurses Pane Creation (simulation):"
95
- begin
96
- # Don't actually initialize the terminal, just test the class exists
97
- if defined?(Rcurses::Pane)
98
- puts " ✓ Rcurses::Pane class exists"
99
- else
100
- puts " ✗ Rcurses::Pane class not found"
101
- end
102
- rescue => e
103
- puts " ✗ Error: #{e.message}"
104
- end
105
-
106
- puts "\n" + "=" * 60
107
- puts "Diagnostic complete!"
108
- puts "=" * 60
109
-
110
- puts "\nIf everything shows ✓ but hyperlist still crashes:"
111
- puts "1. Run with debug mode: DEBUG=1 RCURSES_DEBUG=1 hyperlist"
112
- puts "2. Check for error log: cat ~/.hyperlist_error.log"
113
- puts "3. Try running directly: ruby #{hyperlist_path}"
114
-
115
- puts "\nPlease share this diagnostic output when reporting issues."
data/diagnose_ruby34.rb DELETED
@@ -1,145 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # Diagnostic script for Ruby 3.4.5 compatibility issues
3
-
4
- puts "Ruby Compatibility Diagnostic for HyperList"
5
- puts "=" * 50
6
- puts "Ruby version: #{RUBY_VERSION}"
7
- puts "Ruby platform: #{RUBY_PLATFORM}"
8
- puts
9
-
10
- # Test 1: Basic rcurses functionality
11
- puts "Test 1: Basic rcurses require and init..."
12
- begin
13
- require 'rcurses'
14
- puts " ✓ rcurses loaded successfully"
15
- puts " Rcurses version: #{Rcurses::VERSION}" if defined?(Rcurses::VERSION)
16
- rescue LoadError => e
17
- puts " ✗ Failed to load rcurses: #{e.message}"
18
- exit 1
19
- end
20
-
21
- # Test 2: Rcurses initialization with error capture
22
- puts "\nTest 2: Rcurses initialization..."
23
- begin
24
- # Capture any output during init
25
- original_stdout = $stdout
26
- original_stderr = $stderr
27
-
28
- # Create StringIO to capture output
29
- require 'stringio'
30
- captured_out = StringIO.new
31
- captured_err = StringIO.new
32
-
33
- $stdout = captured_out
34
- $stderr = captured_err
35
-
36
- # Try to initialize
37
- Rcurses.init!
38
-
39
- # Restore output
40
- $stdout = original_stdout
41
- $stderr = original_stderr
42
-
43
- # Check if anything was captured
44
- out_content = captured_out.string
45
- err_content = captured_err.string
46
-
47
- if !out_content.empty?
48
- puts " Captured stdout during init: #{out_content.inspect}"
49
- end
50
- if !err_content.empty?
51
- puts " Captured stderr during init: #{err_content.inspect}"
52
- end
53
-
54
- puts " ✓ Rcurses initialized"
55
-
56
- # Test basic functionality
57
- puts " Testing basic screen operations..."
58
- print "\e[2J\e[H" # Clear screen
59
- print "Test"
60
- sleep 0.1
61
- print "\e[2J\e[H" # Clear again
62
-
63
- puts " ✓ Basic operations work"
64
-
65
- rescue => e
66
- puts " ✗ Failed during initialization: #{e.message}"
67
- puts " Backtrace:"
68
- e.backtrace.first(5).each { |line| puts " #{line}" }
69
- ensure
70
- # Try to restore terminal
71
- begin
72
- Rcurses.done! if defined?(Rcurses.done!)
73
- rescue
74
- # Fallback terminal restore
75
- print "\e[?25h" # Show cursor
76
- system("stty sane 2>/dev/null")
77
- end
78
- end
79
-
80
- # Test 3: Check for method availability issues in Ruby 3.4
81
- puts "\nTest 3: Ruby 3.4 specific checks..."
82
-
83
- # Check IO methods that might have changed
84
- if IO.respond_to?(:console)
85
- puts " ✓ IO.console available"
86
- else
87
- puts " ✗ IO.console not available"
88
- end
89
-
90
- begin
91
- require 'io/console'
92
- $stdin.raw { }
93
- puts " ✓ IO#raw method works"
94
- rescue => e
95
- puts " ✗ IO#raw failed: #{e.message}"
96
- end
97
-
98
- # Test 4: Check encoding
99
- puts "\nTest 4: Encoding checks..."
100
- puts " Default external: #{Encoding.default_external}"
101
- puts " Default internal: #{Encoding.default_internal}"
102
- puts " Console encoding: #{$stdout.external_encoding}" if $stdout.respond_to?(:external_encoding)
103
-
104
- # Test 5: Simple hyperlist initialization test
105
- puts "\nTest 5: HyperList class initialization..."
106
- begin
107
- # Load just the class definition part
108
- hyperlist_code = File.read(File.join(File.dirname(__FILE__), 'hyperlist'))
109
-
110
- # Extract just the class without running main
111
- class_only = hyperlist_code.split(/^if __FILE__ == \$0/)[0]
112
-
113
- # Try to evaluate it
114
- eval(class_only)
115
-
116
- puts " ✓ HyperList class loaded"
117
-
118
- # Try to create instance (without running)
119
- app = HyperListApp.new
120
- puts " ✓ HyperListApp instance created"
121
-
122
- rescue => e
123
- puts " ✗ Failed to load HyperList: #{e.message}"
124
- puts " Error at: #{e.backtrace.first}"
125
- end
126
-
127
- # Test 6: Terminal capability check
128
- puts "\nTest 6: Terminal capabilities..."
129
- puts " TERM: #{ENV['TERM']}"
130
- puts " Columns: #{`tput cols`.strip}" rescue nil
131
- puts " Lines: #{`tput lines`.strip}" rescue nil
132
-
133
- # Test 7: Check for signal handling changes
134
- puts "\nTest 7: Signal handling..."
135
- begin
136
- old_handler = Signal.trap("WINCH") { }
137
- Signal.trap("WINCH", old_handler)
138
- puts " ✓ SIGWINCH trap works"
139
- rescue => e
140
- puts " ✗ SIGWINCH trap failed: #{e.message}"
141
- end
142
-
143
- puts "\n" + "=" * 50
144
- puts "Diagnostic complete!"
145
- puts "\nPlease share this output to help identify the Ruby 3.4.5 compatibility issue."
@@ -1,156 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # Detailed diagnostic script for Ruby 3.4.5 compatibility issues
3
-
4
- puts "Ruby Compatibility Diagnostic for HyperList (Detailed)"
5
- puts "=" * 50
6
- puts "Ruby version: #{RUBY_VERSION}"
7
- puts "Ruby platform: #{RUBY_PLATFORM}"
8
- puts
9
-
10
- # Test 0: Environment check
11
- puts "Test 0: Environment check..."
12
- puts " TERM: #{ENV['TERM']}"
13
- puts " SHELL: #{ENV['SHELL']}"
14
- puts " HOME: #{ENV['HOME']}"
15
- puts " PATH includes gem bin: #{ENV['PATH'].include?('.gem')}"
16
- puts
17
-
18
- # Test 1: Basic rcurses load
19
- puts "Test 1: Loading rcurses gem..."
20
- STDOUT.flush
21
- begin
22
- require 'rcurses'
23
- puts " ✓ rcurses loaded"
24
- puts " Rcurses constants defined: #{Rcurses.constants.sort.join(', ')}" if defined?(Rcurses)
25
- STDOUT.flush
26
- rescue LoadError => e
27
- puts " ✗ Failed to load rcurses: #{e.message}"
28
- exit 1
29
- end
30
-
31
- # Test 2: Check rcurses version and methods
32
- puts "\nTest 2: Checking rcurses methods..."
33
- STDOUT.flush
34
- if defined?(Rcurses)
35
- puts " Methods available: #{Rcurses.methods(false).sort.join(', ')}"
36
- puts " Responds to init!: #{Rcurses.respond_to?(:init!)}"
37
- puts " Responds to done!: #{Rcurses.respond_to?(:done!)}"
38
- STDOUT.flush
39
- end
40
-
41
- # Test 3: Try initialization with timeout
42
- puts "\nTest 3: Attempting rcurses initialization (with 2 second timeout)..."
43
- STDOUT.flush
44
-
45
- require 'timeout'
46
- begin
47
- Timeout::timeout(2) do
48
- puts " Calling Rcurses.init!..."
49
- STDOUT.flush
50
-
51
- # Try to capture any initialization issues
52
- old_stdout = $stdout
53
- old_stderr = $stderr
54
-
55
- begin
56
- Rcurses.init!
57
- puts " ✓ Rcurses.init! returned successfully"
58
- rescue => e
59
- puts " ✗ Rcurses.init! raised: #{e.class} - #{e.message}"
60
- puts " Backtrace: #{e.backtrace.first(3).join("\n ")}"
61
- ensure
62
- $stdout = old_stdout
63
- $stderr = old_stderr
64
- end
65
-
66
- STDOUT.flush
67
- end
68
- rescue Timeout::Error
69
- puts " ✗ Rcurses.init! timed out after 2 seconds"
70
- puts " This suggests init! is hanging"
71
- STDOUT.flush
72
- end
73
-
74
- # Test 4: Check terminal control without rcurses
75
- puts "\nTest 4: Direct terminal control test..."
76
- STDOUT.flush
77
- begin
78
- # Save terminal state
79
- system("stty -g > /tmp/terminal_state.txt 2>/dev/null")
80
-
81
- # Try basic terminal operations
82
- print "\e[?25l" # Hide cursor
83
- print "\e[2J" # Clear screen
84
- print "\e[H" # Home
85
- print "Terminal control test"
86
- sleep 0.5
87
- print "\e[2J\e[H" # Clear again
88
- print "\e[?25h" # Show cursor
89
-
90
- puts " ✓ Direct terminal control works"
91
- STDOUT.flush
92
- rescue => e
93
- puts " ✗ Terminal control failed: #{e.message}"
94
- STDOUT.flush
95
- ensure
96
- # Restore terminal
97
- system("stty $(cat /tmp/terminal_state.txt) 2>/dev/null")
98
- print "\e[?25h" # Ensure cursor is visible
99
- end
100
-
101
- # Test 5: Check IO/console
102
- puts "\nTest 5: IO/console functionality..."
103
- STDOUT.flush
104
- begin
105
- require 'io/console'
106
-
107
- # Check if stdin is a tty
108
- puts " STDIN.tty?: #{STDIN.tty?}"
109
- puts " STDOUT.tty?: #{STDOUT.tty?}"
110
-
111
- # Test raw mode
112
- begin
113
- STDIN.raw { }
114
- puts " ✓ STDIN.raw works"
115
- rescue => e
116
- puts " ✗ STDIN.raw failed: #{e.message}"
117
- end
118
-
119
- # Test noecho
120
- begin
121
- STDIN.noecho { }
122
- puts " ✓ STDIN.noecho works"
123
- rescue => e
124
- puts " ✗ STDIN.noecho failed: #{e.message}"
125
- end
126
-
127
- STDOUT.flush
128
- rescue => e
129
- puts " ✗ Failed: #{e.message}"
130
- STDOUT.flush
131
- end
132
-
133
- # Test 6: Check if rcurses is trying to use methods that don't exist
134
- puts "\nTest 6: Checking potential Ruby 3.4 incompatibilities..."
135
- STDOUT.flush
136
-
137
- # Check Thread methods
138
- puts " Thread.respond_to?(:handle_interrupt): #{Thread.respond_to?(:handle_interrupt)}"
139
- puts " Signal.list includes WINCH: #{Signal.list.include?('WINCH')}"
140
-
141
- # Check IO methods that might be different
142
- if defined?(IO.console)
143
- console = IO.console
144
- puts " IO.console class: #{console.class}"
145
- puts " IO.console methods include raw: #{console.respond_to?(:raw)}"
146
- puts " IO.console methods include getch: #{console.respond_to?(:getch)}"
147
- end
148
-
149
- puts "\n" + "=" * 50
150
- puts "Diagnostic complete!"
151
- puts "\nIf the script hangs at 'Calling Rcurses.init!', it means rcurses"
152
- puts "is incompatible with Ruby 3.4.5 and needs to be updated."
153
- STDOUT.flush
154
-
155
- # Clean exit
156
- exit 0