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

Version Path
veewee-0.5.0.alpha4 lib/veewee/providers.rb
veewee-0.5.0.alpha3 lib/veewee/providers.rb
veewee-0.5.0.alpha2 lib/veewee/providers.rb
veewee-0.5.0.alpha1 lib/veewee/providers.rb
veewee-0.4.5.1 lib/veewee/providers.rb
veewee-0.4.5 lib/veewee/providers.rb
veewee-0.4.5.pre1 lib/veewee/providers.rb
veewee-0.4.4 lib/veewee/providers.rb
veewee-0.4.3 lib/veewee/providers.rb
veewee-0.4.2 lib/veewee/providers.rb
veewee-0.4.1 lib/veewee/providers.rb
veewee-0.4.0 lib/veewee/providers.rb
veewee-0.3.12 lib/veewee/providers.rb
veewee-0.3.11 lib/veewee/providers.rb
veewee-0.3.10 lib/veewee/providers.rb
veewee-0.3.9 lib/veewee/providers.rb
veewee-atlassian-0.3.11 lib/veewee/providers.rb
veewee-0.3.7 lib/veewee/providers.rb