Module: Prmd::Render

Defined in:
lib/prmd/commands/render.rb

Overview

Render helper module

Class Method Summary collapse

Class Method Details

.get_template(options) ⇒ Erubis::Eruby

Retrieve the schema template

Parameters:

  • options (Hash<Symbol, Object>)

Returns:

  • (Erubis::Eruby)

    eruby template



11
12
13
14
15
16
17
18
19
# File 'lib/prmd/commands/render.rb', line 11

def self.get_template(options)
  template = options.fetch(:template) do
    abort 'render: Template was not provided'
  end
  template_dir = File.expand_path(template)
  # to keep backward compatibility
  template_dir = File.dirname(template) unless File.directory?(template_dir)
  Prmd::Template.load_template('schema.erb', template_dir)
end