extract_last_module

extract_last_module(nesting) Instance Protected methods Takes in an array of nested modules and extracts the last module

source_root

source_root(path=nil) Class Public methods Returns the source root for this generator using ::default_source_root as default.

remove_hook_for

remove_hook_for(*names) Class Public methods Remove a previously added hook. remove_hook_for :orm

namespace

namespace(name=nil) Class Public methods Convenience method to get the namespace from the class name. It's the same as Thor default except that the Generator at the end of the class is removed.

hook_for

hook_for(*names, &block) Class Public methods Invoke a generator based on the value supplied by the user to the given option named ânameâ. A class option is created when this method is invoked and you can set a hash to customize it. Examples module Rails::Generators class ControllerGenerator < Base hook_for :test_framework, aliases: "-t" end end The example above will create a test framework option and will invoke a generator based on the user supplied value. For ex

hide!

hide!() Class Public methods Convenience method to hide this generator from the available ones when running rails generator command.

desc

desc(description=nil) Class Public methods Tries to get the description from a USAGE file one folder above the source root otherwise uses a default description.

default_source_root

default_source_root() Class Public methods Returns the default source root for a given generator. This is used internally by rails to set its generators source root. If you want to customize your source root, you should use source_root.

base_root

base_root() Class Public methods Returns the base root for a common set of generators. This is used to dynamically guess the default source root.

padding

padding(max_width) Instance Public methods