Class: Middleman::Svg::AssetFile
- Inherits:
-
Object
- Object
- Middleman::Svg::AssetFile
- Defined in:
- lib/middleman-svg/asset_file.rb
Defined Under Namespace
Classes: FileNotFound
Constant Summary collapse
- UNREADABLE_PATH =
''
Class Method Summary collapse
Class Method Details
.named(filename) ⇒ Object
7 8 9 10 11 12 13 |
# File 'lib/middleman-svg/asset_file.rb', line 7 def self.named(filename) root = Middleman::Application.root source_path = File.join(root, 'source') File.read(File.join(source_path, 'images', source) || File.join(source_path, 'fonts/svg', source) || UNREADABLE_PATH) rescue Errno::ENOENT raise FileNotFound.new("Asset not found: #{asset_path}") end |