hyperlist 1.1.5 → 1.1.6

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: 35f413c3d4847c79d6284a15ebb366df9bf40371f6b9df3a5be2c34b6cb7a17b
4
- data.tar.gz: 7c528e553d89eacdbd1b0ee1e87d847f9394cf43cd8a690dcd2dd241cb679624
3
+ metadata.gz: c3394f0a19dc7d9641036a62d294be9dcb4d07627e8f28abbf52be6db409b0ce
4
+ data.tar.gz: 226af1d1c88dc25128f9fb881e6195bb57f4ee9ec8248320d9c12834b1275aff
5
5
  SHA512:
6
- metadata.gz: fc7607ecec08008dcc69d9a070a71d1b68edb564b8a9ecacd2cc4c67012188b350c5ff09b3f1a8015c9798a000c5eaffa09b4a637ac33bbfe7a96d943f0b1c40
7
- data.tar.gz: 42ddb51750d0cecc9cf6afc8797bb3b89eb283ebcee2b085ab1ec2f401aefb73ed8f5f777d9c9cabfd6f6dda85619da317ae0b6db0fa0801868aad53ad26c589
6
+ metadata.gz: e636855dff0f0179dcb0f7eb56dc67c577f3775cd1fbf93d9c49b1812ce896e34160331146c4a6e8cea5e7fa92cafba197244210bb48b24f5abfa86e1e7c266b
7
+ data.tar.gz: b5793788afef9b63fe54471687ed3f03f6f100616f2aa89eb13a5fa5e36201cbfaabac24b7683f612084bfacf3ffb827bac1bf7e363958ece2de0f32fecedc7a
data/CHANGELOG.md CHANGED
@@ -2,6 +2,15 @@
2
2
 
3
3
  All notable changes to the HyperList Ruby TUI will be documented in this file.
4
4
 
5
+ ## [1.1.6] - 2025-08-14
6
+
7
+ ### Fixed
8
+ - **Ruby 3.4+ Compatibility**
9
+ - Added explicit rcurses initialization for Ruby 3.4.0 and later
10
+ - Improved error handling during terminal initialization
11
+ - Added proper cleanup on exit for newer Ruby versions
12
+ - Fixed silent crashes on Arch Linux with Ruby 3.4.5
13
+
5
14
  ## [1.1.0] - 2025-08-13
6
15
 
7
16
  ### Added
@@ -0,0 +1,145 @@
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."
data/hyperlist CHANGED
@@ -7,7 +7,7 @@
7
7
  # Check for help/version BEFORE loading any libraries
8
8
  if ARGV[0] == '-h' || ARGV[0] == '--help'
9
9
  puts <<~HELP
10
- HyperList v1.1.5 - Terminal User Interface for HyperList files
10
+ HyperList v1.1.6 - Terminal User Interface for HyperList files
11
11
 
12
12
  USAGE
13
13
  hyperlist [OPTIONS] [FILE]
@@ -52,7 +52,7 @@ if ARGV[0] == '-h' || ARGV[0] == '--help'
52
52
  HELP
53
53
  exit 0
54
54
  elsif ARGV[0] == '-v' || ARGV[0] == '--version'
55
- puts "HyperList v1.1.5"
55
+ puts "HyperList v1.1.6"
56
56
  exit 0
57
57
  end
58
58
 
@@ -70,7 +70,7 @@ class HyperListApp
70
70
  include Rcurses::Input
71
71
  include Rcurses::Cursor
72
72
 
73
- VERSION = "1.1.5"
73
+ VERSION = "1.1.6"
74
74
 
75
75
  def initialize(filename = nil)
76
76
  @filename = filename ? File.expand_path(filename) : nil
@@ -4555,8 +4555,35 @@ class HyperListApp
4555
4555
  end
4556
4556
 
4557
4557
  # Main
4558
- if __FILE__ == $0
4558
+ if __FILE__ == $0 && !defined?($hyperlist_wrapper_mode)
4559
4559
  # Normal operation - help/version already handled at top of file
4560
+
4561
+ # For Ruby 3.4+, explicitly initialize rcurses if needed
4562
+ if RUBY_VERSION >= "3.4.0"
4563
+ begin
4564
+ Rcurses.init! unless Rcurses.respond_to?(:initialized?) && Rcurses.initialized?
4565
+ rescue => e
4566
+ # If initialization fails, try to provide helpful error
4567
+ puts "Failed to initialize terminal interface: #{e.message}"
4568
+ puts "Try running with: ruby #{__FILE__} #{ARGV.join(' ')}"
4569
+ exit 1
4570
+ end
4571
+ end
4572
+
4560
4573
  app = HyperListApp.new(ARGV[0])
4561
- app.run
4574
+
4575
+ begin
4576
+ app.run
4577
+ ensure
4578
+ # Ensure proper cleanup for Ruby 3.4+
4579
+ if RUBY_VERSION >= "3.4.0"
4580
+ begin
4581
+ Rcurses.done! if defined?(Rcurses.done!)
4582
+ rescue
4583
+ # Fallback cleanup
4584
+ print "\e[?25h" # Show cursor
4585
+ system("stty sane 2>/dev/null")
4586
+ end
4587
+ end
4588
+ end
4562
4589
  end
data/hyperlist.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "hyperlist"
3
- spec.version = "1.1.5"
3
+ spec.version = "1.1.6"
4
4
  spec.authors = ["Geir Isene"]
5
5
  spec.email = ["g@isene.com"]
6
6
 
@@ -0,0 +1,57 @@
1
+ #!/usr/bin/env ruby
2
+ # encoding: utf-8
3
+
4
+ # Wrapper for Ruby 3.4+ compatibility
5
+ # This ensures proper initialization of rcurses
6
+
7
+ # Handle help/version before loading libraries
8
+ if ARGV[0] == '-h' || ARGV[0] == '--help' || ARGV[0] == '-v' || ARGV[0] == '--version'
9
+ # Pass through to main hyperlist
10
+ load File.join(File.dirname(__FILE__), 'hyperlist')
11
+ exit 0
12
+ end
13
+
14
+ # Explicitly initialize rcurses before loading the main app
15
+ require 'rcurses'
16
+
17
+ begin
18
+ # Initialize rcurses with proper error handling
19
+ Rcurses.init!
20
+
21
+ # Now load and run the main hyperlist app
22
+ # We need to prevent the main file from running automatically
23
+ $hyperlist_wrapper_mode = true
24
+
25
+ # Load the hyperlist file
26
+ load File.join(File.dirname(__FILE__), 'hyperlist')
27
+
28
+ # Create and run the app
29
+ app = HyperListApp.new(ARGV[0])
30
+ app.run
31
+
32
+ rescue Interrupt
33
+ # Handle Ctrl+C gracefully
34
+ Rcurses.done! if defined?(Rcurses.done!)
35
+ puts "\nInterrupted"
36
+ exit 0
37
+ rescue => e
38
+ # Ensure terminal is restored on error
39
+ Rcurses.done! if defined?(Rcurses.done!)
40
+
41
+ # Fallback terminal restoration
42
+ print "\e[?25h" # Show cursor
43
+ system("stty sane 2>/dev/null")
44
+
45
+ puts "Error: #{e.message}"
46
+ puts "Backtrace:" if ENV['DEBUG']
47
+ e.backtrace.first(10).each { |line| puts " #{line}" } if ENV['DEBUG']
48
+ exit 1
49
+ ensure
50
+ # Always try to restore terminal
51
+ begin
52
+ Rcurses.done! if defined?(Rcurses.done!)
53
+ rescue
54
+ print "\e[?25h"
55
+ system("stty sane 2>/dev/null")
56
+ end
57
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hyperlist
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.5
4
+ version: 1.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Geir Isene
@@ -75,11 +75,13 @@ files:
75
75
  - README.md
76
76
  - debug_instructions.md
77
77
  - diagnose.rb
78
+ - diagnose_ruby34.rb
78
79
  - diagnose_safe.rb
79
80
  - fix_terminal.sh
80
81
  - hyperlist
81
82
  - hyperlist.gemspec
82
83
  - hyperlist_logo.svg
84
+ - hyperlist_ruby34_wrapper.rb
83
85
  - sample.hl
84
86
  - screenshot_help.png
85
87
  - screenshot_sample.png