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:
parent
1ebad06ce0
commit
bb877cb9a7
22 changed files with 35 additions and 25 deletions
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
require 'nokogiri'
|
||||
|
||||
module Fog
|
||||
module Parsers
|
||||
class Base < Nokogiri::XML::SAX::Document
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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')
|
||||
|
|
|
@ -1,7 +1,4 @@
|
|||
require 'nokogiri'
|
||||
|
||||
require 'fog/core'
|
||||
require 'fog/core/parser'
|
||||
|
||||
module Fog
|
||||
module Google
|
||||
|
|
|
@ -1,7 +1,4 @@
|
|||
require 'nokogiri'
|
||||
|
||||
require 'fog/core'
|
||||
require 'fog/core/parser'
|
||||
|
||||
module Fog
|
||||
module NewServers
|
||||
|
|
|
@ -1,7 +1,4 @@
|
|||
require 'nokogiri'
|
||||
|
||||
require 'fog/core'
|
||||
require 'fog/core/parser'
|
||||
|
||||
module Fog
|
||||
module Slicehost
|
||||
|
|
|
@ -1,7 +1,4 @@
|
|||
require 'nokogiri'
|
||||
|
||||
require 'fog/core'
|
||||
require 'fog/core/parser'
|
||||
|
||||
module Fog
|
||||
module Zerigo
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -1,7 +1,4 @@
|
|||
require 'nokogiri'
|
||||
|
||||
require 'fog/core'
|
||||
require 'fog/core/parser'
|
||||
|
||||
require 'fog/terremark/shared'
|
||||
require 'fog/terremark/parser'
|
||||
|
|
|
@ -1,7 +1,4 @@
|
|||
require 'nokogiri'
|
||||
|
||||
require 'fog/core'
|
||||
require 'fog/core/parser'
|
||||
|
||||
require 'builder'
|
||||
require 'fog/vcloud/model'
|
||||
|
|
|
@ -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]
|
||||
|
|
Loading…
Reference in a new issue