Sha256: 4c4a4322a473a77acfcdfd372cf4b300bcc6a0e1899947ba9b7fb0e009a589d7

Contents?: true

Size: 778 Bytes

Versions: 3

Compression:

Stored size: 778 Bytes

Contents

# frozen_string_literal: true

module Uricp::Strategy
  class PipedDecompressLz4
    include Uricp::Strategy::Common

    def appropriate?
      case from.scheme
      when 'pipe'
        return proposal if lz4_source?
      end
      debug "#{self.class.name}: not appropriate"
      false
    end

    def command
      'lz4 -d |'
    end

    def proposal
      @proposed_options = options.dup
      @proposed_options.delete('source-format')
      if @proposed_options['target-format']
        @proposed_options['source-format'] = :raw
        if @proposed_options['source-format'] == @proposed_options['target-format']
          @proposed_options.delete('source-format')
          @proposed_options.delete('target-format')
        end
      end
      self
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
uricp-0.0.37 lib/uricp/strategy/piped_decompress_lz4.rb
uricp-0.0.36 lib/uricp/strategy/piped_decompress_lz4.rb
uricp-0.0.35 lib/uricp/strategy/piped_decompress_lz4.rb