Sha256: fea15417c787dcf196f882ae9bdab8dfbe5a718b99c627e24af000e83c2d80da

Contents?: true

Size: 995 Bytes

Versions: 3

Compression:

Stored size: 995 Bytes

Contents

$: << 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

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
mememe-0.1.2 lib/mememe.rb
mememe-0.1.1 lib/mememe.rb
mememe-0.1.0 lib/mememe.rb