Sha256: 32fc3a9cbbcd6305b8e63d4284226fb8cac87da22581f5133c0afff3eca093f0

Contents?: true

Size: 416 Bytes

Versions: 25

Compression:

Stored size: 416 Bytes

Contents

module ActiveAssets
  module ActiveExpansions
    module TypeInferrable
      def inferred_type(file_path, allowed_extensions = Asset::VALID_TYPES)
        file_ext = File.extname(file_path)
        return [nil, nil] unless file_ext.present? && (3..5).include?(file_ext.size)
        file_ext = file_ext[1..-1].to_sym
        [allowed_extensions.include?(file_ext) && file_ext, file_ext]
      end
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
active_assets-0.2.0.rc4 lib/active_assets/active_expansions/type_inferrable.rb
active_assets-0.2.0.rc3 lib/active_assets/active_expansions/type_inferrable.rb
active_assets-0.2.0.rc2 lib/active_assets/active_expansions/type_inferrable.rb
active_assets-0.2.0.rc lib/active_assets/active_expansions/type_inferrable.rb
active_assets-0.1.0 lib/active_assets/active_expansions/type_inferrable.rb