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

defer requiring nokogiri

This commit is contained in:
geemus 2011-02-16 17:25:50 -08:00
parent 1ebad06ce0
commit bb877cb9a7
22 changed files with 35 additions and 25 deletions

View file

@ -43,6 +43,8 @@ module Fog
# ==== Returns
# * ELB object with connection to AWS.
def initialize(options={})
require 'fog/core/parser'
@aws_access_key_id = options[:aws_access_key_id]
@aws_secret_access_key = options[:aws_secret_access_key]
@hmac = Fog::HMAC.new('sha256', @aws_secret_access_key)

View file

@ -57,7 +57,9 @@ module Fog
# ==== Returns
# * IAM object with connection to AWS.
def initialize(options={})
require 'fog/core/parser'
require 'json'
@aws_access_key_id = options[:aws_access_key_id]
@aws_secret_access_key = options[:aws_secret_access_key]
@hmac = Fog::HMAC.new('sha256', @aws_secret_access_key)

View file

@ -42,6 +42,8 @@ module Fog
# ==== Returns
# * SES object with connection to AWS.
def initialize(options={})
require 'fog/core/parser'
@aws_access_key_id = options[:aws_access_key_id]
@aws_secret_access_key = options[:aws_secret_access_key]
@hmac = Fog::HMAC.new('sha256', @aws_secret_access_key)

View file

@ -59,6 +59,8 @@ module Fog
# ==== Returns
# * SimpleDB object with connection to aws.
def initialize(options={})
require 'fog/core/parser'
@aws_access_key_id = options[:aws_access_key_id]
@aws_secret_access_key = options[:aws_secret_access_key]
@hmac = Fog::HMAC.new('sha256', @aws_secret_access_key)

View file

@ -79,6 +79,8 @@ module Fog
Formatador.display_line(warning)
end
require 'fog/core/parser'
@aws_access_key_id = options[:aws_access_key_id]
@aws_secret_access_key = options[:aws_secret_access_key]
@hmac = Fog::HMAC.new('sha1', @aws_secret_access_key)

View file

@ -26,8 +26,6 @@ module Fog
model :volume
collection :volumes
require 'fog/compute/parsers/aws/basic'
request_path 'fog/compute/requests/aws'
request :allocate_address
request :associate_address
@ -138,6 +136,8 @@ module Fog
Formatador.display_line(warning)
end
require 'fog/compute/parsers/aws/basic'
@aws_access_key_id = options[:aws_access_key_id]
@region = options[:region] || 'us-east-1'
@data = self.class.data[@region][@aws_access_key_id]
@ -174,6 +174,8 @@ module Fog
Formatador.display_line(warning)
end
require 'fog/core/parser'
@aws_access_key_id = options[:aws_access_key_id]
@aws_secret_access_key = options[:aws_secret_access_key]
@hmac = Fog::HMAC.new('sha256', @aws_secret_access_key)

View file

@ -1,5 +1,3 @@
require 'fog/core/parser'
module Fog
module NewServers
class Compute < Fog::Service
@ -57,6 +55,8 @@ module Fog
Formatador.display_line(warning)
end
require 'fog/core/parser'
@new_servers_password = options[:new_servers_password]
@new_servers_username = options[:new_servers_username]
@host = options[:host] || "noc.newservers.com"

View file

@ -64,6 +64,8 @@ module Fog
Formatador.display_line(warning)
end
require 'fog/core/parser'
@slicehost_password = options[:slicehost_password]
@host = options[:host] || "api.slicehost.com"
@port = options[:port] || 443

View file

@ -1,3 +1,5 @@
require 'nokogiri'
module Fog
module Parsers
class Base < Nokogiri::XML::SAX::Document

View file

@ -84,6 +84,8 @@ module Fog
Formatador.display_line(warning)
end
require 'fog/core/parser'
@aws_access_key_id = options[:aws_access_key_id]
@aws_secret_access_key = options[:aws_secret_access_key]
@hmac = Fog::HMAC.new('sha1', @aws_secret_access_key)

View file

@ -60,6 +60,8 @@ module Fog
Formatador.display_line(warning)
end
require 'fog/core/parser'
@slicehost_password = options[:slicehost_password]
@host = options[:host] || "api.slicehost.com"
@port = options[:port] || 443

View file

@ -68,6 +68,8 @@ module Fog
Formatador.display_line(warning)
end
require 'fog/core/parser'
@zerigo_email = options[:zerigo_email]
@zerigo_token = options[:zerigo_token]
@host = options[:host] || "ns.zerigo.com"

View file

@ -1,5 +1,3 @@
require 'nokogiri'
require 'fog/core'
require 'fog/core/parser'
@ -13,7 +11,6 @@ module Fog
service(:dns, 'dns/aws')
service(:elb, 'aws/elb')
service(:iam, 'aws/iam')
service(:s3, 'storage/aws')
service(:ses, 'aws/ses')
service(:simpledb, 'aws/simpledb')
service(:storage, 'storage/aws')

View file

@ -1,7 +1,4 @@
require 'nokogiri'
require 'fog/core'
require 'fog/core/parser'
module Fog
module Google

View file

@ -1,7 +1,4 @@
require 'nokogiri'
require 'fog/core'
require 'fog/core/parser'
module Fog
module NewServers

View file

@ -1,7 +1,4 @@
require 'nokogiri'
require 'fog/core'
require 'fog/core/parser'
module Fog
module Slicehost

View file

@ -1,7 +1,4 @@
require 'nokogiri'
require 'fog/core'
require 'fog/core/parser'
module Fog
module Zerigo

View file

@ -231,7 +231,10 @@ module Fog
warning << " [light_black](" << location << ")[/] "
Formatador.display_line(warning)
end
require 'fog/core/parser'
require 'mime/types'
@aws_access_key_id = options[:aws_access_key_id]
@aws_secret_access_key = options[:aws_secret_access_key]
@hmac = Fog::HMAC.new('sha1', @aws_secret_access_key)

View file

@ -193,7 +193,9 @@ module Fog
Formatador.display_line(warning)
end
require 'fog/core/parser'
require 'mime/types'
@google_storage_access_key_id = options[:google_storage_access_key_id]
@google_storage_secret_access_key = options[:google_storage_secret_access_key]
@hmac = Fog::HMAC.new('sha1', @google_storage_secret_access_key)

View file

@ -1,7 +1,4 @@
require 'nokogiri'
require 'fog/core'
require 'fog/core/parser'
require 'fog/terremark/shared'
require 'fog/terremark/parser'

View file

@ -1,7 +1,4 @@
require 'nokogiri'
require 'fog/core'
require 'fog/core/parser'
require 'builder'
require 'fog/vcloud/model'

View file

@ -242,6 +242,8 @@ module Fog
end
def initialize(options = {})
require 'fog/core/parser'
@versions_uri = URI.parse('https://vcloud.fakey.com/api/versions')
end
@ -309,6 +311,8 @@ module Fog
end
def initialize(options = {})
require 'fog/core/parser'
@connections = {}
@versions_uri = URI.parse(options[:versions_uri])
@module = options[:module]