Sha256: e358e97b64f0f4c4ba0354a6be780b99ed21e439580c2471d8baec1e85840531

Contents?: true

Size: 1.04 KB

Versions: 3

Compression:

Stored size: 1.04 KB

Contents

module Slideshow

module ManifestHelper

  ## shared methods for handling manifest lookups
  
  def installed_template_manifest_patterns
    # 1) search ./templates
    # 2) search config_dir/templates
    # 3) search gem/templates

    builtin_patterns = [
      "#{Slideshow.root}/templates/*.txt"
    ]
    config_patterns  = [
      "#{config.config_dir}/templates/*.txt",
      "#{config.config_dir}/templates/*/*.txt"
    ]
    current_patterns = [
      "templates/*.txt",
      "templates/*/*.txt"
    ]
    
    patterns = []
    patterns += current_patterns  unless Slideshow.root == File.expand_path( '.' )  # don't include working dir if we test code from repo (don't include slideshow/templates)
    patterns += config_patterns
    patterns += builtin_patterns    
  end

  def installed_template_manifests
    ## note: code moved to its own gem, that is, pakman
    ## see https://github.com/geraldb/pakman
  
    Pakman::Finder.new( logger ).find_manifests( installed_template_manifest_patterns )
  end
    
end # module Manifest
end # module Slideshow

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
slideshow-1.2.0.beta3 lib/slideshow/manifest_helpers.rb
slideshow-1.2.0.beta2 lib/slideshow/manifest_helpers.rb
slideshow-1.2.0.beta1 lib/slideshow/manifest_helpers.rb