lib/generators/apotomo/widget_generator.rb in apotomo-1.0.5 vs lib/generators/apotomo/widget_generator.rb in apotomo-1.1.0.rc1

- old
+ new

@@ -1,19 +1,18 @@ -require 'generators/cells/cell_generator' +require 'generators/cells/base' module Apotomo module Generators - class WidgetGenerator < Cells::Generators::CellGenerator - source_root File.expand_path(File.join(File.dirname(__FILE__), 'templates')) + class WidgetGenerator < ::Cells::Generators::Base + source_root File.expand_path(File.join(File.dirname(__FILE__), '../templates')) def create_cell_file - puts "creating #{file_name}.rb" - template 'widget.rb', File.join('app/cells', class_path, "#{file_name}.rb") + template 'widget.rb', File.join('app/widgets', class_path, "#{file_name}_widget.rb") end - def create_test - @states = actions - template 'widget_test.rb', File.join('test/widgets/', "#{file_name}_test.rb") - end + check_class_collision :suffix => "Widget" + + hook_for(:template_engine) + hook_for(:test_framework) # TODO: implement rspec-apotomo. end end end