Sha256: 46a9f7fa1b47d42820f655285f0d9180b02eeb4bbc8036e1415078737e3959af

Contents?: true

Size: 720 Bytes

Versions: 4

Compression:

Stored size: 720 Bytes

Contents

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
      "lz4c -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

4 entries across 4 versions & 1 rubygems

Version Path
uricp-0.0.4 lib/uricp/strategy/piped_decompress.rb
uricp-0.0.3 lib/uricp/strategy/piped_decompress.rb
uricp-0.0.2 lib/uricp/strategy/piped_decompress.rb
uricp-0.0.1 lib/uricp/strategy/piped_decompress.rb