Sha256: b31bcd280425443e1a1922edca2202acb09fa510036c21748a77c93ded202884
Contents?: true
Size: 779 Bytes
Versions: 18
Compression:
Stored size: 779 Bytes
Contents
module Veewee class Providers def initialize(env, options = {}) @env = env @options = options @providers = Hash.new end def [](name) return @providers[name] if @providers.has_key?(name) begin require_path = 'veewee/provider/' + name.to_s.downcase + "/provider" require require_path provider = Object.const_get("Veewee").const_get("Provider").const_get(name.to_s.capitalize).const_get("Provider").new(name, @options, @env) @providers[name] = provider rescue ::Veewee::Error => e raise rescue Error => e env.ui.error "Error loading provider with #{name}, #{$!}", :prefix => false end end def length @providers.length end end end #Module Veewee
Version data entries
18 entries across 18 versions & 2 rubygems