Sha256: f5cb8026bb0fcf6580b964e50a775b13c5ef8430fc12d7f9d127adf9a6303e3f

Contents?: true

Size: 814 Bytes

Versions: 11

Compression:

Stored size: 814 Bytes

Contents

module Veewee

    class Providers
      def initialize(env)
        @env=env
        @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,{},@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

11 entries across 11 versions & 1 rubygems

Version Path
veewee-0.3.6 lib/veewee/providers.rb
veewee-0.3.5 lib/veewee/providers.rb
veewee-0.3.4 lib/veewee/providers.rb
veewee-0.3.3 lib/veewee/providers.rb
veewee-0.3.2 lib/veewee/providers.rb
veewee-0.3.1 lib/veewee/providers.rb
veewee-0.3.0.beta2 lib/veewee/providers.rb
veewee-0.3.0.beta1 lib/veewee/providers.rb
veewee-0.3.0.alpha9 lib/veewee/providers.rb
veewee-0.3.0.alpha8 lib/veewee/providers.rb
veewee-0.3.0.alpha7 lib/veewee/providers.rb