Class: Dip::Config::ConfigFinder
- Inherits:
-
Object
- Object
- Dip::Config::ConfigFinder
- Defined in:
- lib/dip/config.rb
Instance Attribute Summary collapse
-
#file_path ⇒ Object
readonly
Returns the value of attribute file_path.
Instance Method Summary collapse
- #exist? ⇒ Boolean
-
#initialize(work_dir, override: false) ⇒ ConfigFinder
constructor
A new instance of ConfigFinder.
Constructor Details
#initialize(work_dir, override: false) ⇒ ConfigFinder
Returns a new instance of ConfigFinder.
29 30 31 32 33 34 35 36 37 |
# File 'lib/dip/config.rb', line 29 def initialize(work_dir, override: false) @override = override @file_path = if ENV["DIP_FILE"] Pathname.new(prepared_name(ENV["DIP_FILE"])) else find(Pathname.new(work_dir)) end end |
Instance Attribute Details
#file_path ⇒ Object (readonly)
Returns the value of attribute file_path.
27 28 29 |
# File 'lib/dip/config.rb', line 27 def file_path @file_path end |
Instance Method Details
#exist? ⇒ Boolean
39 40 41 |
# File 'lib/dip/config.rb', line 39 def exist? file_path&.exist? end |