Sha256: 4ce2260660a92c64c6c6baea023932a30ae62a40c31b562d155656ba5ce5e67c
Contents?: true
Size: 642 Bytes
Versions: 18
Compression:
Stored size: 642 Bytes
Contents
module Saviour class SourceFilenameExtractor def initialize(source) @source = source end def detected_filename original_filename || filename || path_filename end def filename value = @source.filename if @source.respond_to?(:filename) value if !value.nil? && value != '' end def original_filename value = @source.original_filename if @source.respond_to?(:original_filename) value if !value.nil? && value != '' end def path_filename value = @source.path if @source.respond_to?(:path) ::File.basename(value) if !value.nil? && value != '' end end end
Version data entries
18 entries across 18 versions & 1 rubygems