Sha256: 4ca8fd4e4e339f502b852e97f6aacc9ef0708ecc372599d8876141eb0f0eedba

Contents?: true

Size: 376 Bytes

Versions: 17

Compression:

Stored size: 376 Bytes

Contents

# frozen_string_literal: true

require 'shellwords'

module SdrClient
  module Deposit
    module FileMetadataBuilderOperations
      # Mime-type for this file.
      class MimeType
        NAME = 'mime_type'
        def self.for(filepath:, **)
          argv = Shellwords.escape(filepath)
          `file --mime-type -b #{argv}`.chomp
        end
      end
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
sdr-client-2.11.0 lib/sdr_client/deposit/file_metadata_builder_operations/mime_type.rb
sdr-client-2.10.1 lib/sdr_client/deposit/file_metadata_builder_operations/mime_type.rb
sdr-client-2.10.0 lib/sdr_client/deposit/file_metadata_builder_operations/mime_type.rb
sdr-client-2.9.0 lib/sdr_client/deposit/file_metadata_builder_operations/mime_type.rb
sdr-client-2.8.0 lib/sdr_client/deposit/file_metadata_builder_operations/mime_type.rb
sdr-client-2.7.1 lib/sdr_client/deposit/file_metadata_builder_operations/mime_type.rb
sdr-client-2.7.0 lib/sdr_client/deposit/file_metadata_builder_operations/mime_type.rb
sdr-client-2.6.0 lib/sdr_client/deposit/file_metadata_builder_operations/mime_type.rb
sdr-client-2.5.0 lib/sdr_client/deposit/file_metadata_builder_operations/mime_type.rb
sdr-client-2.4.0 lib/sdr_client/deposit/file_metadata_builder_operations/mime_type.rb
sdr-client-2.3.1 lib/sdr_client/deposit/file_metadata_builder_operations/mime_type.rb
sdr-client-2.3.0 lib/sdr_client/deposit/file_metadata_builder_operations/mime_type.rb
sdr-client-2.2.0 lib/sdr_client/deposit/file_metadata_builder_operations/mime_type.rb
sdr-client-2.1.0 lib/sdr_client/deposit/file_metadata_builder_operations/mime_type.rb
sdr-client-2.0.1 lib/sdr_client/deposit/file_metadata_builder_operations/mime_type.rb
sdr-client-2.0.0 lib/sdr_client/deposit/file_metadata_builder_operations/mime_type.rb
sdr-client-1.0.0 lib/sdr_client/deposit/file_metadata_builder_operations/mime_type.rb