Sha256: 4edcbb6d8b0a929bf5c8f9f3fac07247a1033ce9a6dbce0914dfc99691de6c0c

Contents?: true

Size: 346 Bytes

Versions: 7

Compression:

Stored size: 346 Bytes

Contents

module SharingTags
  class AssetFile
    class FileNotFound < IOError; end
    UNREADABLE_PATH = ''

    def self.named(filename)
      asset_path = FindsAssetPaths.by_filename(filename)
      File.read(asset_path || UNREADABLE_PATH)
    rescue Errno::ENOENT => e
      raise FileNotFound, "Asset not found: #{asset_path}: #{e}"
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
sharing_tags-0.0.18 lib/sharing_tags/asset_file.rb
sharing_tags-0.0.17 lib/sharing_tags/asset_file.rb
sharing_tags-0.0.16 lib/sharing_tags/asset_file.rb
sharing_tags-0.0.15 lib/sharing_tags/asset_file.rb
sharing_tags-0.0.14 lib/sharing_tags/asset_file.rb
sharing_tags-0.0.13 lib/sharing_tags/asset_file.rb
sharing_tags-0.0.12 lib/sharing_tags/asset_file.rb