Class: RobotLab::Generators::RobotGenerator

Inherits:
Rails::Generators::NamedBase
  • Object
show all
Defined in:
lib/generators/robot_lab/robot_generator.rb

Instance Method Summary collapse

Instance Method Details

#create_robot_fileObject



17
18
19
20
21
22
23
# File 'lib/generators/robot_lab/robot_generator.rb', line 17

def create_robot_file
  if options[:routing]
    template "routing_robot.rb.tt", "app/robots/#{file_name}_robot.rb"
  else
    template "robot.rb.tt", "app/robots/#{file_name}_robot.rb"
  end
end

#create_test_fileObject



25
26
27
# File 'lib/generators/robot_lab/robot_generator.rb', line 25

def create_test_file
  template "robot_test.rb.tt", "test/robots/#{file_name}_robot_test.rb"
end