Sha256: 793cfc1dd2cf9be781ed9ef6aa8cd156a22b46345a22d34a70c0dc74958b91d5

Contents?: true

Size: 646 Bytes

Versions: 8

Compression:

Stored size: 646 Bytes

Contents

require 'generators/cells/base'

module Apotomo
  module Generators
    module BasePathMethods
    private
      def base_path
        File.join('app/widgets', class_path, file_name)
      end
    end
    
    class WidgetGenerator < ::Cells::Generators::Base
      include BasePathMethods
      
      source_root File.expand_path('../../templates', __FILE__)
      
      hook_for(:template_engine)
      hook_for(:test_framework)  # TODO: implement rspec-apotomo.
      
      check_class_collision :suffix => "Widget"
      
      
      def create_cell_file
        template 'widget.rb', "#{base_path}_widget.rb"
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
apotomo-1.2.3 lib/generators/apotomo/widget_generator.rb
apotomo-1.2.2 lib/generators/apotomo/widget_generator.rb
apotomo-1.2.1 lib/generators/apotomo/widget_generator.rb
apotomo-1.2.0 lib/generators/apotomo/widget_generator.rb
apotomo-1.1.4 lib/generators/apotomo/widget_generator.rb
apotomo-1.1.3 lib/generators/apotomo/widget_generator.rb
apotomo-1.1.2 lib/generators/apotomo/widget_generator.rb
apotomo-1.1.1 lib/generators/apotomo/widget_generator.rb