$: << File.expand_path(File.join(File.dirname(__FILE__), "../lib")) module MemeMe class << self def images images = {} Dir.glob("#{File.join(File.expand_path(File.dirname(__FILE__)), 'mememe', 'images')}/*").each { |i| images[File.basename(i).gsub(/\.\w+$/, '').to_sym] = i } images end def fonts fonts = {} Dir.glob("#{File.join(File.join(File.dirname(__FILE__)), 'mememe', 'fonts')}/*").each { |f| fonts[File.basename(f).gsub(/\.\w+$/, '').to_sym] = f } fonts end def memes memes = {} Dir.glob("#{File.join(File.join(File.dirname(__FILE__)), 'mememe', 'memes')}/*").each { |f| memes[File.basename(f).gsub(/\.\w+$/, '').to_sym] = f } memes end def install(name, constructor) @installed_memes ||= {} @installed_memes[name] = constructor end def installed_memes @installed_memes ||= {} end def require_memes memes.each_pair { |n, m| require m } end end end