From 878272d7fa0f88ac81a624a94c27ee39816bb90a Mon Sep 17 00:00:00 2001 From: Trevor Rowe Date: Fri, 12 Jun 2015 16:03:32 -0700 Subject: [PATCH] Test failure fixes. The fix for eager_autoload! exposed an issue with autoloading optional dependencies eagerly. Travis caught these errors when testing against Ruby installations that did not have these optional dependencies present. See #833 --- aws-sdk-core/lib/aws-sdk-core/eager_loader.rb | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/aws-sdk-core/lib/aws-sdk-core/eager_loader.rb b/aws-sdk-core/lib/aws-sdk-core/eager_loader.rb index cf948a82c0b..1e0fcfbc275 100644 --- a/aws-sdk-core/lib/aws-sdk-core/eager_loader.rb +++ b/aws-sdk-core/lib/aws-sdk-core/eager_loader.rb @@ -17,12 +17,11 @@ def load(klass_or_module) @loaded << klass_or_module klass_or_module.constants.each do |const_name| path = klass_or_module.autoload?(const_name) - require(path) if path - const = klass_or_module.const_get(const_name) - if const.is_a?(Module) - unless @loaded.include?(const) - load(const) - end + begin + require(path) if path + const = klass_or_module.const_get(const_name) + self.load(const) if Module === const && !@loaded.include?(const) + rescue LoadError end end self