Method: Doing::Plugins.plugin_templates

Defined in:
lib/doing/plugin_manager.rb

.plugin_templates(type: :export) ⇒ Array

Return array of available template names

Parameters:

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

    Plugin type (:import, :export)

Returns:

  • (Array)

    Array of template names (String)



215
216
217
218
219
220
221
222
223
224
225
226
227
228
# File 'lib/doing/plugin_manager.rb', line 215

def plugin_templates(type: :export)
  type = valid_type(type)
  templates = []
  plugs = plugins[type].clone
  plugs.delete_if { |_t, o| o[:templates].nil? }.each do |_, options|
    options[:templates].each do |t|
      out = t[:name]
      out += " (#{t[:format]})" if t.key?(:format)
      templates << out
    end
  end

  templates.sort.uniq
end