Class: Confinement::Config
- Inherits:
-
Object
- Object
- Confinement::Config
- Extended by:
- BuilderGetterInitialization
- Defined in:
- lib/confinement.rb
Defined Under Namespace
Classes: Compiler, Source, WatcherPaths, ZeitwerkProxy
Instance Attribute Summary collapse
- #logger ⇒ Object
-
#root ⇒ Object
readonly
Returns the value of attribute root.
Instance Method Summary collapse
- #default_logger ⇒ Object
-
#initialize(root:) ⇒ Config
constructor
A new instance of Config.
Methods included from BuilderGetterInitialization
Constructor Details
#initialize(root:) ⇒ Config
Returns a new instance of Config.
124 125 126 127 128 129 130 |
# File 'lib/confinement.rb', line 124 def initialize(root:) @root = Pathname.new(root)..cleanpath if !@root.exist? raise Error::PathDoesNotExist, "Root path does not exist: #{@root}" end end |
Instance Attribute Details
#logger ⇒ Object
135 136 137 |
# File 'lib/confinement.rb', line 135 def logger @logger ||= default_logger end |
#root ⇒ Object (readonly)
Returns the value of attribute root.
132 133 134 |
# File 'lib/confinement.rb', line 132 def root @root end |
Instance Method Details
#default_logger ⇒ Object
139 140 141 142 143 |
# File 'lib/confinement.rb', line 139 def default_logger Logger.new($stdout).tap do |l| l.level = Logger::INFO end end |