feature: add use_layout method to load layouts at runtime

Closes #141
This commit is contained in:
Andy Meneely
2016-03-16 17:05:07 -04:00
parent b74fbf5787
commit 955d64a01f
5 changed files with 47 additions and 3 deletions
+6
View File
@@ -31,5 +31,11 @@ module Squib
@font = (opts[:font] == :default) ? Squib::DEFAULT_FONT: opts[:font]
end
# Load a new layout into the deck
# @api public
def use_layout(file: 'layout.yml')
@layout = LayoutParser.load_layout(file, @layout)
end
end
end
+2 -2
View File
@@ -7,8 +7,8 @@ module Squib
# Load the layout file(s), if exists
# @api private
def self.load_layout(files)
layout = {}
def self.load_layout(files, initial = {})
layout = initial
Squib::logger.info { " using layout(s): #{files}" }
Array(files).each do |file|
thefile = file