Closed generalmimon closed 1 year ago
The reasons why I did this were:
the declared "required Ruby version" at https://rubygems.org/gems/kaitai-struct-visualizer is >= 0
:
which is not really true as I discovered - so I think it makes sense to declare it in kaitai-struct-visualizer.gemspec
so that it'll be correct on RubyGems as well after a new release.
@GreyCat also mentioned in https://github.com/kaitai-io/kaitai_struct_visualizer/pull/34#issuecomment-590288856 that:
Ideally, we'd like to have a clear understanding which versions of Ruby we target here, but this is a good step forward :)
I wanted to test https://github.com/kaitai-io/kaitai_struct_visualizer/pull/49 properly to determine whether it fixes the Ruby 3 incompatibility on Windows while not breaking older versions of Ruby.
Also I wanted to know how ready we are to publish a new version of ksv
to RubyGems.
Ruby 2.4 is now specified in .gemspec
as the minimum supported Ruby version:
so this issue can be closed.
Ruby installations come from https://rubyinstaller.org/downloads/, everything is run in Windows Sandbox.
kaitai-struct-visualizer-0.7.gem
was built manually from https://github.com/kaitai-io/kaitai_struct_visualizer/pull/49 by usinggem build kaitai-struct-visualizer.gemspec
with thehumdogm:master
branch checked out.Ruby 1.8
https://github.com/kaitai-io/kaitai_struct_visualizer/blob/5b3ec3dbaa6f3cbc9c34c0e51d92d443c3861e71/bin/ksv#L9
Ruby 1.9
https://github.com/kaitai-io/kaitai_struct_visualizer/blob/5b3ec3dbaa6f3cbc9c34c0e51d92d443c3861e71/lib/kaitai/tui.rb#L16
Ruby 2.0
https://github.com/kaitai-io/kaitai_struct_visualizer/blob/5b3ec3dbaa6f3cbc9c34c0e51d92d443c3861e71/lib/kaitai/struct/visualizer/hex_viewer.rb#L128
https://stackoverflow.com/a/36812667/12940655:
Ruby 2.3
I was actually trying out https://github.com/kaitai-io/kaitai_struct_visualizer/pull/49, so line 97 is the following:
https://github.com/kaitai-io/kaitai_struct_visualizer/blob/2e19269aa37c017987108758fbd921eb57f961cd/lib/kaitai/console_windows.rb#L97
And I already know that
String#unpack1
was introduced in Ruby 2.4: https://github.com/kaitai-io/kaitai_struct_ruby_runtime/issues/8Ruby 2.4
It seems to work fine (with changes from https://github.com/kaitai-io/kaitai_struct_visualizer/pull/49), the hex viewer finally shows up.
Ruby 2.7
Works the same as Ruby 2.4.
Ruby 3.0
For Ruby 3.0+ support on Windows (since the version from RubyGems fails with
in `require': cannot load such file -- Win32API (LoadError)
on linelib/kaitai/console_windows.rb:2
since Ruby 3 - see https://github.com/kaitai-io/kaitai_struct_visualizer/issues/48), I checked out https://github.com/kaitai-io/kaitai_struct_visualizer/pull/49 and builtkaitai-struct-visualizer-0.7.gem
from sources usinggem build kaitai-struct-visualizer.gemspec
.Works, same as Ruby 2.4 and 2.7.
Ruby 3.1
Same as Ruby 2.4, 2.7 and 3.0.