Class: Dip::Config::ConfigFinder

Inherits:
Object
  • Object
show all
Defined in:
lib/dip/config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_pathObject (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

Returns:

  • (Boolean)


39
40
41
# File 'lib/dip/config.rb', line 39

def exist?
  file_path&.exist?
end