Sha256: 28a324f2dd2c1b7cf63dfaa89a0da3826a3dfcabc21552de6d795c57749e836f

Contents?: true

Size: 378 Bytes

Versions: 83

Compression:

Stored size: 378 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(file_path:, **)
          argv = Shellwords.escape(file_path)
          `file --mime-type -b #{argv}`.chomp
        end
      end
    end
  end
end

Version data entries

83 entries across 83 versions & 1 rubygems

Version Path
sdr-client-0.97.0 lib/sdr_client/deposit/file_metadata_builder_operations/mime_type.rb
sdr-client-0.96.0 lib/sdr_client/deposit/file_metadata_builder_operations/mime_type.rb
sdr-client-0.95.0 lib/sdr_client/deposit/file_metadata_builder_operations/mime_type.rb
sdr-client-0.94.0 lib/sdr_client/deposit/file_metadata_builder_operations/mime_type.rb
sdr-client-0.93.0 lib/sdr_client/deposit/file_metadata_builder_operations/mime_type.rb
sdr-client-0.92.0 lib/sdr_client/deposit/file_metadata_builder_operations/mime_type.rb
sdr-client-0.91.0 lib/sdr_client/deposit/file_metadata_builder_operations/mime_type.rb
sdr-client-0.90.0 lib/sdr_client/deposit/file_metadata_builder_operations/mime_type.rb
sdr-client-0.89.0 lib/sdr_client/deposit/file_metadata_builder_operations/mime_type.rb
sdr-client-0.88.0 lib/sdr_client/deposit/file_metadata_builder_operations/mime_type.rb
sdr-client-0.87.0 lib/sdr_client/deposit/file_metadata_builder_operations/mime_type.rb
sdr-client-0.86.0 lib/sdr_client/deposit/file_metadata_builder_operations/mime_type.rb
sdr-client-0.85.0 lib/sdr_client/deposit/file_metadata_builder_operations/mime_type.rb
sdr-client-0.84.0 lib/sdr_client/deposit/file_metadata_builder_operations/mime_type.rb
sdr-client-0.83.0 lib/sdr_client/deposit/file_metadata_builder_operations/mime_type.rb
sdr-client-0.82.0 lib/sdr_client/deposit/file_metadata_builder_operations/mime_type.rb
sdr-client-0.81.0 lib/sdr_client/deposit/file_metadata_builder_operations/mime_type.rb
sdr-client-0.80.0 lib/sdr_client/deposit/file_metadata_builder_operations/mime_type.rb
sdr-client-0.79.0 lib/sdr_client/deposit/file_metadata_builder_operations/mime_type.rb
sdr-client-0.78.0 lib/sdr_client/deposit/file_metadata_builder_operations/mime_type.rb