Fixup qwandry to play nice with ruby 1.8.7 and rubininus.
This commit is contained in:
parent
2c590a72a3
commit
c85ddeff8c
@ -51,21 +51,23 @@ register_if_present :node do
|
|||||||
add node_paths
|
add node_paths
|
||||||
end
|
end
|
||||||
|
|
||||||
# If this is mri ruby and we can figure out where the user's ruby source directory is, add it.
|
# If this is mri ruby or rubinus and we can figure out where the user's ruby source directory is, add it.
|
||||||
# This might not be quite right...
|
# TODO: Add support for macruby and jruby
|
||||||
#
|
if RUBY_DESCRIPTION =~ /^(ruby|rubinius) /
|
||||||
# TODO figure out how to identify different ruby variants.
|
name = case $1
|
||||||
if const_defined?(:RUBY_ENGINE) && RUBY_ENGINE == 'ruby'
|
when 'ruby' then :mri
|
||||||
register_if_present :mri, :rvm do
|
when 'rubinius' then :rbx
|
||||||
|
end
|
||||||
|
register_if_present name, :rvm do
|
||||||
# If present, use the current rvm's ruby source.
|
# If present, use the current rvm's ruby source.
|
||||||
paths = []
|
paths = []
|
||||||
root = File.join(ENV['rvm_src_path'], ENV['rvm_ruby_string'])
|
root = File.join(ENV['rvm_src_path'], ENV['rvm_ruby_string'])
|
||||||
paths << root # core objects: String, etc
|
paths << root # core objects: String, etc
|
||||||
paths << File.join(root, 'ext') # c extensions: Fiber, IO, etc.
|
paths << File.join(root, 'ext') # extensions: Fiber, IO, etc.
|
||||||
paths << File.join(root, 'lib') # pure ruby libraries
|
paths << File.join(root, 'lib') # pure ruby libraries
|
||||||
|
|
||||||
# Add the sources, use a LibraryRepository to bundle .h and .c files
|
# Add the sources, use a LibraryRepository to bundle .h and .c files
|
||||||
add paths, :reject=>/\.(o|a|s|inc|def|dylib)$/, :class=>Qwandry::LibraryRepository
|
add paths, :reject=>/\.(o|a|s|inc|def|dylib|rbc)$/, :class=>Qwandry::LibraryRepository
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user