Method: Slideshow::Fetch#fetch_plugin

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

#fetch_plugin(src) ⇒ Object



87
88
89
90
91
92
93
94
95
96
97
98
99
# File 'lib/slideshow/commands/fetch.rb', line 87

def fetch_plugin( src )
  uri = URI.parse( src )
  logger.debug "scheme: #{uri.scheme}, host: #{uri.host}, port: #{uri.port}, path: #{uri.path}"
  
  # downcase basename w/ extension (remove .txt)
  pakname = File.basename( uri.path ).downcase.gsub('.txt','').gsub('.plugin','')
  pakpath = File.expand_path( "#{config.config_dir}/plugins/#{pakname}" )

  logger.debug "pakname >#{pakname}<"
  logger.debug "pakpath >#{pakpath}<"
 
  Pakman::Fetcher.new.fetch_pak( src, pakpath )
end