Sha256: 99d85338523354d95f3ce05375cea9ac6a905719f1b15e035abc8c0761c12c21

Contents?: true

Size: 570 Bytes

Versions: 6

Compression:

Stored size: 570 Bytes

Contents

require 'mumukit/core'

module Mumukit
  module ContentType
    module BaseContentType
      def format_exception(e)
        "#{title e.message}\n#{code e.backtrace.join("\n")}"
      end
    end

    def self.parse(s)
      "Mumukit::ContentType::#{s.to_s.titlecase}".constantize
    rescue
      raise "unknown content_type #{s}"
    end

    def self.for(type)
      parse(type)
    end
  end
end

require_relative './content_type/markdown'
require_relative './content_type/with_markdown'
require_relative './content_type/plain'
require_relative './content_type/html'

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
mumukit-content-type-1.0.0 lib/mumukit/content_type.rb
mumukit-content-type-0.6.0 lib/mumukit/content_type.rb
mumukit-content-type-0.5.1 lib/mumukit/content_type.rb
mumukit-content-type-0.5.0 lib/mumukit/content_type.rb
mumukit-content-type-0.4.0 lib/mumukit/content_type.rb
mumukit-content-type-0.3.0 lib/mumukit/content_type.rb