1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

manipulate load path instead of doing relative paths

This commit is contained in:
Wesley Beary 2009-09-13 21:24:22 -07:00
parent d7aab6fe2a
commit e3643af5a0
7 changed files with 121 additions and 126 deletions

View file

@ -1,3 +1,9 @@
__DIR__ = File.dirname(__FILE__)
$LOAD_PATH.unshift __DIR__ unless
$LOAD_PATH.include?(__DIR__) ||
$LOAD_PATH.include?(File.expand_path(__DIR__))
module Fog
def self.mocking=(new_mocking)
@ -13,7 +19,7 @@ module Fog
end
def self.reload
load "#{File.dirname(__FILE__)}/fog/aws.rb"
load "fog/aws.rb"
end
end

View file

@ -10,10 +10,9 @@ module Fog
module AWS
def self.reload
current_directory = File.dirname(__FILE__)
load "#{current_directory}/aws/ec2.rb"
load "#{current_directory}/aws/simpledb.rb"
load "#{current_directory}/aws/s3.rb"
load "fog/aws/ec2.rb"
load "fog/aws/simpledb.rb"
load "fog/aws/s3.rb"
end
if Fog.mocking?

View file

@ -20,75 +20,72 @@ module Fog
end
def self.reload
current_directory = File.dirname(__FILE__)
load "#{current_directory}/../connection.rb"
load "#{current_directory}/../parser.rb"
load "#{current_directory}/../response.rb"
load "fog/connection.rb"
load "fog/parser.rb"
load "fog/response.rb"
parsers_directory = "#{current_directory}/parsers/ec2"
load "#{parsers_directory}/allocate_address.rb"
load "#{parsers_directory}/attach_volume.rb"
load "#{parsers_directory}/basic.rb"
load "#{parsers_directory}/create_key_pair.rb"
load "#{parsers_directory}/create_snapshot.rb"
load "#{parsers_directory}/create_volume.rb"
load "#{parsers_directory}/describe_addresses.rb"
load "#{parsers_directory}/describe_availability_zones.rb"
load "#{parsers_directory}/describe_images.rb"
load "#{parsers_directory}/describe_instances.rb"
load "#{parsers_directory}/describe_key_pairs.rb"
load "#{parsers_directory}/describe_regions.rb"
load "#{parsers_directory}/describe_security_groups.rb"
load "#{parsers_directory}/describe_snapshots.rb"
load "#{parsers_directory}/describe_volumes.rb"
load "#{parsers_directory}/detach_volume.rb"
load "#{parsers_directory}/get_console_output.rb"
load "#{parsers_directory}/run_instances.rb"
load "#{parsers_directory}/terminate_instances.rb"
load "fog/aws/parsers/ec2/allocate_address.rb"
load "fog/aws/parsers/ec2/attach_volume.rb"
load "fog/aws/parsers/ec2/basic.rb"
load "fog/aws/parsers/ec2/create_key_pair.rb"
load "fog/aws/parsers/ec2/create_snapshot.rb"
load "fog/aws/parsers/ec2/create_volume.rb"
load "fog/aws/parsers/ec2/describe_addresses.rb"
load "fog/aws/parsers/ec2/describe_availability_zones.rb"
load "fog/aws/parsers/ec2/describe_images.rb"
load "fog/aws/parsers/ec2/describe_instances.rb"
load "fog/aws/parsers/ec2/describe_key_pairs.rb"
load "fog/aws/parsers/ec2/describe_regions.rb"
load "fog/aws/parsers/ec2/describe_security_groups.rb"
load "fog/aws/parsers/ec2/describe_snapshots.rb"
load "fog/aws/parsers/ec2/describe_volumes.rb"
load "fog/aws/parsers/ec2/detach_volume.rb"
load "fog/aws/parsers/ec2/get_console_output.rb"
load "fog/aws/parsers/ec2/run_instances.rb"
load "fog/aws/parsers/ec2/terminate_instances.rb"
requests_directory = "#{current_directory}/requests/ec2"
load "#{requests_directory}/allocate_address.rb"
load "#{requests_directory}/associate_address.rb"
load "#{requests_directory}/attach_volume.rb"
load "#{requests_directory}/authorize_security_group_ingress.rb"
# TODO: require "#{requests_directory}/bundle_instance.rb"
# TODO: require "#{requests_directory}/cancel_bundle_task.rb"
# TODO: require "#{requests_directory}/confirm_product_instance.rb"
load "#{requests_directory}/create_key_pair.rb"
load "#{requests_directory}/create_security_group.rb"
load "#{requests_directory}/create_snapshot.rb"
load "#{requests_directory}/create_volume.rb"
load "#{requests_directory}/delete_key_pair.rb"
load "#{requests_directory}/delete_security_group.rb"
load "#{requests_directory}/delete_snapshot.rb"
load "#{requests_directory}/delete_volume.rb"
# TODO: require "#{requests_directory}/deregister_image.rb"
load "#{requests_directory}/describe_addresses.rb"
load "#{requests_directory}/describe_availability_zones.rb"
# TODO: require "#{requests_directory}/describe_bundle_tasks.rb"
# TODO: require "#{requests_directory}/describe_image_attribute.rb"
load "#{requests_directory}/describe_images.rb"
load "#{requests_directory}/describe_instances.rb"
load "#{requests_directory}/describe_key_pairs.rb"
load "#{requests_directory}/describe_regions.rb"
# TODO: require "#{requests_directory}/describe_reserved_instances.rb"
# TODO: require "#{requests_directory}/describe_reserved_instances_offerings.rb"
load "#{requests_directory}/describe_security_groups.rb"
load "#{requests_directory}/describe_snapshots.rb"
load "#{requests_directory}/describe_volumes.rb"
load "#{requests_directory}/detach_volume.rb"
load "#{requests_directory}/disassociate_address.rb"
load "#{requests_directory}/get_console_output.rb"
# TODO: require "#{requests_directory}/modify_image_attribute.rb"
# TODO: require "#{requests_directory}/monitor_instances.rb"
# TODO: require "#{requests_directory}/purchase_reserved_instances_offering.rb"
load "#{requests_directory}/reboot_instances.rb"
# TODO: require "#{requests_directory}/register_image.rb"
load "#{requests_directory}/release_address.rb"
load "#{requests_directory}/revoke_security_group_ingress.rb"
load "#{requests_directory}/run_instances.rb"
load "#{requests_directory}/terminate_instances.rb"
# TODO: require "#{requests_directory}/unmonitor_instances.rb"
load "fog/aws/requests/ec2/allocate_address.rb"
load "fog/aws/requests/ec2/associate_address.rb"
load "fog/aws/requests/ec2/attach_volume.rb"
load "fog/aws/requests/ec2/authorize_security_group_ingress.rb"
# TODO: require "fog/aws/requests/ec2/bundle_instance.rb"
# TODO: require "fog/aws/requests/ec2/cancel_bundle_task.rb"
# TODO: require "fog/aws/requests/ec2/confirm_product_instance.rb"
load "fog/aws/requests/ec2/create_key_pair.rb"
load "fog/aws/requests/ec2/create_security_group.rb"
load "fog/aws/requests/ec2/create_snapshot.rb"
load "fog/aws/requests/ec2/create_volume.rb"
load "fog/aws/requests/ec2/delete_key_pair.rb"
load "fog/aws/requests/ec2/delete_security_group.rb"
load "fog/aws/requests/ec2/delete_snapshot.rb"
load "fog/aws/requests/ec2/delete_volume.rb"
# TODO: require "fog/aws/requests/ec2/deregister_image.rb"
load "fog/aws/requests/ec2/describe_addresses.rb"
load "fog/aws/requests/ec2/describe_availability_zones.rb"
# TODO: require "fog/aws/requests/ec2/describe_bundle_tasks.rb"
# TODO: require "fog/aws/requests/ec2/describe_image_attribute.rb"
load "fog/aws/requests/ec2/describe_images.rb"
load "fog/aws/requests/ec2/describe_instances.rb"
load "fog/aws/requests/ec2/describe_key_pairs.rb"
load "fog/aws/requests/ec2/describe_regions.rb"
# TODO: require "fog/aws/requests/ec2/describe_reserved_instances.rb"
# TODO: require "fog/aws/requests/ec2/describe_reserved_instances_offerings.rb"
load "fog/aws/requests/ec2/describe_security_groups.rb"
load "fog/aws/requests/ec2/describe_snapshots.rb"
load "fog/aws/requests/ec2/describe_volumes.rb"
load "fog/aws/requests/ec2/detach_volume.rb"
load "fog/aws/requests/ec2/disassociate_address.rb"
load "fog/aws/requests/ec2/get_console_output.rb"
# TODO: require "fog/aws/requests/ec2/modify_image_attribute.rb"
# TODO: require "fog/aws/requests/ec2/monitor_instances.rb"
# TODO: require "fog/aws/requests/ec2/purchase_reserved_instances_offering.rb"
load "fog/aws/requests/ec2/reboot_instances.rb"
# TODO: require "fog/aws/requests/ec2/register_image.rb"
load "fog/aws/requests/ec2/release_address.rb"
load "fog/aws/requests/ec2/revoke_security_group_ingress.rb"
load "fog/aws/requests/ec2/run_instances.rb"
load "fog/aws/requests/ec2/terminate_instances.rb"
# TODO: require "fog/aws/requests/ec2/unmonitor_instances.rb"
if Fog.mocking?
reset_data

View file

@ -12,40 +12,36 @@ module Fog
end
def self.reload
current_directory = File.dirname(__FILE__)
load "#{current_directory}/../collection.rb"
load "#{current_directory}/../connection.rb"
load "#{current_directory}/../model.rb"
load "#{current_directory}/../parser.rb"
load "#{current_directory}/../response.rb"
load "fog/collection.rb"
load "fog/connection.rb"
load "fog/model.rb"
load "fog/parser.rb"
load "fog/response.rb"
models_directory = "#{current_directory}/models/s3"
load "#{models_directory}/bucket.rb"
load "#{models_directory}/buckets.rb"
load "#{models_directory}/object.rb"
load "#{models_directory}/objects.rb"
load "#{models_directory}/owner.rb"
load "fog/aws/models/s3/bucket.rb"
load "fog/aws/models/s3/buckets.rb"
load "fog/aws/models/s3/object.rb"
load "fog/aws/models/s3/objects.rb"
load "fog/aws/models/s3/owner.rb"
parsers_directory = "#{current_directory}/parsers/s3"
load "#{parsers_directory}/copy_object.rb"
load "#{parsers_directory}/get_bucket.rb"
load "#{parsers_directory}/get_bucket_location.rb"
load "#{parsers_directory}/get_request_payment.rb"
load "#{parsers_directory}/get_service.rb"
load "fog/aws/parsers/s3/copy_object.rb"
load "fog/aws/parsers/s3/get_bucket.rb"
load "fog/aws/parsers/s3/get_bucket_location.rb"
load "fog/aws/parsers/s3/get_request_payment.rb"
load "fog/aws/parsers/s3/get_service.rb"
requests_directory = "#{current_directory}/requests/s3"
load "#{requests_directory}/copy_object.rb"
load "#{requests_directory}/delete_bucket.rb"
load "#{requests_directory}/delete_object.rb"
load "#{requests_directory}/get_bucket.rb"
load "#{requests_directory}/get_bucket_location.rb"
load "#{requests_directory}/get_object.rb"
load "#{requests_directory}/get_request_payment.rb"
load "#{requests_directory}/get_service.rb"
load "#{requests_directory}/head_object.rb"
load "#{requests_directory}/put_bucket.rb"
load "#{requests_directory}/put_object.rb"
load "#{requests_directory}/put_request_payment.rb"
load "fog/aws/requests/s3/copy_object.rb"
load "fog/aws/requests/s3/delete_bucket.rb"
load "fog/aws/requests/s3/delete_object.rb"
load "fog/aws/requests/s3/get_bucket.rb"
load "fog/aws/requests/s3/get_bucket_location.rb"
load "fog/aws/requests/s3/get_object.rb"
load "fog/aws/requests/s3/get_request_payment.rb"
load "fog/aws/requests/s3/get_service.rb"
load "fog/aws/requests/s3/head_object.rb"
load "fog/aws/requests/s3/put_bucket.rb"
load "fog/aws/requests/s3/put_object.rb"
load "fog/aws/requests/s3/put_request_payment.rb"
if Fog.mocking?
reset_data

View file

@ -12,28 +12,25 @@ module Fog
end
def self.reload
current_directory = File.dirname(__FILE__)
load "#{current_directory}/../connection.rb"
load "#{current_directory}/../parser.rb"
load "#{current_directory}/../response.rb"
load "fog/connection.rb"
load "fog/parser.rb"
load "fog/response.rb"
parsers_directory = "#{current_directory}/parsers/simpledb"
load "#{parsers_directory}/basic.rb"
load "#{parsers_directory}/domain_metadata.rb"
load "#{parsers_directory}/get_attributes.rb"
load "#{parsers_directory}/list_domains.rb"
load "#{parsers_directory}/select.rb"
load "fog/aws/parsers/simpledb/basic.rb"
load "fog/aws/parsers/simpledb/domain_metadata.rb"
load "fog/aws/parsers/simpledb/get_attributes.rb"
load "fog/aws/parsers/simpledb/list_domains.rb"
load "fog/aws/parsers/simpledb/select.rb"
requests_directory = "#{current_directory}/requests/simpledb"
load "#{requests_directory}/batch_put_attributes.rb"
load "#{requests_directory}/create_domain.rb"
load "#{requests_directory}/delete_attributes.rb"
load "#{requests_directory}/delete_domain.rb"
load "#{requests_directory}/domain_metadata.rb"
load "#{requests_directory}/get_attributes.rb"
load "#{requests_directory}/list_domains.rb"
load "#{requests_directory}/put_attributes.rb"
load "#{requests_directory}/select.rb"
load "fog/aws/requests/simpledb/batch_put_attributes.rb"
load "fog/aws/requests/simpledb/create_domain.rb"
load "fog/aws/requests/simpledb/delete_attributes.rb"
load "fog/aws/requests/simpledb/delete_domain.rb"
load "fog/aws/requests/simpledb/domain_metadata.rb"
load "fog/aws/requests/simpledb/get_attributes.rb"
load "fog/aws/requests/simpledb/list_domains.rb"
load "fog/aws/requests/simpledb/put_attributes.rb"
load "fog/aws/requests/simpledb/select.rb"
if Fog.mocking?
reset_data

View file

@ -3,8 +3,8 @@ require 'openssl'
require 'socket'
require 'uri'
require "#{File.dirname(__FILE__)}/errors"
require "#{File.dirname(__FILE__)}/response"
require "fog/errors"
require "fog/response"
unless Fog.mocking?

View file

@ -1,4 +1,4 @@
require "#{File.dirname(__FILE__)}/parser"
require "fog/parser"
module Fog
module Errors