Module: Fog

Defined in:
lib/fog.rb,
lib/fog/aws.rb,
lib/fog/model.rb,
lib/fog/aws/s3.rb,
lib/fog/parser.rb,
lib/fog/aws/ec2.rb,
lib/fog/rackspace.rb,
lib/fog/slicehost.rb,
lib/fog/connection.rb,
lib/fog/connection.rb,
lib/fog/collection.rb,
lib/fog/aws/simpledb.rb,
lib/fog/rackspace/files.rb,
lib/fog/rackspace/servers.rb,
lib/fog/aws/models/s3/object.rb,
lib/fog/aws/models/s3/bucket.rb,
lib/fog/aws/models/s3/objects.rb,
lib/fog/aws/models/s3/buckets.rb,
lib/fog/aws/models/ec2/volume.rb,
lib/fog/aws/parsers/ec2/basic.rb,
lib/fog/aws/models/ec2/address.rb,
lib/fog/aws/models/ec2/volumes.rb,
lib/fog/aws/models/ec2/snapshot.rb,
lib/fog/aws/models/ec2/instance.rb,
lib/fog/aws/models/ec2/key_pair.rb,
lib/fog/aws/models/ec2/instances.rb,
lib/fog/aws/models/ec2/snapshots.rb,
lib/fog/aws/models/ec2/addresses.rb,
lib/fog/aws/models/ec2/key_pairs.rb,
lib/fog/aws/parsers/s3/get_bucket.rb,
lib/fog/aws/requests/s3/put_bucket.rb,
lib/fog/aws/requests/s3/put_bucket.rb,
lib/fog/aws/parsers/s3/get_service.rb,
lib/fog/aws/parsers/simpledb/basic.rb,
lib/fog/aws/requests/s3/get_object.rb,
lib/fog/aws/requests/s3/get_object.rb,
lib/fog/aws/requests/s3/put_object.rb,
lib/fog/aws/requests/s3/put_object.rb,
lib/fog/aws/requests/s3/get_bucket.rb,
lib/fog/aws/requests/s3/get_bucket.rb,
lib/fog/aws/parsers/s3/copy_object.rb,
lib/fog/aws/requests/s3/copy_object.rb,
lib/fog/aws/requests/s3/copy_object.rb,
lib/fog/aws/requests/s3/get_service.rb,
lib/fog/aws/requests/s3/get_service.rb,
lib/fog/aws/requests/s3/head_object.rb,
lib/fog/aws/requests/s3/head_object.rb,
lib/fog/aws/parsers/simpledb/select.rb,
lib/fog/slicehost/parsers/get_slices.rb,
lib/fog/aws/requests/simpledb/select.rb,
lib/fog/slicehost/parsers/get_images.rb,
lib/fog/aws/parsers/ec2/create_volume.rb,
lib/fog/aws/parsers/ec2/attach_volume.rb,
lib/fog/slicehost/parsers/get_flavors.rb,
lib/fog/slicehost/requests/get_images.rb,
lib/fog/slicehost/requests/get_images.rb,
lib/fog/slicehost/requests/get_slices.rb,
lib/fog/slicehost/requests/get_slices.rb,
lib/fog/aws/parsers/ec2/detach_volume.rb,
lib/fog/slicehost/parsers/get_backups.rb,
lib/fog/aws/requests/s3/delete_object.rb,
lib/fog/aws/requests/s3/delete_object.rb,
lib/fog/aws/models/ec2/security_group.rb,
lib/fog/aws/requests/s3/delete_bucket.rb,
lib/fog/aws/requests/s3/delete_bucket.rb,
lib/fog/aws/parsers/ec2/run_instances.rb,
lib/fog/aws/requests/ec2/delete_volume.rb,
lib/fog/aws/requests/ec2/delete_volume.rb,
lib/fog/aws/models/ec2/security_groups.rb,
lib/fog/slicehost/parsers/create_slice.rb,
lib/fog/aws/requests/ec2/attach_volume.rb,
lib/fog/aws/requests/ec2/attach_volume.rb,
lib/fog/aws/requests/ec2/create_volume.rb,
lib/fog/aws/requests/ec2/create_volume.rb,
lib/fog/aws/requests/ec2/detach_volume.rb,
lib/fog/aws/requests/ec2/detach_volume.rb,
lib/fog/slicehost/requests/get_backups.rb,
lib/fog/slicehost/requests/get_backups.rb,
lib/fog/rackspace/models/servers/image.rb,
lib/fog/aws/requests/ec2/run_instances.rb,
lib/fog/aws/requests/ec2/run_instances.rb,
lib/fog/slicehost/requests/get_flavors.rb,
lib/fog/slicehost/requests/get_flavors.rb,
lib/fog/rackspace/models/servers/images.rb,
lib/fog/rackspace/models/servers/server.rb,
lib/fog/slicehost/requests/create_slice.rb,
lib/fog/slicehost/requests/create_slice.rb,
lib/fog/slicehost/requests/delete_slice.rb,
lib/fog/slicehost/requests/delete_slice.rb,
lib/fog/aws/parsers/ec2/create_snapshot.rb,
lib/fog/rackspace/models/servers/flavor.rb,
lib/fog/aws/parsers/ec2/describe_images.rb,
lib/fog/aws/parsers/ec2/create_key_pair.rb,
lib/fog/rackspace/models/servers/servers.rb,
lib/fog/aws/parsers/ec2/describe_volumes.rb,
lib/fog/aws/parsers/ec2/allocate_address.rb,
lib/fog/rackspace/models/servers/flavors.rb,
lib/fog/aws/parsers/ec2/describe_regions.rb,
lib/fog/aws/requests/ec2/create_snapshot.rb,
lib/fog/aws/requests/ec2/create_snapshot.rb,
lib/fog/aws/requests/ec2/delete_key_pair.rb,
lib/fog/aws/requests/ec2/delete_key_pair.rb,
lib/fog/aws/requests/ec2/release_address.rb,
lib/fog/aws/requests/ec2/release_address.rb,
lib/fog/aws/requests/ec2/delete_snapshot.rb,
lib/fog/aws/requests/ec2/delete_snapshot.rb,
lib/fog/aws/requests/ec2/create_key_pair.rb,
lib/fog/aws/requests/ec2/create_key_pair.rb,
lib/fog/aws/requests/ec2/describe_images.rb,
lib/fog/aws/requests/ec2/describe_images.rb,
lib/fog/aws/requests/ec2/reboot_instances.rb,
lib/fog/aws/requests/ec2/reboot_instances.rb,
lib/fog/aws/requests/ec2/describe_regions.rb,
lib/fog/aws/requests/ec2/describe_regions.rb,
lib/fog/aws/parsers/simpledb/list_domains.rb,
lib/fog/aws/requests/ec2/describe_volumes.rb,
lib/fog/aws/requests/ec2/describe_volumes.rb,
lib/fog/aws/requests/ec2/allocate_address.rb,
lib/fog/aws/requests/ec2/allocate_address.rb,
lib/fog/aws/parsers/ec2/get_console_output.rb,
lib/fog/aws/requests/simpledb/list_domains.rb,
lib/fog/aws/requests/simpledb/list_domains.rb,
lib/fog/aws/parsers/ec2/describe_addresses.rb,
lib/fog/aws/parsers/ec2/describe_instances.rb,
lib/fog/aws/parsers/s3/get_bucket_location.rb,
lib/fog/aws/parsers/s3/get_request_payment.rb,
lib/fog/aws/requests/ec2/associate_address.rb,
lib/fog/aws/requests/ec2/associate_address.rb,
lib/fog/aws/parsers/ec2/describe_key_pairs.rb,
lib/fog/aws/parsers/ec2/describe_snapshots.rb,
lib/fog/aws/requests/s3/get_request_payment.rb,
lib/fog/aws/requests/s3/get_request_payment.rb,
lib/fog/aws/requests/s3/get_bucket_location.rb,
lib/fog/aws/requests/s3/get_bucket_location.rb,
lib/fog/aws/requests/s3/put_request_payment.rb,
lib/fog/aws/requests/s3/put_request_payment.rb,
lib/fog/aws/requests/ec2/describe_key_pairs.rb,
lib/fog/aws/requests/ec2/describe_key_pairs.rb,
lib/fog/rackspace/requests/files/put_object.rb,
lib/fog/rackspace/requests/files/put_object.rb,
lib/fog/aws/requests/ec2/describe_snapshots.rb,
lib/fog/aws/requests/ec2/describe_snapshots.rb,
lib/fog/aws/parsers/ec2/terminate_instances.rb,
lib/fog/aws/requests/ec2/describe_instances.rb,
lib/fog/aws/requests/ec2/describe_instances.rb,
lib/fog/aws/parsers/simpledb/get_attributes.rb,
lib/fog/aws/requests/ec2/get_console_output.rb,
lib/fog/aws/requests/ec2/get_console_output.rb,
lib/fog/aws/requests/simpledb/delete_domain.rb,
lib/fog/aws/requests/simpledb/delete_domain.rb,
lib/fog/aws/requests/simpledb/create_domain.rb,
lib/fog/aws/requests/simpledb/create_domain.rb,
lib/fog/aws/requests/ec2/describe_addresses.rb,
lib/fog/aws/requests/ec2/describe_addresses.rb,
lib/fog/aws/requests/ec2/terminate_instances.rb,
lib/fog/aws/requests/ec2/terminate_instances.rb,
lib/fog/aws/requests/simpledb/put_attributes.rb,
lib/fog/aws/requests/simpledb/put_attributes.rb,
lib/fog/aws/requests/simpledb/get_attributes.rb,
lib/fog/aws/requests/simpledb/get_attributes.rb,
lib/fog/aws/parsers/simpledb/domain_metadata.rb,
lib/fog/aws/requests/simpledb/domain_metadata.rb,
lib/fog/aws/requests/simpledb/domain_metadata.rb,
lib/fog/aws/requests/ec2/disassociate_address.rb,
lib/fog/aws/requests/ec2/disassociate_address.rb,
lib/fog/rackspace/requests/files/put_container.rb,
lib/fog/rackspace/requests/files/put_container.rb,
lib/fog/rackspace/requests/servers/list_images.rb,
lib/fog/rackspace/requests/servers/list_images.rb,
lib/fog/aws/requests/ec2/create_security_group.rb,
lib/fog/aws/requests/ec2/create_security_group.rb,
lib/fog/rackspace/requests/files/get_container.rb,
lib/fog/rackspace/requests/files/get_container.rb,
lib/fog/aws/requests/ec2/delete_security_group.rb,
lib/fog/aws/requests/ec2/delete_security_group.rb,
lib/fog/rackspace/requests/files/delete_object.rb,
lib/fog/rackspace/requests/files/delete_object.rb,
lib/fog/rackspace/requests/files/get_containers.rb,
lib/fog/rackspace/requests/files/get_containers.rb,
lib/fog/rackspace/requests/servers/delete_image.rb,
lib/fog/rackspace/requests/servers/delete_image.rb,
lib/fog/rackspace/requests/servers/list_flavors.rb,
lib/fog/rackspace/requests/servers/list_flavors.rb,
lib/fog/rackspace/requests/servers/list_servers.rb,
lib/fog/rackspace/requests/servers/list_servers.rb,
lib/fog/rackspace/requests/files/head_container.rb,
lib/fog/rackspace/requests/files/head_container.rb,
lib/fog/aws/requests/simpledb/delete_attributes.rb,
lib/fog/aws/requests/simpledb/delete_attributes.rb,
lib/fog/rackspace/requests/servers/create_image.rb,
lib/fog/rackspace/requests/servers/create_image.rb,
lib/fog/rackspace/requests/servers/reboot_server.rb,
lib/fog/rackspace/requests/servers/reboot_server.rb,
lib/fog/rackspace/requests/servers/update_server.rb,
lib/fog/rackspace/requests/servers/update_server.rb,
lib/fog/rackspace/requests/servers/create_server.rb,
lib/fog/rackspace/requests/servers/create_server.rb,
lib/fog/rackspace/requests/servers/delete_server.rb,
lib/fog/rackspace/requests/servers/delete_server.rb,
lib/fog/rackspace/requests/files/head_containers.rb,
lib/fog/rackspace/requests/files/head_containers.rb,
lib/fog/aws/parsers/ec2/describe_security_groups.rb,
lib/fog/rackspace/requests/files/delete_container.rb,
lib/fog/rackspace/requests/files/delete_container.rb,
lib/fog/aws/requests/ec2/describe_security_groups.rb,
lib/fog/aws/requests/ec2/describe_security_groups.rb,
lib/fog/rackspace/requests/servers/list_addresses.rb,
lib/fog/rackspace/requests/servers/list_addresses.rb,
lib/fog/aws/requests/simpledb/batch_put_attributes.rb,
lib/fog/aws/requests/simpledb/batch_put_attributes.rb,
lib/fog/aws/parsers/ec2/describe_availability_zones.rb,
lib/fog/aws/requests/ec2/describe_availability_zones.rb,
lib/fog/aws/requests/ec2/describe_availability_zones.rb,
lib/fog/rackspace/requests/servers/list_images_detail.rb,
lib/fog/rackspace/requests/servers/list_images_detail.rb,
lib/fog/rackspace/requests/servers/get_server_details.rb,
lib/fog/rackspace/requests/servers/get_server_details.rb,
lib/fog/rackspace/requests/servers/get_flavor_details.rb,
lib/fog/rackspace/requests/servers/get_flavor_details.rb,
lib/fog/aws/requests/ec2/revoke_security_group_ingress.rb,
lib/fog/aws/requests/ec2/revoke_security_group_ingress.rb,
lib/fog/rackspace/requests/servers/list_servers_detail.rb,
lib/fog/rackspace/requests/servers/list_servers_detail.rb,
lib/fog/rackspace/requests/servers/list_flavors_detail.rb,
lib/fog/rackspace/requests/servers/list_flavors_detail.rb,
lib/fog/rackspace/requests/servers/list_public_addresses.rb,
lib/fog/rackspace/requests/servers/list_public_addresses.rb,
lib/fog/aws/requests/ec2/authorize_security_group_ingress.rb,
lib/fog/aws/requests/ec2/authorize_security_group_ingress.rb,
lib/fog/rackspace/requests/servers/list_private_addresses.rb,
lib/fog/rackspace/requests/servers/list_private_addresses.rb

Defined Under Namespace

Modules: AWS, Parsers, Rackspace Classes: Collection, Connection, Model, Slicehost

Class Method Summary collapse

Class Method Details

.credentials(key = :default) ⇒ Object


41
42
43
44
45
46
47
48
49
# File 'lib/fog.rb', line 41

def self.credentials(key = :default)
  @credentials ||= begin
    credentials = {}
    File.open(File.expand_path('~/.fog')) do |file|
      credentials = YAML.load(file.read)[key]
    end
    credentials
  end
end

.mock!Object


21
22
23
24
# File 'lib/fog.rb', line 21

def self.mock!
  @mocking = true
  self.reload
end

.mocking?Boolean


26
27
28
# File 'lib/fog.rb', line 26

def self.mocking?
  !!@mocking
end

.reloadObject


30
31
32
33
34
35
36
37
38
39
# File 'lib/fog.rb', line 30

def self.reload
  load "fog/collection.rb"
  load "fog/connection.rb"
  load "fog/model.rb"
  load "fog/parser.rb"

  load "fog/aws.rb"
  load "fog/rackspace.rb"
  load "fog/slicehost.rb"
end