Sha256: 13e9556f66fde33df4ce6ad4ed6f6a3096b7e5ae8b1f8950cbcfba32e9536bc2

Contents?: true

Size: 686 Bytes

Versions: 30

Compression:

Stored size: 686 Bytes

Contents

module Merb
  module Generators

    class NamedGenerator < Generator
      # NOTE: Currently this is not inherited, it will have to be declared in each generator
      # that inherits from this.
      first_argument :name, :required => true
      
      def initialize(*args)
        super
      end
      
      def class_name
        name.gsub('-', '_').camel_case
      end
      
      alias_method :module_name, :class_name

      def test_class_name
        class_name + "Test"
      end

      def file_name
        name.snake_case
      end
      
      alias_method :base_name, :file_name

      def symbol_name
        file_name.gsub('-', '_')
      end

    end
 
  end
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
merb-gen-1.0.3 lib/merb-gen/named_generator.rb
merb-gen-1.0.5 lib/merb-gen/named_generator.rb
merb-gen-1.0.6 lib/merb-gen/named_generator.rb
merb-gen-1.0.6.1 lib/merb-gen/named_generator.rb
merb-gen-1.0.7 lib/merb-gen/named_generator.rb
merb-gen-1.0.7.1 lib/merb-gen/named_generator.rb
merb-gen-1.0.8 lib/merb-gen/named_generator.rb
merb-gen-1.0.8.1 lib/merb-gen/named_generator.rb
merb-gen-1.0 lib/merb-gen/named_generator.rb
merb-gen-1.0.9 lib/merb-gen/named_generator.rb