class Libnotify::IconFinder

Public Class Methods

new(dirs) click to toggle source
# File lib/libnotify/icon_finder.rb, line 3
def initialize(dirs)
  @dirs = dirs
end

Public Instance Methods

icon_path(name) click to toggle source
# File lib/libnotify/icon_finder.rb, line 7
def icon_path(name)
  list = @dirs.map do |dir|
    glob = File.join(dir, name)
    Dir[glob].map { |fullpath| Icon.new(fullpath) }
  end
  if found = list.flatten.sort.first
    found.to_s
  end
end