Sha256: 1d733fd005a3148b5c368c2da79fe18d29ea02f5a86afab0515ac54d89560bd5

Contents?: true

Size: 609 Bytes

Versions: 12

Compression:

Stored size: 609 Bytes

Contents

# frozen_string_literal: true

module Uricp::Strategy
  class PipedLocalCompress
    include Uricp::Strategy::Common

    def appropriate?
      case from.scheme
      when 'file'
        return proposal if !sequence_complete? && compression_required?
      end
      debug "#{self.class.name}: not appropriate"
      false
    end

    def command
      "lz4 -c <'#{from.path}' |"
    end

    def proposal
      @proposed_options = options.dup
      @proposed_options.delete('compress')
      @proposed_options['encoding'] = 'lz4'
      @proposed_options['from_uri'] = PIPE_URI
      self
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
uricp-0.0.37 lib/uricp/strategy/piped_local_compress.rb
uricp-0.0.36 lib/uricp/strategy/piped_local_compress.rb
uricp-0.0.35 lib/uricp/strategy/piped_local_compress.rb
uricp-0.0.34 lib/uricp/strategy/piped_local_compress.rb
uricp-0.0.32 lib/uricp/strategy/piped_local_compress.rb
uricp-0.0.31 lib/uricp/strategy/piped_local_compress.rb
uricp-0.0.30 lib/uricp/strategy/piped_local_compress.rb
uricp-0.0.29 lib/uricp/strategy/piped_local_compress.rb
uricp-0.0.28 lib/uricp/strategy/piped_local_compress.rb
uricp-0.0.27 lib/uricp/strategy/piped_local_compress.rb
uricp-0.0.26 lib/uricp/strategy/piped_local_compress.rb
uricp-0.0.25 lib/uricp/strategy/piped_local_compress.rb