Sha256: f2314dab0957cc35ccb9ec3f93cf3fcff2ae1a337502cb614f509d8164ba0c96

Contents?: true

Size: 586 Bytes

Versions: 11

Compression:

Stored size: 586 Bytes

Contents

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

11 entries across 11 versions & 1 rubygems

Version Path
uricp-0.0.15 lib/uricp/strategy/piped_local_compress.rb
uricp-0.0.14 lib/uricp/strategy/piped_local_compress.rb
uricp-0.0.13 lib/uricp/strategy/piped_local_compress.rb
uricp-0.0.12 lib/uricp/strategy/piped_local_compress.rb
uricp-0.0.11 lib/uricp/strategy/piped_local_compress.rb
uricp-0.0.10 lib/uricp/strategy/piped_local_compress.rb
uricp-0.0.9 lib/uricp/strategy/piped_local_compress.rb
uricp-0.0.8 lib/uricp/strategy/piped_local_compress.rb
uricp-0.0.7 lib/uricp/strategy/piped_local_compress.rb
uricp-0.0.6 lib/uricp/strategy/piped_local_compress.rb
uricp-0.0.5 lib/uricp/strategy/piped_local_compress.rb