module Extray
Extray
- extract file name extensions
Constants
- VERSION
Public Class Methods
extension(path)
click to toggle source
Extract file name extension
If no extension, returns empty string.
If nested extensions appear (e.g., … .tar.gz), only the last one is returned.
@path a file path (String)
# File lib/extray.rb, line 16 def self.extension(path) File.extname(path).sub '.', '' end