Sha256: af9cdb70378d304dc2b6866c922830b48199f6843f1d18fa4760b821338d3304

Contents?: true

Size: 775 Bytes

Versions: 9

Compression:

Stored size: 775 Bytes

Contents

# frozen_string_literal: true

module Uricp::Strategy
  class PipedDecompress
    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

9 entries across 9 versions & 1 rubygems

Version Path
uricp-0.0.34 lib/uricp/strategy/piped_decompress.rb
uricp-0.0.32 lib/uricp/strategy/piped_decompress.rb
uricp-0.0.31 lib/uricp/strategy/piped_decompress.rb
uricp-0.0.30 lib/uricp/strategy/piped_decompress.rb
uricp-0.0.29 lib/uricp/strategy/piped_decompress.rb
uricp-0.0.28 lib/uricp/strategy/piped_decompress.rb
uricp-0.0.27 lib/uricp/strategy/piped_decompress.rb
uricp-0.0.26 lib/uricp/strategy/piped_decompress.rb
uricp-0.0.25 lib/uricp/strategy/piped_decompress.rb