This module it’s used for register generators
Can be useful for 3rd party generators:
# custom_generator.rb class CustomGenerator < Thor::Group Padrino::Generators.add_generator(:custom_generator, self) end
Now for handle generators in padrino you need to add it to into load_paths
Padrino::Generators.load_paths << "custom_generator.rb"
Defines the absolute path to the padrino source folder
Gloabl add a new generator class to padrino-gen
@param [Symbol] name
key name for generator mapping
@param [Class] klass
class of generator
@return [Hash] generator mappings
@example
Padrino::Generators.add_generator(:controller, Controller)
@api semipublic
# File lib/padrino-gen.rb, line 72 def add_generator(name, klass) mappings[name] = klass end
Load Global Actions and Component Actions then all files in load_path.
@api private
# File lib/padrino-gen.rb, line 80 def load_components! require 'padrino-gen/generators/actions' require 'padrino-gen/generators/components/actions' require 'padrino-gen/generators/runner' load_paths.flatten.each { |file| require file } end
Generated with the Darkfish Rdoc Generator 2.