Method: Maglev::ThemeFilesystemLoader#call

Defined in:
lib/maglev/theme_filesystem_loader.rb

#call(path) ⇒ Object



11
12
13
14
15
16
17
18
# File 'lib/maglev/theme_filesystem_loader.rb', line 11

def call(path)
  theme = add(YAML.safe_load(File.read(path.join('theme.yml')), aliases: true))
  sections = load_sections(theme, Pathname.new(path).join('sections/**/*.yml'))
  theme.sections = Maglev::Section::Store.new(sections)
  theme
rescue Errno::ENOENT
  log_missing_theme_file(path)
end