Sha256: 2140c52c010f9ee6db239174c3a7e093a31b942b53d8e5b68be8efe540b5bc75

Contents?: true

Size: 644 Bytes

Versions: 9

Compression:

Stored size: 644 Bytes

Contents

module Humidifier
  module AwsAdapters
    # An adapter used when neither SDK is loaded
    class Noop
      # Capture all STACK_METHODS method calls and warn that they will not be run
      def method_missing(method, *)
        if AwsShim::STACK_METHODS.include?(method)
          puts "WARNING: Cannot run #{method} because aws-sdk not loaded."
          false
        else
          super
        end
      end

      # We capture stack methods and warn about them but don't actually respond
      # to them
      def respond_to_missing?(method, *)
        AwsShim::STACK_METHODS.include?(method) ? false : super
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
humidifier-1.8.0 lib/humidifier/aws_adapters/noop.rb
humidifier-1.7.0 lib/humidifier/aws_adapters/noop.rb
humidifier-1.6.1 lib/humidifier/aws_adapters/noop.rb
humidifier-1.6.0 lib/humidifier/aws_adapters/noop.rb
humidifier-1.4.2 lib/humidifier/aws_adapters/noop.rb
humidifier-1.4.1 lib/humidifier/aws_adapters/noop.rb
humidifier-1.4.0 lib/humidifier/aws_adapters/noop.rb
humidifier-1.3.1 lib/humidifier/aws_adapters/noop.rb
humidifier-1.2.1 lib/humidifier/aws_adapters/noop.rb