Better detection of mri-ruby sources
This commit is contained in:
parent
237ff7df55
commit
320133c4a5
|
@ -52,14 +52,22 @@ register_if_present :node do
|
||||||
add node_paths
|
add node_paths
|
||||||
end
|
end
|
||||||
|
|
||||||
# If we can figure out where the user's ruby source directory is, add it.
|
# If this is mri ruby and we can figure out where the user's ruby source directory is, add it.
|
||||||
register_if_present :ruby_src, :rvm do
|
# This might not be quite right...
|
||||||
# If present, use the current rvm's ruby source, this will probably be MRI
|
#
|
||||||
# though you never know. We could later try to be smarter about jruby, etc.
|
# TODO figure out how to identify different ruby variants.
|
||||||
path = File.join(ENV['rvm_src_path'], ENV['rvm_ruby_string'])
|
if RUBY_ENGINE == 'ruby'
|
||||||
|
register_if_present :mri, :rvm do
|
||||||
|
# If present, use the current rvm's ruby source.
|
||||||
|
paths = []
|
||||||
|
root = File.join(ENV['rvm_src_path'], ENV['rvm_ruby_string'])
|
||||||
|
paths << root # core objects: String, etc
|
||||||
|
paths << File.join(root, 'ext') # c extensions: Fiber, IO, etc.
|
||||||
|
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 path, :reject=>/\.(o|a|dylib)$/, :class=>Qwandry::LibraryRepository
|
add paths, :reject=>/\.(o|a|s|inc|def|dylib)$/, :class=>Qwandry::LibraryRepository
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# Qwandry is a ruby app after all, so activate ruby and gem by default. Other defaults can be set
|
# Qwandry is a ruby app after all, so activate ruby and gem by default. Other defaults can be set
|
||||||
|
|
Loading…
Reference in New Issue