Sha256: d1114d20b5b72de2c61ecd28215a99eaf7d0e242dd8b2b9a979a9fbb96b79e92

Contents?: true

Size: 619 Bytes

Versions: 24

Compression:

Stored size: 619 Bytes

Contents

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

      check_class_collision :suffix => 'Presenter'

      def create_presenter_file
        template 'presenter.rb', File.join('app/presenters', class_path, "#{file_name}_presenter.rb")
      end

      def create_module_file
        return if regular_class_path.empty?
        template 'module.rb', File.join('app/presenters', "#{class_path.join('/')}.rb") if behavior == :invoke
      end

      hook_for :test_framework, :as => :presenter
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
riveter-0.0.5 lib/generators/riveter/presenter/presenter_generator.rb
riveter-0.0.4 lib/generators/riveter/presenter/presenter_generator.rb
riveter-0.0.3 lib/generators/riveter/presenter/presenter_generator.rb
riveter-0.0.1 lib/generators/riveter/presenter/presenter_generator.rb