Module: Slideshow::ManifestHelper
- Included in:
- List, ManifestFinder, Quick
- Defined in:
- lib/slideshow/manifest_helpers.rb
Instance Method Summary collapse
-
#installed_plugin_manifest_patterns ⇒ Object
shared methods for handling manifest lookups.
-
#installed_plugin_manifests ⇒ Object
quickstarter templates.
- #installed_quick_manifest_patterns ⇒ Object
-
#installed_quick_manifests ⇒ Object
quickstarter templates.
- #installed_template_manifest_patterns ⇒ Object
- #installed_template_manifests ⇒ Object
Instance Method Details
#installed_plugin_manifest_patterns ⇒ Object
shared methods for handling manifest lookups
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/slideshow/manifest_helpers.rb', line 10 def installed_plugin_manifest_patterns # 1) search ./plugins # 2) search config_dir/plugins config_patterns = [ "#{config.config_dir}/plugins/*.{txt.plugin,plugin.txt}", "#{config.config_dir}/plugins/*/*.{txt.plugin,plugin.txt}" ] current_patterns = [ "plugins/*.{txt.plugin,plugin.txt}", "plugins/*/*.{txt.plugin,plugin.txt}" ] patterns = [] patterns += current_patterns patterns += config_patterns end |
#installed_plugin_manifests ⇒ Object
quickstarter templates
28 29 30 |
# File 'lib/slideshow/manifest_helpers.rb', line 28 def installed_plugin_manifests # quickstarter templates Pakman::Finder.new.find_manifests( installed_plugin_manifest_patterns ) end |
#installed_quick_manifest_patterns ⇒ Object
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 |
# File 'lib/slideshow/manifest_helpers.rb', line 75 def installed_quick_manifest_patterns # 1) search config_dir/templates # 2) search gem/templates # Note: only include builtin patterns if slideshow-templates gem included/required (it's optional) builtin_patterns = [] builtin_patterns << "#{Slideshow.root}/templates/*.{txt.quick,quick.txt}" config_patterns = [ "#{config.config_dir}/templates/*.{txt.quick,quick.txt}", "#{config.config_dir}/templates/*/*.{txt.quick,quick.txt}" ] current_patterns = [ "node_modules/*/*.{txt.quick,quick.txt}", # note: add support for npm installs - use/make slideshow required in name? for namespace in the future??? ] patterns = [] patterns += current_patterns patterns += config_patterns patterns += builtin_patterns end |
#installed_quick_manifests ⇒ Object
quickstarter templates
98 99 100 |
# File 'lib/slideshow/manifest_helpers.rb', line 98 def installed_quick_manifests # quickstarter templates Pakman::Finder.new.find_manifests( installed_quick_manifest_patterns ) end |
#installed_template_manifest_patterns ⇒ Object
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/manifest_helpers.rb', line 33 def installed_template_manifest_patterns # 1) search ./templates # 2) search config_dir/templates # 3) search gem/templates test_patterns = [] test_patterns << "#{Slideshow.root}/test/templates/*/*.txt" config_patterns = [ "#{config.config_dir}/templates/*.txt", "#{config.config_dir}/templates/*/*.txt" ] current_patterns = [ "templates/*.txt", "templates/*/*.txt", # todo: use all in one line? {*.txt,*/*.txt} does it work? "node_modules/*/*.txt", # note: add support for npm installs - use/make slideshow required in name? for namespace in the future??? ] patterns = [] patterns += current_patterns patterns += test_patterns if config.test? ## (auto-)add test templates in test mode patterns += config_patterns end |
#installed_template_manifests ⇒ Object
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 |
# File 'lib/slideshow/manifest_helpers.rb', line 57 def installed_template_manifests ## note: code moved to its own gem, that is, pakman ## see https://github.com/geraldb/pakman ## exclude manifest.txt/i (avoid confusion w/ ruby gem manifest; not a specific name anyway) ## also exclude patterns for quickstarter templates excludes = [ 'manifest.txt', '*/manifest.txt', '*.{txt.quick,quick.txt}', '*/*.{txt.quick,quick.txt}' ] Pakman::Finder.new.find_manifests( installed_template_manifest_patterns, excludes ) end |