class Evertils::Action::CreateMultiple

Public Class Methods

new(notes) click to toggle source
# File lib/evertils/actions/create_multiple.rb, line 6
def initialize(notes)
  return unless notes.is_a? Array

  notes.each do |child|
    Notify.info("Creating #{child['label']}")

    # avoid infinite recursion
    next if ['create_multiple'].include?(child['action'])

    child['path'].gsub!('%EVERTILS_CONF_TYPE_PATH%', '~/.evertils/templates/type')

    runner = ActionRunner.new
    runner.params = Evertils::Type.new(child['path']).params
    runner.execute
  end
end