Class: Rails::CommandGenerator

Inherits:
Generators::NamedBase
  • Object
show all
Defined in:
lib/generators/rails/command_generator.rb

Instance Method Summary collapse

Instance Method Details

#copy_filesObject



11
12
13
14
15
# File 'lib/generators/rails/command_generator.rb', line 11

def copy_files
  path = File.join('app', 'commands', class_path, "#{file_name}_command.rb")
  empty_directory('app/commands')
  template('command.rb.tt', path)
end

#copy_specsObject



17
18
19
20
21
# File 'lib/generators/rails/command_generator.rb', line 17

def copy_specs
  path = File.join('spec', 'commands', class_path, "#{file_name}_command_spec.rb")
  empty_directory('spec/commands')
  template('spec.rb.tt', path)
end