module FreeZipcodeData

Constants

VERSION

Public Class Methods

config_file(filename = '.free_zipcode_data.yml') click to toggle source

:nocov:

# File lib/free_zipcode_data.rb, line 17
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
current_environment() click to toggle source
# File lib/free_zipcode_data.rb, line 12
def self.current_environment
  ENV.fetch('APP_ENV', 'development')
end
os() click to toggle source

:nocov:

# File lib/free_zipcode_data.rb, line 26
def self.os
  if RUBY_PLATFORM.match?(/cygwin|mswin|mingw|bccwin|wince|emx/)
    :retarded
  else
    :normal
  end
end
root() click to toggle source
# File lib/free_zipcode_data.rb, line 8
def self.root
  Pathname.new(File.dirname(__FILE__)).parent
end