Sha256: 489905891fca933b56014b091455b7eaa8c49b57832339e9df0ca001f6d5fd69

Contents?: true

Size: 799 Bytes

Versions: 1

Compression:

Stored size: 799 Bytes

Contents

module Merb::Generators
  
  class HelperGenerator < NamespacedGenerator

    def self.source_root
      File.join(super, 'component', 'helper')
    end
    
    desc <<-DESC
      Generates a new helper.
    DESC
    
    option :testing_framework, :desc => 'Testing framework to use (one of: rspec, test_unit)'
    
    first_argument :name, :required => true, :desc => "helper name"
    
    template :helper do
      source('app/helpers/%file_name%_helper.rb')
      destination("app/helpers", base_path, "#{file_name}_helper.rb")
    end
    
    template :helper_spec, :testing_framework => :rspec do
      source('spec/helpers/%file_name%_helper_spec.rb')
      destination("spec/helpers", base_path, "#{file_name}_helper_spec.rb")
    end
    
  end
  
  add :helper, HelperGenerator
  
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
merb-gen-0.9.5 lib/generators/helper.rb