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.1.3 lib/merb-gen/named_generator.rb
merb-gen-1.1.2 lib/merb-gen/named_generator.rb
merb-gen-1.1.1 lib/merb-gen/named_generator.rb
merb-gen-1.1.0 lib/merb-gen/named_generator.rb
merb-gen-1.1.0.rc1 lib/merb-gen/named_generator.rb
merb-gen-1.1.0.pre lib/merb-gen/named_generator.rb
merb-gen-1.0.15 lib/merb-gen/named_generator.rb
merb-gen-1.0.14 lib/merb-gen/named_generator.rb
merb-gen-1.0.13 lib/merb-gen/named_generator.rb
merb-gen-1.0.12 lib/merb-gen/named_generator.rb
merb-gen-0.9.10 lib/merb-gen/named_generator.rb
merb-gen-0.9.12 lib/merb-gen/named_generator.rb
merb-gen-0.9.11 lib/merb-gen/named_generator.rb
merb-gen-0.9.13 lib/merb-gen/named_generator.rb
merb-gen-1.0.2 lib/merb-gen/named_generator.rb
merb-gen-0.9.9 lib/merb-gen/named_generator.rb
merb-gen-1.0.11 lib/merb-gen/named_generator.rb
merb-gen-1.0.1 lib/merb-gen/named_generator.rb
merb-gen-1.0.10 lib/merb-gen/named_generator.rb
merb-gen-1.0.4 lib/merb-gen/named_generator.rb