method
usage_message

usage_message()
protected
Hide source
# File railties/lib/rails_generator/scripts.rb, line 44 def usage_message usage = "\nInstalled Generators\n" Rails::Generator::Base.sources.inject([]) do |mem, source| # Using an association list instead of a hash to preserve order, # for esthetic reasons more than anything else. label = source.label.to_s.capitalize pair = mem.assoc(label) mem << (pair = [label, []]) if pair.nil? pair[1] |= source.names mem end.each do |label, names| usage << " #{label}: #{names.join(', ')}\n" unless names.empty? end usage << "\nMore are available at http://wiki.rubyonrails.org/rails/pages/AvailableGenerators\n 1. Download, for example, login_generator.zip\n 2. Unzip to directory \#{Dir.user_home}/.rails/generators/login\n to use the generator with all your Rails apps\n" if Object.const_defined?(:RAILS_ROOT) usage << " or to \#{File.expand_path(RAILS_ROOT)}/lib/generators/login\n to use with this app only.\n" end usage << " 3. Run generate with no arguments for usage information\n \#{$0} login\n\nGenerator gems are also available:\n 1. gem search -r generator\n 2. gem install login_generator\n 3. \#{$0} login\n\n" return usage end