class Rails::CommandGenerator

Public Instance Methods

copy_files() click to toggle source
# File lib/generators/rails/command_generator.rb, line 9
def copy_files
  path = File.join('app', 'commands', class_path, "#{file_name}_command.rb")
  template('command.rb.tt', path)
end

Private Instance Methods

file_name() click to toggle source
Calls superclass method
# File lib/generators/rails/command_generator.rb, line 16
def file_name
  @_file_name ||= remove_possible_suffix(super)
end
remove_possible_suffix(name) click to toggle source
# File lib/generators/rails/command_generator.rb, line 20
def remove_possible_suffix(name)
  name.sub(/_?command$/i, '')
end