Sha256: ee16545b50556afa191fb44e33aeddd28cb98d90c58ab70b68e40f56e99ff902

Contents?: true

Size: 221 Bytes

Versions: 21

Compression:

Stored size: 221 Bytes

Contents

require 'mime/types'

module Hydra::Derivatives
  module MimeTypeService
    # @param [String] file_path path to a file
    def self.mime_type(file_path)
      MIME::Types.type_for(file_path).first.to_s
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
hydra-derivatives-3.7.0 lib/hydra/derivatives/services/mime_type_service.rb
hydra-derivatives-3.6.1 lib/hydra/derivatives/services/mime_type_service.rb
hydra-derivatives-3.6.0 lib/hydra/derivatives/services/mime_type_service.rb
hydra-derivatives-3.5.0 lib/hydra/derivatives/services/mime_type_service.rb
hydra-derivatives-3.4.2 lib/hydra/derivatives/services/mime_type_service.rb
hydra-derivatives-3.4.1 lib/hydra/derivatives/services/mime_type_service.rb
hydra-derivatives-3.4.0 lib/hydra/derivatives/services/mime_type_service.rb
hydra-derivatives-3.3.2 lib/hydra/derivatives/services/mime_type_service.rb
hydra-derivatives-3.3.1 lib/hydra/derivatives/services/mime_type_service.rb
hydra-derivatives-3.3.0 lib/hydra/derivatives/services/mime_type_service.rb
hydra-derivatives-3.2.2 lib/hydra/derivatives/services/mime_type_service.rb
hydra-derivatives-3.2.1 lib/hydra/derivatives/services/mime_type_service.rb
hydra-derivatives-3.2.0 lib/hydra/derivatives/services/mime_type_service.rb
hydra-derivatives-3.1.4 lib/hydra/derivatives/services/mime_type_service.rb
hydra-derivatives-3.1.3 lib/hydra/derivatives/services/mime_type_service.rb
hydra-derivatives-3.1.2 lib/hydra/derivatives/services/mime_type_service.rb
hydra-derivatives-3.1.1 lib/hydra/derivatives/services/mime_type_service.rb
hydra-derivatives-3.1.0 lib/hydra/derivatives/services/mime_type_service.rb
hydra-derivatives-3.0.2 lib/hydra/derivatives/services/mime_type_service.rb
hydra-derivatives-3.0.1 lib/hydra/derivatives/services/mime_type_service.rb