This class is used to provide access to sources provided by resources.
Create a new resource source for the the glob and use only those paths matching paths_glob while stripping strip_prefix off the path.
# File lib/webgen/source/resource.rb, line 24 def initialize(glob, paths_glob = nil, strip_prefix = nil) @glob, @paths_glob, @strip_prefix = glob, paths_glob, strip_prefix end
Return all paths associated with the resources identified by glob.
# File lib/webgen/source/resource.rb, line 29 def paths if !defined?(@paths) stack = Stacked.new website.config['resources'].select {|name, infos| File.fnmatch(@glob, name)}.sort.each do |name, infos| stack.add([['/', Webgen::Common.const_for_name(infos.first).new(*infos[1..-1])]]) end @paths = stack.paths @paths = @paths.select {|p| File.fnmatch(@paths_glob, p)} if @paths_glob @paths.collect! {|p| p.mount_at('/', @strip_prefix)} if @strip_prefix end @paths end
Generated with the Darkfish Rdoc Generator 2.