Permalink
Browse files

Use `autoload` to load Identity modules

  • Loading branch information...
1 parent 615266f commit 059500676b08385fe4878ed26f6db0210afe661e @jherdman committed Jun 7, 2012
Showing with 3 additions and 2 deletions.
  1. +3 −2 lib/fog/identity.rb
View
@@ -1,6 +1,8 @@
module Fog
module Identity
+ autoload :OpenStack, 'fog/openstack/identity'
+
def self.[](provider)
self.new(:provider => provider)
end
@@ -9,8 +11,7 @@ def self.new(attributes)
attributes = attributes.dup # Prevent delete from having side effects
case provider = attributes.delete(:provider).to_s.downcase.to_sym
when :openstack
- require 'fog/openstack/identity'
- Fog::Identity::OpenStack.new(attributes)
+ OpenStack.new(attributes)
else
raise ArgumentError.new("#{provider} has no identity service")
end

0 comments on commit 0595006

Please sign in to comment.