module WarpEngine::FileIcon
Emoji icons for the file browser of the admin, chosen by file extension.
Constants
- BY_EXTENSION
-
Icon per group of lower-case extensions (with the leading dot): images, audio, video, archives, PDF, documents, spreadsheets, web files, source code, cartridges and disk images, and executables.
- DEFAULT
-
Icon of a file whose extension is in no group.
- DIRECTORY
-
Icon of a folder.
Public Class Methods
Source
# File app/presenters/warp_engine/file_icon.rb, line 28 def self.for(name) ext = File.extname(name.to_s).downcase BY_EXTENSION.each { |extensions, icon| return icon if extensions.include?(ext) } DEFAULT end
Returns the icon for the file name by its extension (case does not matter), or DEFAULT.