module Dialable::AreaCodes

Constants

NANP

Valid area codes per nanpa.com

Public Class Methods

datadir() click to toggle source
# File lib/dialable/area_codes.rb, line 6
def self.datadir
  # If we are in the source directory, don't use the datadir from the gem.
  datadir = if File.identical?(ENV['PWD'], File.join(File.dirname(__FILE__), '..', '..'))
              File.join(File.dirname(__FILE__), '..', '..', 'data', 'dialable')
            else
              Gem.datadir('dialable')
            end

  if ! File.directory?(datadir)
    fail "Can't find the datadir provided by the gem: #{Gem.datadir('dialable')} or by the source: #{File.join(File.dirname(__FILE__), '..', 'data', 'dialable')}."
  end

  datadir
end