Sha256: fc9ae95b99df1956220dc0226191024eb9449e05f489bfe3abf37524db81905b

Contents?: true

Size: 612 Bytes

Versions: 6

Compression:

Stored size: 612 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)
      
      check_class_collision :suffix => "Widget"
      
      
      def create_cell_file
        template 'widget.rb', "#{base_path}_widget.rb"
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
apotomo-1.3.2 lib/generators/apotomo/widget_generator.rb
apotomo-1.3.1 lib/generators/apotomo/widget_generator.rb
apotomo-1.3.0 lib/generators/apotomo/widget_generator.rb
apotomo-1.2.6 lib/generators/apotomo/widget_generator.rb
apotomo-1.2.5 lib/generators/apotomo/widget_generator.rb
apotomo-1.2.4 lib/generators/apotomo/widget_generator.rb