Sha256: bfb20283d73fda59a5c1cd995b0a1bea6f94ed96e7ee5dcd140fa6b1ef276caf

Contents?: true

Size: 775 Bytes

Versions: 3

Compression:

Stored size: 775 Bytes

Contents

# frozen_string_literal: true

module Uricp::Strategy
  class PipedDecompressXz
    include Uricp::Strategy::Common

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

    def command
      'xz -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_xz.rb
uricp-0.0.36 lib/uricp/strategy/piped_decompress_xz.rb
uricp-0.0.35 lib/uricp/strategy/piped_decompress_xz.rb