Sha256: 0dd997e31d4abaf0c2ec48d002c3b4f169d9d5bd78059c69257d533184552d89
Contents?: true
Size: 842 Bytes
Versions: 1
Compression:
Stored size: 842 Bytes
Contents
class Hyde class Config < OpenStruct DEFAULTS = { :site_path => '.', :layouts_path => nil, :extensions_path => nil, :partials_path => nil, :output_path => nil } def self.load(config_file) new(YAML::load_file(config_file)) rescue new end def initialize(options={}) super DEFAULTS.merge(options) end # Returns tilt options for a given file. # @example tilt_options('index.haml') # { :escape_html => ... } def tilt_options_for(file) tilt_options file.split('.').last.downcase end # Returns tilt options for a given engine. # @example tilt_options('haml') # { :escape_html => ... } def tilt_options(what) @tilt_options ||= begin o = @table[:tilt_options] || Hash.new o['haml'] ||= { :escape_html => true } o end @tilt_options[what.to_s] end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
hydeweb-0.1.1 | lib/hyde/config.rb |