lib/fog/new_servers/bin.rb in fog-0.2.30 vs lib/fog/new_servers/bin.rb in fog-0.3.0

- old
+ new

@@ -1,30 +1,25 @@ -module NewServers +class NewServers < Fog::Bin class << self - if Fog.credentials[:new_servers_password] && Fog.credentials[:new_servers_username] - def initialized? - true - end - - def [](service) - @@connections ||= Hash.new do |hash, key| - credentials = Fog.credentials.reject do |k,v| - ![:new_servers_password, :new_servers_username].include?(k) - end - hash[key] = case key - when :new_servers - Fog::NewServers.new(credentials) - end + def [](service) + @@connections ||= Hash.new do |hash, key| + hash[key] = case key + when :compute + Fog::NewServers::Compute.new + when :new_servers + location = caller.first + warning = "[yellow][WARN] NewServers[:servers] is deprecated, use NewServers[:compute] instead[/]" + warning << " [light_black](" << location << ")[/] " + Formatador.display_line(warning) + Fog::NewServers::Compute.new end - @@connections[service] end + @@connections[service] + end - else - - def initialized? - false - end - + def services + [:compute] end + end end