Object
A spec knows where a generator was found and how to instantiate it. Metadata include the generator's name, its base path, and the source which yielded it (PathSource, GemPathSource, etc.)
# File lib/rails_generator/spec.rb, line 9 def initialize(name, path, source) @name, @path, @source = name, path, source end
# File lib/rails_generator/spec.rb, line 24 def class_file "#{path}/#{name}_generator.rb" end
# File lib/rails_generator/spec.rb, line 28 def class_name "#{name.camelize}Generator" end
Look up the generator class. Require its class file, find the class in ObjectSpace, tag it with this spec, and return.
# File lib/rails_generator/spec.rb, line 15 def klass unless @klass require class_file @klass = lookup_class @klass.spec = self end @klass end
[Validate]
Generated with the Darkfish Rdoc Generator 2.