Sha256: b2a7eb610325e0e5bddd5f055eed59b1c179660fe8db925a0480c5d757d8ad43

Contents?: true

Size: 807 Bytes

Versions: 47

Compression:

Stored size: 807 Bytes

Contents

# encoding: utf-8
# author: Dominik Richter
# author: Christoph Hartmann

require 'inspec/plugins'
require 'utils/plugin_registry'

module Inspec
  # Pre-checking of target resolution. Make sure that SourceReader plugins
  # always receive a fetcher.
  class SourceReaderRegistry < PluginRegistry
    def resolve(target)
      return nil if target.nil?
      unless target.is_a? Inspec::Plugins::Fetcher
        fail "SourceReader cannot resolve targets that aren't Fetchers: #{target.class}"
      end
      super(target)
    end
  end

  SourceReader = SourceReaderRegistry.new

  def self.source_reader(version)
    if version != 1
      fail 'Only source readers version 1 is supported!'
    end
    Inspec::Plugins::SourceReader
  end
end

require 'source_readers/inspec'
require 'source_readers/flat'

Version data entries

47 entries across 47 versions & 1 rubygems

Version Path
inspec-0.33.2 lib/inspec/source_reader.rb
inspec-0.33.1 lib/inspec/source_reader.rb
inspec-0.33.0 lib/inspec/source_reader.rb
inspec-0.32.0 lib/inspec/source_reader.rb
inspec-0.31.0 lib/inspec/source_reader.rb
inspec-0.30.0 lib/inspec/source_reader.rb
inspec-0.29.0 lib/inspec/source_reader.rb
inspec-0.28.1 lib/inspec/source_reader.rb
inspec-0.28.0 lib/inspec/source_reader.rb
inspec-0.27.1 lib/inspec/source_reader.rb
inspec-0.27.0 lib/inspec/source_reader.rb
inspec-0.26.0 lib/inspec/source_reader.rb
inspec-0.25.0 lib/inspec/source_reader.rb
inspec-0.24.0 lib/inspec/source_reader.rb
inspec-0.23 lib/inspec/source_reader.rb
inspec-0.22.1 lib/inspec/source_reader.rb
inspec-0.22.0 lib/inspec/source_reader.rb
inspec-0.21.6 lib/inspec/source_reader.rb
inspec-0.21.5 lib/inspec/source_reader.rb
inspec-0.21.4 lib/inspec/source_reader.rb