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
239 240 241 242 243 244 245 246 247 248 249 |
# File 'lib/doing/plugin_manager.rb', line 239 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 |