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.
- #modules_dir ⇒ Object
Constructor Details
#initialize(work_dir, override: false) ⇒ ConfigFinder
Returns a new instance of ConfigFinder.
32 33 34 35 36 37 38 39 40 |
# File 'lib/dip/config.rb', line 32 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.
30 31 32 |
# File 'lib/dip/config.rb', line 30 def file_path @file_path end |
Instance Method Details
#exist? ⇒ Boolean
42 43 44 |
# File 'lib/dip/config.rb', line 42 def exist? file_path&.exist? end |
#modules_dir ⇒ Object
46 47 48 |
# File 'lib/dip/config.rb', line 46 def modules_dir file_path.dirname / ".dip" end |