class PSGC::Import::Base

Base class for all other importers

Constants

WEB_FOLDER

Attributes

dir[RW]
uri[R]

Public Class Methods

uri=(uri) click to toggle source
# File lib/psgc/import.rb, line 16
def uri=(uri)
  @uri = uri.is_a?(URI) ? uri : URI(uri)
end

Public Instance Methods

fetch() click to toggle source

Use ‘curl` to get the desired page

# File lib/psgc/import.rb, line 22
def fetch
  DownloadManager.fetch(src, target)
  parse
end
parse() click to toggle source

noop

# File lib/psgc/import.rb, line 28
def parse
end

Protected Instance Methods

full_target() click to toggle source
# File lib/psgc/import.rb, line 42
def full_target
  File.join(Base.dir, target)
end
target() click to toggle source
# File lib/psgc/import.rb, line 33
def target
  u = URI(src)
  file = File.basename(u.path)
  if u.query
    file = file + '?' + u.query.split('&').first
  end
  @target ||= file
end