Sha256: 73652041528991acc4eedf6d80900040e22d735b47f5816b52c13f73d82a1083
Contents?: true
Size: 1.46 KB
Versions: 4
Compression:
Stored size: 1.46 KB
Contents
class PrintControllerGenerator < Rails::Generator::NamedBase def manifest record do |m| # Check for class naming collisions. m.class_collisions "#{class_name}Controller", "#{class_name}ControllerTest", "#{class_name}Helper", "#{class_name}HelperTest" # Controller, helper, views, and test directories. m.directory File.join('app/controllers', class_path) m.directory File.join('app/helpers', class_path) m.directory File.join('test/functional', class_path) m.directory File.join('test/unit/helpers', class_path) m.directory File.join('config', class_path) # Controller class, functional test, and helper class. m.template 'controller.rb', File.join('app/controllers', class_path, "#{file_name}_controller.rb") m.template 'functional_test.rb', File.join('test/functional', class_path, "#{file_name}_controller_test.rb") m.template 'helper.rb', File.join('app/helpers', class_path, "#{file_name}_helper.rb") m.template 'helper_test.rb', File.join('test/unit/helpers', class_path, "#{file_name}_helper_test.rb") # Config file m.template 'config.yaml', File.join('config', "print.yaml") end end end
Version data entries
4 entries across 4 versions & 1 rubygems