Class: ControllerGenerator

Inherits:
BaseScaffold show all
Defined in:
lib/vraptor-scaffold/generators/scaffold/controller_generator/controller_generator.rb

Instance Method Summary collapse

Methods inherited from BaseScaffold

#base_path, #class_name, #controller_class_name, #controller_test_class_name, #initialize, #model_list_name, #model_parameter_name, #repository_impl_name, #repository_interface_name, #repository_test_class_name, #test_class_name

Constructor Details

This class inherits a constructor from BaseScaffold

Instance Method Details

#buildObject



3
4
5
6
7
# File 'lib/vraptor-scaffold/generators/scaffold/controller_generator/controller_generator.rb', line 3

def build
  define_source_paths
  template("controller.erb", Configuration.main_class_path(Configuration.controllers_package, "#{controller_class_name}.java"))
  template("controller_test.erb", Configuration.test_class_path(Configuration.controllers_package, "#{controller_test_class_name}.java"))
end

#pathObject



17
18
19
# File 'lib/vraptor-scaffold/generators/scaffold/controller_generator/controller_generator.rb', line 17

def path
  "/#{base_path}"
end

#source_rootObject



13
14
15
# File 'lib/vraptor-scaffold/generators/scaffold/controller_generator/controller_generator.rb', line 13

def source_root
  File.join File.dirname(__FILE__), "templates"
end

#template_pathObject



9
10
11
# File 'lib/vraptor-scaffold/generators/scaffold/controller_generator/controller_generator.rb', line 9

def template_path
  "src/templates/controllers"
end