Sha256: fc0274fd0cbd2d944b514c1ae80831fd4217ce97a44a37ecef24973aaaf63ecf

Contents?: true

Size: 1.29 KB

Versions: 30

Compression:

Stored size: 1.29 KB

Contents

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

30 entries across 30 versions & 1 rubygems

Version Path
fig-1.23.0 lib/fig/protocol.rb
fig-1.22.1.beta.1 lib/fig/protocol.rb
fig-1.22.0 lib/fig/protocol.rb
fig-1.21.1.beta.2 lib/fig/protocol.rb
fig-1.21.1.beta.1 lib/fig/protocol.rb
fig-1.21.0 lib/fig/protocol.rb
fig-1.20.1.beta.1 lib/fig/protocol.rb
fig-1.20.0 lib/fig/protocol.rb
fig-1.19.0 lib/fig/protocol.rb
fig-1.18.0 lib/fig/protocol.rb
fig-1.17.0 lib/fig/protocol.rb
fig-1.16.1.beta.1 lib/fig/protocol.rb
fig-1.16.0 lib/fig/protocol.rb
fig-1.15.1.beta.2 lib/fig/protocol.rb
fig-1.15.1.beta.1 lib/fig/protocol.rb
fig-1.15.0 lib/fig/protocol.rb
fig-1.14.0 lib/fig/protocol.rb
fig-1.13.0 lib/fig/protocol.rb
fig-1.12.0 lib/fig/protocol.rb
fig-1.11.0 lib/fig/protocol.rb