Method: Doing::Plugins.template_regex
- Defined in:
- lib/doing/plugin_manager.rb
.template_regex(type: :export) ⇒ Regexp
Return a regular expression of all template triggers for type
219 220 221 222 223 224 225 226 227 228 229 |
# File 'lib/doing/plugin_manager.rb', line 219 def template_regex(type: :export) type = valid_type(type) pattern = [] plugs = plugins[type].clone plugs.delete_if { |_, o| o[:templates].nil? }.each do |_, | [:templates].each do |t| pattern << t[:trigger].normalize_trigger end end Regexp.new("^(?:#{pattern.join('|')})$", true) end |