E
Erik Veenstra
Require fills $" with (the short names of) the library files it
is able to find. When the program has ended, RubyScript2Exe
tries to match the libraries in $" with the directories in $:
and the default extensions in order to collect the files. But,
since $: might change when running the program (RubyGems!...),
the files RubyScript2Exe finds are not necessarily the ones
Ruby finds.
I came up with this solution (see below). Just redefine require
before executing the application and $" will be filled with the
full names of the library files. Seems to work....
Any suggestions or considerations?
gegroet,
Erik V. - http://www.erikveen.dds.nl/
----------------------------------------------------------------
alias ld_require :require
def require(lib, *rest)
extensions = ["", ".rb", ".so", ".o", ".dll"]
search_list = $:.collect{|dir| extensions.collect{|ext|
File.expand_path(lib + ext, dir)}}.flatten
found = search_list.find{|file| File.file?(file)}
lib = found unless found.nil?
old_require(lib, *rest)
end
----------------------------------------------------------------
is able to find. When the program has ended, RubyScript2Exe
tries to match the libraries in $" with the directories in $:
and the default extensions in order to collect the files. But,
since $: might change when running the program (RubyGems!...),
the files RubyScript2Exe finds are not necessarily the ones
Ruby finds.
I came up with this solution (see below). Just redefine require
before executing the application and $" will be filled with the
full names of the library files. Seems to work....
Any suggestions or considerations?
gegroet,
Erik V. - http://www.erikveen.dds.nl/
----------------------------------------------------------------
alias ld_require :require
def require(lib, *rest)
extensions = ["", ".rb", ".so", ".o", ".dll"]
search_list = $:.collect{|dir| extensions.collect{|ext|
File.expand_path(lib + ext, dir)}}.flatten
found = search_list.find{|file| File.file?(file)}
lib = found unless found.nil?
old_require(lib, *rest)
end
----------------------------------------------------------------