Sha256: de5722be2467514163dceb8e25c46838c06d1c0e66f4a4ead714050036b8190f

Contents?: true

Size: 713 Bytes

Versions: 2

Compression:

Stored size: 713 Bytes

Contents

module Yodel
  def self.db
    @db ||= Mongo::Connection.new(Yodel.config.database_hostname, Yodel.config.database_port).db(Yodel.config.database)
  end
  
  def self.extensions
    @extensions ||= {}
  end
  
  def self.load_extensions
    if Yodel.config.extensions_folder
      Dir[File.join(Yodel.config.extensions_folder, '/*')].each do |path|
        next unless File.directory?(path) && File.basename(path).start_with?('yodel_')
        extension = FolderExtension.new(path)
        extension.load!
      end
    else
      Gem::Specification.find_all do |gem|
        next unless gem.name.start_with?('yodel_')
        extension = GemExtension.new(gem)
        extension.load!
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
yodel-0.0.2 lib/yodel/application/yodel.rb
yodel-0.0.1 lib/yodel/application/yodel.rb