Cache source root in a rails specific variable.

This commit is contained in:
José Valim
2009-07-13 13:39:48 +02:00
parent 3075ae0611
commit cd28dcb5a4

View File

@@ -12,7 +12,7 @@ module Rails
# Automatically sets the source root based on the class name.
#
def self.source_root
@source_root ||= File.expand_path(File.join(File.dirname(__FILE__), base_name, generator_name, 'templates'))
@_rails_source_root ||= File.expand_path(File.join(File.dirname(__FILE__), base_name, generator_name, 'templates'))
end
# Tries to get the description from a USAGE file one folder above the source