Sha256: cda07b80e4e094c56a8efd2e9d7b3c0219d9c7ff6abf6934b6660495485d0839

Contents?: true

Size: 447 Bytes

Versions: 3

Compression:

Stored size: 447 Bytes

Contents

#          Copyright (c) 2006 Michael Fellinger m.fellinger@gmail.com
# All files in this distribution are subject to the terms of the Ruby license.

require 'yaml'

module Ramaze
  module Tool
    module MIME

      trait :types => YAML.load_file(BASEDIR/'ramaze'/'tool'/'mime_types.yaml')

      class << self
        def type_for file
          ext = File.extname(file)
          trait[:types][ext].to_s
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ramaze-0.1.2 lib/ramaze/tool/mime.rb
ramaze-0.1.1 lib/ramaze/tool/mime.rb
ramaze-0.1.3 lib/ramaze/tool/mime.rb