Sha256: 020385af6b3b4af4ff752cd537d3351a2315cb3a32367b804e4ab35b6a3581b6

Contents?: true

Size: 526 Bytes

Versions: 12

Compression:

Stored size: 526 Bytes

Contents

# frozen_string_literal: true

module Uricp::Strategy
  class PipedLocalPut
    include Uricp::Strategy::Common

    def appropriate?
      return proposal if to.scheme == 'file' &&
                         from.scheme == 'pipe'

      debug "#{self.class.name}: not appropriate"
      false
    end

    def command
      "cp --sparse=always /dev/stdin #{to.path};"
    end

    def proposal
      @proposed_options = options.dup
      @proposed_options['from_uri'] = @proposed_options['to_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_put.rb
uricp-0.0.36 lib/uricp/strategy/piped_local_put.rb
uricp-0.0.35 lib/uricp/strategy/piped_local_put.rb
uricp-0.0.34 lib/uricp/strategy/piped_local_put.rb
uricp-0.0.32 lib/uricp/strategy/piped_local_put.rb
uricp-0.0.31 lib/uricp/strategy/piped_local_put.rb
uricp-0.0.30 lib/uricp/strategy/piped_local_put.rb
uricp-0.0.29 lib/uricp/strategy/piped_local_put.rb
uricp-0.0.28 lib/uricp/strategy/piped_local_put.rb
uricp-0.0.27 lib/uricp/strategy/piped_local_put.rb
uricp-0.0.26 lib/uricp/strategy/piped_local_put.rb
uricp-0.0.25 lib/uricp/strategy/piped_local_put.rb