Class: SteelWheel::CommandGenerator

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

Instance Method Summary collapse

Instance Method Details

#copy_filesObject



7
8
9
10
11
12
13
14
# File 'lib/generators/steel_wheel/command/command_generator.rb', line 7

def copy_files
  if behavior == :revoke
    template 'command_template.rb', "app/handlers/#{file_path}_handler/command.rb"
  elsif behavior == :invoke
    empty_directory Pathname.new('app/commands').join(*class_path)
    template 'command_template.rb', "app/handlers/#{file_path}_handler/command.rb"
  end
end