cosmo0920 / win32-api

A different, better variant of the Win32API Ruby library
61 stars 10 forks source link

Ruby 3.1 require fails to define API constant #61

Open ls5302 opened 1 year ago

ls5302 commented 1 year ago

The universal-mingw32 gem 1.10.1 contains .so for Ruby 3.1 but the api.rb does not have support for Ruby 3.1.

I believe the code in between the comments is missing:

when '3'
    if RbConfig::CONFIG['MINOR'] == '0'
      if RbConfig::CONFIG['arch'] =~ /x64/i
        require File.join(File.dirname(__FILE__), 'ruby30_64/win32/api')
      else
        require File.join(File.dirname(__FILE__), 'ruby30_32/win32/api')
      end
    # start missing
    elseif RbConfig::CONFIG['MINOR'] == '1'
      if RbConfig::CONFIG['arch'] =~ /x64/i
        require File.join(File.dirname(__FILE__), 'ruby31_64/win32/api')
      else
        require File.join(File.dirname(__FILE__), 'ruby31_32/win32/api')
      end
    # end missing
    end

I have a work around but I thought I'd let you know.