Method: Pluto::Installer#install

Defined in:
lib/pluto/merge/installer.rb

#install(shortcut_or_source) ⇒ Object



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/pluto/merge/installer.rb', line 19

def install( shortcut_or_source )

  logger.debug "fetch >#{shortcut_or_source}<"
  
  ## check for builtin shortcut (assume no / or \) 
  if shortcut_or_source.index( '/' ).nil? && shortcut_or_source.index( '\\' ).nil?
    shortcut = shortcut_or_source
    sources = opts.map_fetch_shortcut( shortcut )

    if sources.empty?
      puts "** Error: No mapping found for shortcut '#{shortcut}'."
      return
    end
    puts "  Mapping fetch shortcut '#{shortcut}' to: #{sources.join(',')}"
  else
    sources = [shortcut_or_source]  # pass arg through unmapped
  end

  sources.each do |source|
    install_template( source )
  end

end