Class: File
- Inherits:
-
Object
- Object
- File
- Defined in:
- lib/common/hacks.rb
Class Method Summary (collapse)
-
+ (String) charset(file_path)
The charset of the file.
Class Method Details
+ (String) charset(file_path)
The charset of the file
78 79 80 |
# File 'lib/common/hacks.rb', line 78 def self.charset(file_path) %x{file --mime #{file_path}}[%r{charset=([^\n]+)\n}, 1] end |