Method: Doing::Plugins.plugin_regex

Defined in:
lib/doing/plugin_manager.rb

.plugin_regex(type: :export) ⇒ Regexp

Return a regular expression of all plugin triggers for type

Parameters:

  • type (Symbol) (defaults to: :export)

    The type :import or :export

Returns:

  • (Regexp)

    regular expression



178
179
180
181
182
183
184
185
# File 'lib/doing/plugin_manager.rb', line 178

def plugin_regex(type: :export)
  type = valid_type(type)
  pattern = []
  plugins[type].each do |_, options|
    pattern << options[:trigger].normalize_trigger
  end
  Regexp.new("^(?:#{pattern.join('|')})$", true)
end