Method: Slideshow::Fetch#fetch_template

Defined in:
lib/slideshow/commands/fetch.rb

#fetch_template(src) ⇒ Object



58
59
60
61
62
63
64
65
66
67
68
69
70
71
# File 'lib/slideshow/commands/fetch.rb', line 58

def fetch_template( src )
  # src = 'http://github.com/geraldb/slideshow/raw/d98e5b02b87ee66485431b1bee8fb6378297bfe4/code/templates/fullerscreen.txt'
  # src = 'http://github.com/geraldb/sandbox/raw/13d4fec0908fbfcc456b74dfe2f88621614b5244/s5blank/s5blank.txt'
  uri = URI.parse( src )
  logger.debug "scheme: #{uri.scheme}, host: #{uri.host}, port: #{uri.port}, path: #{uri.path}"
  
  pakname = File.basename( uri.path ).downcase.gsub('.txt','')
  pakpath = File.expand_path( "#{config.config_dir}/templates/#{pakname}" )
  
  logger.debug "packname >#{pakname}<"
  logger.debug "pakpath >#{pakpath}<"

  Pakman::Fetcher.new.fetch_pak( src, pakpath )
end