2009-10-21 17:49:17 -04:00
|
|
|
require 'rubygems'
|
|
|
|
require 'base64'
|
|
|
|
require 'cgi'
|
|
|
|
require 'digest/md5'
|
2009-11-16 17:31:17 -05:00
|
|
|
require 'excon'
|
2010-02-14 17:34:33 -05:00
|
|
|
require 'formatador'
|
2009-10-21 17:49:17 -04:00
|
|
|
require 'hmac-sha1'
|
|
|
|
require 'hmac-sha2'
|
|
|
|
require 'json'
|
|
|
|
require 'mime/types'
|
2009-11-02 21:47:24 -05:00
|
|
|
require 'nokogiri'
|
|
|
|
require 'time'
|
2009-10-21 17:49:17 -04:00
|
|
|
|
2009-09-14 00:24:22 -04:00
|
|
|
__DIR__ = File.dirname(__FILE__)
|
|
|
|
|
|
|
|
$LOAD_PATH.unshift __DIR__ unless
|
|
|
|
$LOAD_PATH.include?(__DIR__) ||
|
|
|
|
$LOAD_PATH.include?(File.expand_path(__DIR__))
|
|
|
|
|
2009-08-07 03:28:53 -04:00
|
|
|
module Fog
|
|
|
|
|
2010-02-02 01:53:18 -05:00
|
|
|
class MockNotImplemented < StandardError; end
|
|
|
|
|
2009-09-15 00:14:34 -04:00
|
|
|
def self.mock!
|
|
|
|
@mocking = true
|
|
|
|
self.reload
|
2009-08-10 11:30:28 -04:00
|
|
|
end
|
|
|
|
|
2009-08-07 03:28:53 -04:00
|
|
|
def self.mocking?
|
2009-08-10 11:30:28 -04:00
|
|
|
!!@mocking
|
|
|
|
end
|
|
|
|
|
2010-02-12 02:41:40 -05:00
|
|
|
def self.dependencies
|
|
|
|
[
|
|
|
|
'fog/collection.rb',
|
|
|
|
'fog/connection.rb',
|
|
|
|
'fog/model.rb',
|
|
|
|
'fog/parser.rb',
|
|
|
|
'fog/aws.rb',
|
|
|
|
'fog/rackspace.rb',
|
|
|
|
'fog/slicehost.rb',
|
|
|
|
'fog/terremark.rb'
|
|
|
|
]
|
|
|
|
end
|
2009-10-31 15:26:49 -04:00
|
|
|
|
2010-02-12 02:41:40 -05:00
|
|
|
def self.reload
|
|
|
|
self.dependencies.each {|dependency| load(dependency)}
|
2009-08-07 03:28:53 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|
2009-08-07 22:55:11 -04:00
|
|
|
|
2010-02-12 02:41:40 -05:00
|
|
|
Fog.dependencies.each {|dependency| require(dependency)}
|