Sha256: ec5e5f3aaf018caaf6161033f01467e9e0b8a8992e10d94373cfbf3df2a0cf6b

Contents?: true

Size: 735 Bytes

Versions: 3

Compression:

Stored size: 735 Bytes

Contents

require 'fileutils'

module Uricp::Strategy
  class PipedCache
    include Uricp::Strategy::Common
    include Uricp::Strategy::CacheCommon

    def appropriate?
      if cache_root
        case from.scheme
        when 'pipe'
          validate_cache!
          return proposal
        end
        debug "#{self.class.name}: not appropriate"
      else
        debug "#{self.class.name}: no cacheing requested"
      end
      false
    end

    def command
      "tee #{temp_cache_file} |"
    end

    def proposal
      @proposed_options = options.dup
      @proposed_options['sweep'] = [temp_cache_file, cache_file]
      @proposed_options.delete('cache')
      @proposed_options.delete('cache_name')
      self
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
uricp-0.0.18 lib/uricp/strategy/piped_cache.rb
uricp-0.0.17 lib/uricp/strategy/piped_cache.rb
uricp-0.0.16 lib/uricp/strategy/piped_cache.rb