Sha256: 8602b9cf20570f2e017f3459597d9f65e94d49e564627bff546f7eba57671d29

Contents?: true

Size: 642 Bytes

Versions: 4

Compression:

Stored size: 642 Bytes

Contents

module Astrails
  module Safe
    class Source < Stream

      def initialize(id, config)
        @id, @config = id, config
      end

      def filename
        @filename ||= expand(":kind-:id.:timestamp#{extension}")
      end

      # process each config key as source (with full pipe)
      def self.run(config)
        unless config
          puts "No configuration found for #{kind}"
          return
        end

        config.each do |key, value|
          stream = [Gpg, Gzip, Local, S3].inject(new(key, value)) do |res, klass|
            klass.new(res)
          end
          stream.run
        end
      end

    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
astrails-safe-0.1.1 lib/astrails/safe/source.rb
astrails-safe-0.1.2 lib/astrails/safe/source.rb
astrails-safe-0.1.3 lib/astrails/safe/source.rb
astrails-safe-0.1.4 lib/astrails/safe/source.rb