The given path may include a colon ’:’ character to indicate
that the file belongs to another generator. This notation allows any
generator to borrow files from another. Example:
# File railties/lib/rails_generator/base.rb, line 134
def source_path(relative_source)
# Check whether we're referring to another generator's file.
name, path = relative_source.split(':', 2)
# If not, return the full path to our source file.
if path.nil?
File.join(source_root, name)
# Otherwise, ask our referral for the file.
else
# FIXME: this is broken, though almost always true. Others'
# source_root are not necessarily the templates dir.
File.join(self.class.lookup(name).path, 'templates', path)
end
end