Sha256: 80904f7a8bd62896314b9b0db3b83259c5434c340f6fe4e6c0a25f129262b2fd

Contents?: true

Size: 613 Bytes

Versions: 3

Compression:

Stored size: 613 Bytes

Contents

# encoding: utf-8

module Adhearsion
  module Generators
    class ControllerGenerator < Generator

      argument :controller_name, :type => :string

      def create_controller
        raise Exception, "Generator commands need to be run in an Adhearsion app directory" unless ScriptAhnLoader.in_ahn_application?('.')
        self.destination_root = '.'
        empty_directory 'lib'
        empty_directory 'spec'
        template 'lib/controller.rb', "lib/#{@controller_name.underscore}.rb"
        template 'spec/controller_spec.rb', "spec/#{@controller_name.underscore}_spec.rb"
      end

    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
adhearsion-2.0.0.rc3 lib/adhearsion/generators/controller/controller_generator.rb
adhearsion-2.0.0.rc2 lib/adhearsion/generators/controller/controller_generator.rb
adhearsion-2.0.0.rc1 lib/adhearsion/generators/controller/controller_generator.rb