Skip to content

win32console deprecated (windows) #36

@erasmux

Description

@erasmux

First the issue, even with win32console I can't get colors on windows:

irb(main):001:0> require 'ansi/code'
ansi: 'gem install win32console' to use color on Windows

The reason is that win32console is deprecated (and does not load on recent ruby versions). The good news is that, to the best of the my knowledge, it is no longer needed in ruby 2.0+.

The fix is very simple: don't require 'win32console' when ruby version is 2.0+ (assuming I am not missing anything here).

I verified this by changing code.rb, line 9 to:
if RUBY_PLATFORM =~ /(win32|w32)/ && RUBY_VERSION < "2.0"
This seems to work fine for me.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions