/usr/lib/ruby/vendor_ruby/fog/core/provider.rb is in ruby-fog-core 1.45.0-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | module Fog
class << self
attr_writer :providers
end
def self.providers
@providers ||= {}
end
module Provider
def self.extended(base)
provider = base.to_s.split("::").last
Fog.providers[provider.downcase.to_sym] = provider
end
def [](service_key)
eval(@services_registry[service_key]).new
end
def service(new_service, constant_string)
Fog.services[new_service] ||= []
Fog.services[new_service] |= [to_s.split("::").last.downcase.to_sym]
@services_registry ||= {}
@services_registry[new_service] = [to_s, constant_string].join("::")
end
def services
@services_registry.keys
end
end
end
|