Sha256: b38c5065fbb932a0156be533e4d8c9f09d8fcfdfa3f00ba570fe9ba957091844

Contents?: true

Size: 1.23 KB

Versions: 3

Compression:

Stored size: 1.23 KB

Contents

# frozen_string_literal: true

require 'readline'

require 'bundler/setup'
require 'free_zipcode_data/version'

module FreeZipcodeData
  def self.root
    Pathname.new(File.dirname(__FILE__)).parent
  end

  def self.current_environment
    ENV.fetch('APP_ENV', 'development')
  end

  #:nocov:
  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
  #:nocov:

  def self.os
    if RUBY_PLATFORM.match?(/cygwin|mswin|mingw|bccwin|wince|emx/)
      :retarded
    else
      :normal
    end
  end

  autoload :CountryTable, 'free_zipcode_data/country_table'
  autoload :StateTable,   'free_zipcode_data/state_table'
  autoload :CountyTable,  'free_zipcode_data/county_table'
  autoload :ZipcodeTable, 'free_zipcode_data/zipcode_table'
  autoload :DataSource,   'free_zipcode_data/data_source'
  autoload :Logger,       'free_zipcode_data/logger'
  autoload :Options,      'free_zipcode_data/options'
  autoload :Settings,     'free_zipcode_data/settings'
  autoload :SqliteRam,    'free_zipcode_data/sqlite_ram'
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
free_zipcode_data-1.0.5 lib/free_zipcode_data.rb
free_zipcode_data-1.0.4 lib/free_zipcode_data.rb
free_zipcode_data-1.0.3 lib/free_zipcode_data.rb