lib/future/metadata/mime_info.rb
# Creates a subtype tree from a type_name.
# Mimetype['application/pdf'] == Mimetype['application']['pdf']
#
Creates a subtype tree from a type_name.
Creates a subtype tree from a type_name .
def create_subtype(type_name, full_name=type_name)
    types = split_type(type_name)
    if types.size > 1
      self[ types[0] ][ types[1..-1].join("/"), full_name ]
    else
      if not full_name.include?("/") and not mimetype.nil?
        full_name = [mimetype, full_name].join("/")
      end
      c = Module.new
      parent = self
      c.instance_eval{
        extend(Mimetype)
        @mimetype = full_name
        @mimetypes = {}
        mixin_superclasses(parent)
      }
      c
    end
  end
def create_subtype ( type_name , full_name = type_name ) types = split_type ( type_name ) if types . size > 1 self [ types [ 0 ] ] [ types [ 1 .. - 1 ] . join ( "/" ) , full_name ] else if not full_name . include? ( "/" ) and not mimetype . nil? full_name = [ mimetype , full_name ] . join ( "/" ) end c = Module . new parent = self c . instance_eval { extend ( Mimetype ) @mimetype = full_name @mimetypes = { } mixin_superclasses ( parent ) } c end end
Creates a subtype tree from a type_name.
Creates a subtype tree from a type_name .
type_name
<not_specific>
full_name
<not_specific>