Method: FreeZipcodeData.config_file

Defined in:
lib/free_zipcode_data.rb

.config_file(filename = '.free_zipcode_data.yml') ⇒ Object

:nocov:



18
19
20
21
22
23
24
25
# File 'lib/free_zipcode_data.rb', line 18

def self.config_file(filename = '.free_zipcode_data.yml')
  return root.join('spec', 'fixtures', filename) if current_environment == 'test'

  home = ENV.fetch('HOME')
  file = ENV.fetch('FZD_CONFIG_FILE', File.join(home, '.free_zipcode_data.yml'))
  FileUtils.touch(file)
  file
end