From c41d9fabba61eee130fe78ec59d658361a7a2e7d Mon Sep 17 00:00:00 2001 From: Rich Meyers Date: Thu, 17 Nov 2011 14:49:53 -0500 Subject: [PATCH 1/9] Delete rubygems require --- lib/right_aws.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/right_aws.rb b/lib/right_aws.rb index 331ce45..b4700f5 100644 --- a/lib/right_aws.rb +++ b/lib/right_aws.rb @@ -31,7 +31,6 @@ require "openssl" require "digest/sha1" -require 'rubygems' require 'right_http_connection' $:.unshift(File.dirname(__FILE__)) From a2600eb91dc8097745300f436f43a6f18e369cca Mon Sep 17 00:00:00 2001 From: Rich Meyers Date: Thu, 17 Nov 2011 14:50:09 -0500 Subject: [PATCH 2/9] Do not add self to load path --- lib/right_aws.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/right_aws.rb b/lib/right_aws.rb index b4700f5..5f494b2 100644 --- a/lib/right_aws.rb +++ b/lib/right_aws.rb @@ -33,7 +33,6 @@ require 'right_http_connection' -$:.unshift(File.dirname(__FILE__)) require 'awsbase/version' require 'awsbase/support' require 'awsbase/benchmark_fix' From 4fb509f9d6419a618c0c90ce0242173a127f582b Mon Sep 17 00:00:00 2001 From: Rich Meyers Date: Thu, 17 Nov 2011 14:55:16 -0500 Subject: [PATCH 3/9] Move component requires of various interfaces out of top level right_aws.rb --- lib/acf/right_acf_interface.rb | 4 ++++ lib/ec2/right_ec2.rb | 13 +++++++++++++ lib/iam/right_iam_interface.rb | 5 +++++ lib/right_aws.rb | 19 ------------------- 4 files changed, 22 insertions(+), 19 deletions(-) diff --git a/lib/acf/right_acf_interface.rb b/lib/acf/right_acf_interface.rb index 699a00c..b224ed1 100644 --- a/lib/acf/right_acf_interface.rb +++ b/lib/acf/right_acf_interface.rb @@ -547,3 +547,7 @@ def tagend(name) end end end + +require 'acf/right_acf_streaming_interface' +require 'acf/right_acf_origin_access_identities' +require 'acf/right_acf_invalidations' diff --git a/lib/ec2/right_ec2.rb b/lib/ec2/right_ec2.rb index 88d9a87..25f2b0f 100644 --- a/lib/ec2/right_ec2.rb +++ b/lib/ec2/right_ec2.rb @@ -539,3 +539,16 @@ def reset end end + +require 'ec2/right_ec2_images' +require 'ec2/right_ec2_instances' +require 'ec2/right_ec2_security_groups' +require 'ec2/right_ec2_spot_instances' +require 'ec2/right_ec2_ebs' +require 'ec2/right_ec2_reserved_instances' +require 'ec2/right_ec2_vpc' +require 'ec2/right_ec2_vpc2' +require 'ec2/right_ec2_monitoring' +require 'ec2/right_ec2_placement_groups' +require 'ec2/right_ec2_windows_mobility' +require 'ec2/right_ec2_tags' diff --git a/lib/iam/right_iam_interface.rb b/lib/iam/right_iam_interface.rb index 9ae659d..d4d2b18 100644 --- a/lib/iam/right_iam_interface.rb +++ b/lib/iam/right_iam_interface.rb @@ -339,3 +339,8 @@ def reset end end + +require 'iam/right_iam_groups' +require 'iam/right_iam_users' +require 'iam/right_iam_access_keys' +require 'iam/right_iam_mfa_devices' diff --git a/lib/right_aws.rb b/lib/right_aws.rb index 5f494b2..afab883 100644 --- a/lib/right_aws.rb +++ b/lib/right_aws.rb @@ -38,18 +38,6 @@ require 'awsbase/benchmark_fix' require 'awsbase/right_awsbase' require 'ec2/right_ec2' -require 'ec2/right_ec2_images' -require 'ec2/right_ec2_instances' -require 'ec2/right_ec2_security_groups' -require 'ec2/right_ec2_spot_instances' -require 'ec2/right_ec2_ebs' -require 'ec2/right_ec2_reserved_instances' -require 'ec2/right_ec2_vpc' -require 'ec2/right_ec2_vpc2' -require 'ec2/right_ec2_monitoring' -require 'ec2/right_ec2_placement_groups' -require 'ec2/right_ec2_windows_mobility' -require 'ec2/right_ec2_tags' require 'elb/right_elb_interface' require 'emr/right_emr_interface' require 'acw/right_acw_interface' @@ -62,15 +50,8 @@ require 'sqs/right_sqs_gen2' require 'sdb/right_sdb_interface' require 'acf/right_acf_interface' -require 'acf/right_acf_streaming_interface' -require 'acf/right_acf_origin_access_identities' -require 'acf/right_acf_invalidations' require 'rds/right_rds_interface' require 'iam/right_iam_interface' -require 'iam/right_iam_groups' -require 'iam/right_iam_users' -require 'iam/right_iam_access_keys' -require 'iam/right_iam_mfa_devices' require 'route_53/right_route_53_interface' require 'sns/right_sns_interface' From e6f815ed6733945c4679da17557f554b523b821f Mon Sep 17 00:00:00 2001 From: Rich Meyers Date: Thu, 17 Nov 2011 15:01:08 -0500 Subject: [PATCH 4/9] Autoload right_aws components --- lib/right_aws.rb | 37 ++++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/lib/right_aws.rb b/lib/right_aws.rb index afab883..72b3a7e 100644 --- a/lib/right_aws.rb +++ b/lib/right_aws.rb @@ -37,23 +37,26 @@ require 'awsbase/support' require 'awsbase/benchmark_fix' require 'awsbase/right_awsbase' -require 'ec2/right_ec2' -require 'elb/right_elb_interface' -require 'emr/right_emr_interface' -require 'acw/right_acw_interface' -require 'as/right_as_interface' -require 's3/right_s3_interface' -require 's3/right_s3' -require 'sqs/right_sqs_interface' -require 'sqs/right_sqs' -require 'sqs/right_sqs_gen2_interface' -require 'sqs/right_sqs_gen2' -require 'sdb/right_sdb_interface' -require 'acf/right_acf_interface' -require 'rds/right_rds_interface' -require 'iam/right_iam_interface' -require 'route_53/right_route_53_interface' -require 'sns/right_sns_interface' + +module RightAws + autoload :Ec2, 'ec2/right_ec2' + autoload :ElbInterface, 'elb/right_elb_interface' + autoload :EmrInterface, 'emr/right_emr_interface' + autoload :AcwInterface, 'acw/right_acw_interface' + autoload :AsInterface, 'as/right_as_interface' + autoload :S3Interface, 's3/right_s3_interface' + autoload :S3, 's3/right_s3' + autoload :SqsInterface, 'sqs/right_sqs_interface' + autoload :Sqs, 'sqs/right_sqs' + autoload :SqsGen2Interface, 'sqs/right_sqs_gen2_interface' + autoload :SqsGen2, 'sqs/right_sqs_gen2' + autoload :SdbInterface, 'sdb/right_sdb_interface' + autoload :AcfInterface, 'acf/right_acf_interface' + autoload :RdsInterface, 'rds/right_rds_interface' + autoload :IamInterface, 'iam/right_iam_interface' + autoload :Route53Interface, 'route_53/right_route_53_interface' + autoload :SnsInterface, 'sns/right_sns_interface' +end #- From e722bff87e5a4db28e90c6cb5d333aecf65b7fd7 Mon Sep 17 00:00:00 2001 From: Rich Meyers Date: Thu, 17 Nov 2011 15:05:37 -0500 Subject: [PATCH 5/9] Reorder autoloads alphabetically --- lib/right_aws.rb | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/lib/right_aws.rb b/lib/right_aws.rb index 72b3a7e..7b7ca76 100644 --- a/lib/right_aws.rb +++ b/lib/right_aws.rb @@ -39,23 +39,23 @@ require 'awsbase/right_awsbase' module RightAws + autoload :AcfInterface, 'acf/right_acf_interface' + autoload :AcwInterface, 'acw/right_acw_interface' + autoload :AsInterface, 'as/right_as_interface' autoload :Ec2, 'ec2/right_ec2' autoload :ElbInterface, 'elb/right_elb_interface' autoload :EmrInterface, 'emr/right_emr_interface' - autoload :AcwInterface, 'acw/right_acw_interface' - autoload :AsInterface, 'as/right_as_interface' - autoload :S3Interface, 's3/right_s3_interface' - autoload :S3, 's3/right_s3' - autoload :SqsInterface, 'sqs/right_sqs_interface' - autoload :Sqs, 'sqs/right_sqs' - autoload :SqsGen2Interface, 'sqs/right_sqs_gen2_interface' - autoload :SqsGen2, 'sqs/right_sqs_gen2' - autoload :SdbInterface, 'sdb/right_sdb_interface' - autoload :AcfInterface, 'acf/right_acf_interface' - autoload :RdsInterface, 'rds/right_rds_interface' autoload :IamInterface, 'iam/right_iam_interface' + autoload :RdsInterface, 'rds/right_rds_interface' autoload :Route53Interface, 'route_53/right_route_53_interface' + autoload :S3, 's3/right_s3' + autoload :S3Interface, 's3/right_s3_interface' + autoload :SdbInterface, 'sdb/right_sdb_interface' autoload :SnsInterface, 'sns/right_sns_interface' + autoload :Sqs, 'sqs/right_sqs' + autoload :SqsGen2, 'sqs/right_sqs_gen2' + autoload :SqsGen2Interface, 'sqs/right_sqs_gen2_interface' + autoload :SqsInterface, 'sqs/right_sqs_interface' end #- From 5f673c433db49fc4e8031ea48d54261340c59d48 Mon Sep 17 00:00:00 2001 From: Rich Meyers Date: Fri, 18 Nov 2011 15:46:18 -0500 Subject: [PATCH 6/9] Autoload rexml pieces, this should avoid rexml/document require when libxml is used --- lib/awsbase/right_awsbase.rb | 5 +++++ lib/right_aws.rb | 1 - 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/awsbase/right_awsbase.rb b/lib/awsbase/right_awsbase.rb index 34e79a0..4a0be66 100644 --- a/lib/awsbase/right_awsbase.rb +++ b/lib/awsbase/right_awsbase.rb @@ -21,6 +21,11 @@ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # +module REXML + autoload :Document, 'rexml/document' + autoload :Text, 'rexml/text' +end + # Test module RightAws require 'digest/md5' diff --git a/lib/right_aws.rb b/lib/right_aws.rb index 7b7ca76..ce9d9b4 100644 --- a/lib/right_aws.rb +++ b/lib/right_aws.rb @@ -27,7 +27,6 @@ require 'time' require "cgi" require "base64" -require "rexml/document" require "openssl" require "digest/sha1" From e62727c684d48199a43b1397b63589b3ec0492e1 Mon Sep 17 00:00:00 2001 From: Rich Meyers Date: Fri, 18 Nov 2011 16:10:29 -0500 Subject: [PATCH 7/9] Delete digest/sha1 require, it does not appear to be used anywhere. (OpenSSL is used for generating sha1 digests.) --- lib/right_aws.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/right_aws.rb b/lib/right_aws.rb index ce9d9b4..f01e845 100644 --- a/lib/right_aws.rb +++ b/lib/right_aws.rb @@ -28,7 +28,6 @@ require "cgi" require "base64" require "openssl" -require "digest/sha1" require 'right_http_connection' From 62d8cca894f8c2d0213f47bde30a927777fab51c Mon Sep 17 00:00:00 2001 From: Rich Meyers Date: Fri, 18 Nov 2011 16:19:38 -0500 Subject: [PATCH 8/9] Autoload digest/md5, it is used for caching which is disabled by default --- lib/awsbase/right_awsbase.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/awsbase/right_awsbase.rb b/lib/awsbase/right_awsbase.rb index 4a0be66..86c03e4 100644 --- a/lib/awsbase/right_awsbase.rb +++ b/lib/awsbase/right_awsbase.rb @@ -21,6 +21,10 @@ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # +module Digest + autoload :MD5, 'digest/md5' +end + module REXML autoload :Document, 'rexml/document' autoload :Text, 'rexml/text' @@ -28,8 +32,6 @@ module REXML # Test module RightAws - require 'digest/md5' - class AwsUtils #:nodoc: @@digest1 = OpenSSL::Digest::Digest.new("sha1") @@digest256 = nil From abb4002090f79527c91a047cc7faddc5918ef657 Mon Sep 17 00:00:00 2001 From: Rich Meyers Date: Wed, 7 Dec 2011 22:12:15 -0500 Subject: [PATCH 9/9] Add a right_aws/all.rb to require everything for threaded clients. --- lib/right_aws/all.rb | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 lib/right_aws/all.rb diff --git a/lib/right_aws/all.rb b/lib/right_aws/all.rb new file mode 100644 index 0000000..9c21b9a --- /dev/null +++ b/lib/right_aws/all.rb @@ -0,0 +1,41 @@ +# +# Copyright (c) 2011 RightScale Inc +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be +# included in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# + +require 'right_aws' +require 'acf/right_acf_interface' +require 'acw/right_acw_interface' +require 'as/right_as_interface' +require 'ec2/right_ec2' +require 'elb/right_elb_interface' +require 'emr/right_emr_interface' +require 'iam/right_iam_interface' +require 'rds/right_rds_interface' +require 'route_53/right_route_53_interface' +require 's3/right_s3' +require 's3/right_s3_interface' +require 'sdb/right_sdb_interface' +require 'sns/right_sns_interface' +require 'sqs/right_sqs' +require 'sqs/right_sqs_gen2' +require 'sqs/right_sqs_gen2_interface' +require 'sqs/right_sqs_interface'