2010-08-05 14:41:35 +00:00
|
|
|
@repositories = Hash.new{|h,k| h[k] = []}
|
|
|
|
|
2010-08-06 16:48:52 +00:00
|
|
|
def add(label, path, repository_type=Qwandry::FlatRepository)
|
2010-08-09 04:15:20 +00:00
|
|
|
label = label.to_s
|
|
|
|
@repositories[label] << repository_type.new(label, path)
|
2010-08-05 14:41:35 +00:00
|
|
|
end
|
|
|
|
|
2010-08-16 04:02:43 +00:00
|
|
|
# Add gem repositories:
|
|
|
|
# Using the ruby load paths, determine the common gem root paths, and add those.
|
|
|
|
# This assumes gem paths look like:
|
|
|
|
($:).grep(/gems/).map{|p| p[/.+\/gems\//]}.uniq.each do |path|
|
|
|
|
add :gem, path
|
|
|
|
end
|
|
|
|
|
|
|
|
# Add ruby standard libraries, ignore the platform specific ones since they
|
|
|
|
# tend to contain only binaries
|
|
|
|
($:).grep(/lib\/ruby/).reject{|path| path =~ /#{RUBY_PLATFORM}$/}.each do |path|
|
|
|
|
add :ruby, path
|
2010-08-05 14:41:35 +00:00
|
|
|
end
|