mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
[core] more useful structure for Fog.providers
This commit is contained in:
parent
951ba8c380
commit
70e7ea133b
2 changed files with 4 additions and 3 deletions
|
@ -4,7 +4,7 @@ module Fog
|
|||
class << self
|
||||
|
||||
def available_providers
|
||||
@available_providers ||= @providers.select {|provider| Kernel.const_get(provider).available?}.sort
|
||||
@available_providers ||= Fog.providers.values.select {|provider| Kernel.const_get(provider).available?}.sort
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
module Fog
|
||||
|
||||
def self.providers
|
||||
@providers ||= []
|
||||
@providers ||= {}
|
||||
end
|
||||
|
||||
def self.providers=(new_providers)
|
||||
|
@ -11,7 +11,8 @@ module Fog
|
|||
module Provider
|
||||
|
||||
def self.extended(base)
|
||||
Fog.providers |= [base.to_s.split('::').last]
|
||||
provider = base.to_s.split('::').last
|
||||
Fog.providers[provider.downcase.to_sym] = provider
|
||||
end
|
||||
|
||||
def [](service_key)
|
||||
|
|
Loading…
Add table
Reference in a new issue