Module: Pluto::ManifestHelper

Included in:
Formatter, Lister
Defined in:
lib/pluto/manifest_helpers.rb

Instance Method Summary collapse

Instance Method Details

#installed_template_manifest_patternsObject

shared methods for handling manifest lookups

note: required attribs (in host class) include:
   - opts.config_path


10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/pluto/manifest_helpers.rb', line 10

def installed_template_manifest_patterns

  # 1) search .    # that is, working/current dir
  # 2) search <config_dir>
  # 3) search <gem>/templates

### 
# Note
# -- for now - no longer ship w/ builtin template packs
# - download on demand if needed

  builtin_patterns = [
##      "#{Pluto.root}/templates/*.txt"
  ]
  config_patterns  = [
##      "#{File.expand_path(opts.config_path)}/*.txt",
    "#{File.expand_path(opts.config_path)}/*/*.txt"
  ]
  current_patterns = [
##      "*.txt",
    "*/*.txt"
  ]
  
  patterns = []
  patterns += current_patterns
  patterns += config_patterns
  patterns += builtin_patterns
end

#installed_template_manifestsObject



39
40
41
42
43
44
45
46
# File 'lib/pluto/manifest_helpers.rb', line 39

def installed_template_manifests
  excludes = [
    "Manifest.txt",
    "*/Manifest.txt"
  ]    
  
  Pakman::Finder.new.find_manifests( installed_template_manifest_patterns, excludes )
end