Open postmodern opened 12 years ago
I'm ok with renaming lzma-ffi to ffi-lzma, but how is lzma related to ffi?
Hey thanks for doing that so quickly. I guess the ffi-
naming convention popped up when people were writing FFI bindings for libraries that already had C Extensions. So they wrapped everything in the FFI::
namespace to avoid collisions.
I think ::FFI namespace would be used to put in only things which are related to FFI, not based on FFI. If you want to use my ffi-lzma in an other class/module you can do something like:
module NotTheRightNamespace
require 'lzma'
end
by this way you have NOT my lzma in global scope :)
I don't think require
respects module
, it will just load the files. Probably a better compromise is to have two separate LZMA classes and a main LZMA constant:
LZMA = if RUBY_PLATFORM =~ /java/
Java::LZMA
else
FFI::LZMA
end
Following the convention of most FFI libraries,
lzma-ffi
should be renamed toffi-lzma
with the namespaceFFI::LZMA
.