Sha256: 7f9f46c3be8a915e33037a5f06f28260046692f7be31d979b71e197e47af884d

Contents?: true

Size: 548 Bytes

Versions: 5

Compression:

Stored size: 548 Bytes

Contents

module Rails
  module Generators
    class DecoratorGenerator < Rails::Generators::NamedBase
      source_root File.expand_path('../templates', __FILE__)

      desc <<DESC
Description:
    Stubs out a decorator module in app/decorators directory.

Examples:
    `rails g decorator book`

    This creates:
        app/decorators/book_decorator.rb
DESC

      def create_decorator_file
        template 'decorator.rb', File.join('app/decorators', class_path, "#{file_name}_decorator.rb")
      end

      hook_for :test_framework
    end
  end
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
active_decorator-0.7.1 lib/generators/rails/decorator_generator.rb
active_decorator-0.7.0 lib/generators/rails/decorator_generator.rb
active_decorator-0.6.0 lib/generators/rails/decorator_generator.rb
lulalala_presenter-0.0.1 lib/generators/rails/decorator_generator.rb
active_decorator-0.5.3 lib/generators/rails/decorator_generator.rb