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-1.1.3 lib/active_assets/active_expansions/type_inferrable.rb
active_assets-1.1.2 lib/active_assets/active_expansions/type_inferrable.rb
active_assets-1.1.1 lib/active_assets/active_expansions/type_inferrable.rb
active_assets-1.0.3 lib/active_assets/active_expansions/type_inferrable.rb
active_assets-1.1.0 lib/active_assets/active_expansions/type_inferrable.rb
active_assets-0.3.1 lib/active_assets/active_expansions/type_inferrable.rb
active_assets-1.0.2 lib/active_assets/active_expansions/type_inferrable.rb
active_assets-1.0.1 lib/active_assets/active_expansions/type_inferrable.rb
active_assets-1.0.0 lib/active_assets/active_expansions/type_inferrable.rb
active_assets-0.3.0 lib/active_assets/active_expansions/type_inferrable.rb
active_assets-1.0.0.rc1 lib/active_assets/active_expansions/type_inferrable.rb
active_assets-0.2.8 lib/active_assets/active_expansions/type_inferrable.rb
active_assets-0.2.7 lib/active_assets/active_expansions/type_inferrable.rb
active_assets-0.2.6 lib/active_assets/active_expansions/type_inferrable.rb
active_assets-0.2.5 lib/active_assets/active_expansions/type_inferrable.rb
active_assets-0.2.4 lib/active_assets/active_expansions/type_inferrable.rb
active_assets-0.2.3 lib/active_assets/active_expansions/type_inferrable.rb
active_assets-0.2.2 lib/active_assets/active_expansions/type_inferrable.rb
active_assets-0.2.1 lib/active_assets/active_expansions/type_inferrable.rb
active_assets-0.2.0 lib/active_assets/active_expansions/type_inferrable.rb