Skip to content

Instantly share code, notes, and snippets.

@jasonelston
Created February 19, 2012 23:51
Show Gist options
  • Save jasonelston/1866600 to your computer and use it in GitHub Desktop.
Save jasonelston/1866600 to your computer and use it in GitHub Desktop.
Test rails generator (rails g generator tester)
#./lib/generators/tester
# shows in generator list as
class TesterGenerator < Rails::Generators::NamedBase
source_root File.expand_path('../templates', __FILE__)
end
# $ rails g
# Usage: rails generate GENERATOR [args] [options]
#
# ...
#
# Tester:
# tester
module Blah
class TesterGenerator < Rails::Generators::NamedBase
source_root File.expand_path('../templates', __FILE__)
end
end
# $ rails g
# Usage: rails generate GENERATOR [args] [options]
#
# ...
#
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment