Sha256: 38cfec68a89f5ad4ecc67a4f95e63c4d04f0287341f69934348c283ee0b30f02

Contents?: true

Size: 1.31 KB

Versions: 15

Compression:

Stored size: 1.31 KB

Contents

# coding: utf-8

require 'fig/logging'
require 'fig/network_error'

module Fig; end

# File transfers.
module Fig::Protocol
  def download_list(uri)
    Fig::Logging.fatal "Protocol not supported: #{uri}"
    raise Fig::NetworkError.new "Protocol not supported: #{uri}"
  end

  # Determine whether we need to update something.  Returns nil to indicate
  # "don't know".
  def path_up_to_date?(uri, path)
    return nil # Not implemented
  end

  # Returns whether the file was not downloaded because the file already
  # exists and is already up-to-date.
  def download(uri, path)
    Fig::Logging.fatal "Protocol not supported: #{uri}"
    raise Fig::NetworkError.new "Protocol not supported: #{uri}"
  end

  def upload(local_file, uri)
    Fig::Logging.fatal "Protocol not supported: #{uri}"
    raise Fig::NetworkError.new "Protocol not supported: #{uri}"
  end

  private

  def strip_paths_for_list(ls_output, packages, path)
    if not ls_output.nil?
      ls_output = ls_output.gsub(path + '/', '').gsub(path, '').split("\n")
      ls_output.each do |line|
        parts =
          line.gsub(/\\/, '/').sub(/^\.\//, '').sub(/:$/, '').chomp().split('/')
        packages << parts.join('/') if parts.size == 2
      end
    end
  end

  def log_download(uri, path)
    Fig::Logging.debug "Downloading #{uri} to #{path}."
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
fig-1.27.10 lib/fig/protocol.rb
fig-1.27.8 lib/fig/protocol.rb
fig-1.27.5 lib/fig/protocol.rb
fig-1.27.4 lib/fig/protocol.rb
fig-1.27.3 lib/fig/protocol.rb
fig-1.27.0 lib/fig/protocol.rb
fig-1.26.1.beta.1 lib/fig/protocol.rb
fig-1.26.0 lib/fig/protocol.rb
fig-1.25.1.beta.1 lib/fig/protocol.rb
fig-1.25.0 lib/fig/protocol.rb
fig-1.24.1.beta.3 lib/fig/protocol.rb
fig-1.24.1.beta.2 lib/fig/protocol.rb
fig-1.24.1.beta.1 lib/fig/protocol.rb
fig-1.24.0 lib/fig/protocol.rb
fig-1.23.1.beta.1 lib/fig/protocol.rb