24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
# File 'lib/slideshow/commands/fetch.rb', line 24
def fetch( shortcut_or_source )
logger.debug "fetch >#{shortcut_or_source}<"
if shortcut_or_source.index( '/' ).nil? && shortcut_or_source.index( '\\' ).nil?
shortcut = shortcut_or_source
sources = config.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] end
sources.each do |source|
if source.include?( '.txt.plugin' ) || source.include?( '.plugin.txt' )
fetch_plugin( source )
elsif source.include?( '.txt.quick' ) || source.include?( '.quick.txt' )
fetch_quick( source )
else fetch_template( source )
end
end
end
|