gosu / ashton

Special graphical effects and other extensions for the Ruby/Gosu game library (⚠️ unmaintained)
MIT License
43 stars 10 forks source link

Use RbConfig::CONFIG['DLEXT'] instead of .so #16

Closed jlnr closed 11 years ago

jlnr commented 11 years ago

Ashton fails to load because dynamic libraries have a .bundle extension on OS X (actually that is not generally correct, but that is what Ruby uses):

begin
  RUBY_VERSION =~ /(\d+.\d+)/
  require "ashton/#{$1}/ashton.so"
rescue LoadError
  require "ashton/ashton.so"
end

RbConfig::CONFIG['DLEXT'] give you the file extension. Sorry for not sending a pull request, I just realised I could do this while typing this issue. :)

jlnr commented 11 years ago

I was waiting for stuff to compile and tried github's inline editor to send a PR, fun!