Sha256: 675d38a5f82609cdc2fe6e2ef471ec2ab7bd0f834499e34b79540815af81555b

Contents?: true

Size: 1.5 KB

Versions: 35

Compression:

Stored size: 1.5 KB

Contents

require 'aws-sdk-core'

module Aws

  module Resources
    autoload :Batch, 'aws-sdk-resources/batch'
    autoload :Builder, 'aws-sdk-resources/builder'
    autoload :BuilderSources, 'aws-sdk-resources/builder_sources'
    autoload :Collection, 'aws-sdk-resources/collection'
    autoload :Definition, 'aws-sdk-resources/definition'
    autoload :Documenter, 'aws-sdk-resources/documenter'
    autoload :Errors, 'aws-sdk-resources/errors'
    autoload :OperationMethods, 'aws-sdk-resources/operation_methods'
    autoload :Operations, 'aws-sdk-resources/operations'
    autoload :Options, 'aws-sdk-resources/options'
    autoload :Request, 'aws-sdk-resources/request'
    autoload :RequestParams, 'aws-sdk-resources/request_params'
    autoload :Resource, 'aws-sdk-resources/resource'
    autoload :Source, 'aws-sdk-resources/source'
  end

  service_added do |name, svc_module, options|
    definition = options[:resources]
    definition = case definition
      when nil then Resources::Definition.new({})
      when Resources::Definition then definition
      when Hash then Resources::Definition.new(definition)
      when String
        Resources::Definition.new(Json.load_file(definition), source_path: definition)
      else raise ArgumentError, "invalid resource definition #{definition}"
    end
    definition.apply(svc_module)

    # load customizations
    svc = File.join(
      File.dirname(__FILE__),
      'aws-sdk-resources',
      'services',
      "#{name.downcase}.rb")

    require(svc) if File.exist?(svc)
  end

end

Version data entries

35 entries across 35 versions & 1 rubygems

Version Path
aws-sdk-resources-2.1.36 lib/aws-sdk-resources.rb
aws-sdk-resources-2.1.35 lib/aws-sdk-resources.rb
aws-sdk-resources-2.1.34 lib/aws-sdk-resources.rb
aws-sdk-resources-2.1.33 lib/aws-sdk-resources.rb
aws-sdk-resources-2.1.32 lib/aws-sdk-resources.rb
aws-sdk-resources-2.1.31 lib/aws-sdk-resources.rb
aws-sdk-resources-2.1.30 lib/aws-sdk-resources.rb
aws-sdk-resources-2.1.29 lib/aws-sdk-resources.rb
aws-sdk-resources-2.1.28 lib/aws-sdk-resources.rb
aws-sdk-resources-2.1.27 lib/aws-sdk-resources.rb
aws-sdk-resources-2.1.26 lib/aws-sdk-resources.rb
aws-sdk-resources-2.1.25 lib/aws-sdk-resources.rb
aws-sdk-resources-2.1.24 lib/aws-sdk-resources.rb
aws-sdk-resources-2.1.23 lib/aws-sdk-resources.rb
aws-sdk-resources-2.1.22 lib/aws-sdk-resources.rb
aws-sdk-resources-2.1.21 lib/aws-sdk-resources.rb
aws-sdk-resources-2.1.20 lib/aws-sdk-resources.rb
aws-sdk-resources-2.1.19 lib/aws-sdk-resources.rb
aws-sdk-resources-2.1.18 lib/aws-sdk-resources.rb
aws-sdk-resources-2.1.17 lib/aws-sdk-resources.rb