Class: PlatteModuleLoader

Inherits:
Object
  • Object
show all
Defined in:
lib/platte_module_loader.rb

Overview

Loader for Platte modules

Instance Method Summary collapse

Instance Method Details

#create_from_folder(folder) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
# File 'lib/platte_module_loader.rb', line 5

def create_from_folder folder
  raise PlatteModuleCreationException, "Module at #{folder} could not be found!" unless File.exist? folder

  # Extract info
  name, description, stylesheets, javascripts = get_module_info(folder)

  # Read template
  template = File.read("#{folder}/template.mustache")

  PlatteModule.new folder, name, description, template, stylesheets, javascripts
end