Sha256: e21c725551565d5768c3cc0109330667488fd297b74fd9d9d9f70d407cb4c417
Contents?: true
Size: 846 Bytes
Versions: 13
Compression:
Stored size: 846 Bytes
Contents
module Generators module Hobo Controller = classy_module do check_class_collision :suffix => 'Controller' def self.banner "rails generate hobo:controller #{self.arguments.map(&:usage).join(' ')}" end def generate_controller if class_path.length == 1 and subsite = class_path.first and File.exist?(File.join('app/controllers', class_path, "#{subsite}_site_controller.rb")) @subsite = subsite.camelize end template 'controller.rb.erb', File.join('app/controllers',"#{file_path}_controller.rb") end def generate_helper invoke 'helper', [name], options end hook_for :test_framework, :as => :controller do | instance, controller_test | instance.invoke controller_test, [ instance.name ] end end end end
Version data entries
13 entries across 13 versions & 1 rubygems