Sha256: a7502dcc9a9da018f0c24c2e804d76f964d6d97d084c78ad4dc366c9b311f558
Contents?: true
Size: 591 Bytes
Versions: 3
Compression:
Stored size: 591 Bytes
Contents
class ControllerGenerator < RubiGen::Base attr_reader :name,:class_name,:file_name,:actions def initialize(runtime_args, runtime_options = {}) super usage if args.empty? @destination_root = File.expand_path('.') @name = args.shift @actions = args @file_name = @name.pluralize.underscore @class_name = @name.singularize.classify end def manifest record do |m| m.directory "test/app_root/app/controllers" m.template "controller.rb","test/app_root/app/controllers/#{file_name}_controller.rb" end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
newplugin-0.0.3 | generators/controller/controller_generator.rb |
newplugin-0.0.2 | generators/controller/controller_generator.rb |
newplugin-0.0.1 | generators/controller/controller_generator.rb |