Sha256: 098246eb8287c6a57ffc151ca058f4b197111e26debbf5a04c78ed5e11c1d43d

Contents?: true

Size: 622 Bytes

Versions: 4

Compression:

Stored size: 622 Bytes

Contents

require 'merb/generators/merb_generator_helpers'

class PartControllerGenerator < Merb::GeneratorHelpers::ControllerGeneratorBase

  def initialize(*args)
    runtime_options = args.last.is_a?(Hash) ? args.pop : {}
    name, *actions = args.flatten
    name += "_part"
    
    runtime_options[:actions]           = actions.empty? ? %w[index] : actions
    runtime_options[:base_dest_folder]  = "app/parts"
    super( [name], runtime_options  )
  end

  def self.superclass
    RubiGen::Base
  end
    
  protected
    def banner
      <<-EOS
Creates a Merb part_controller

USAGE: #{$0} #{spec.name} name"
EOS
    end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
merb-0.5.0 merb_generators/part_controller/part_controller_generator.rb
merb-0.5.1 merb_generators/part_controller/part_controller_generator.rb
merb-0.5.2 merb_generators/part_controller/part_controller_generator.rb
merb-0.5.3 merb_generators/part_controller/part_controller_generator.rb