Sha256: f6c4c1aea2b750e3d0e10fc848539b649c2162e3a9209c6d65d17bf6d89cc927
Contents?: true
Size: 1002 Bytes
Versions: 21
Compression:
Stored size: 1002 Bytes
Contents
require 'singleton' module Brief class Configuration include Singleton def self.method_missing(meth, *args, &block) if instance.respond_to?(meth) instance.send(meth, *args, &block) else super end end def current @current ||= { docs_path: 'docs', models_path: 'models', templates_path: 'templates', data_path: 'data', assets_path: 'assets', lib_path: "lib", # line wrapping in vim and other editors creates # a bunch of extra br/ tags preserve_gfm_line_breaks: false }.to_mash end def set(attribute, value = nil) current[attribute] = value self end def method_missing(meth, *args, &block) if current.respond_to?(meth) && current.key?(meth) current.send(meth, *args, &block) else # swallow invalid method calls in production super if ENV['BRIEF_DEBUG_MODE'] nil end end end end
Version data entries
21 entries across 21 versions & 1 rubygems