class Pakman::Fetch

Attributes

opts[R]

Public Class Methods

new( opts ) click to toggle source
# File lib/pakman/cli/commands/fetch.rb, line 9
def initialize( opts )
  @opts = opts
end

Public Instance Methods

run() click to toggle source
# File lib/pakman/cli/commands/fetch.rb, line 15
def run
  logger.debug "fetch_uri: >#{opts.fetch_uri}<"
  src = opts.fetch_uri

  uri = URI.parse( src )
  logger.debug "scheme: >#{uri.scheme}<, host: >#{uri.host}<, port: >#{uri.port}<, path: >#{uri.path}<"

  pakname = Pakman.pakname_from_file( uri.path )
  logger.debug "pakname: >#{pakname}<"

  pakpath = File.expand_path( pakname, opts.config_path )
  logger.debug "pakpath: >#{pakpath}<"

  Fetcher.new.fetch_pak( src, pakpath )
end