<commit_before>h1. My Zipcode Gem

!http://travis-ci.org/midwire/my_zipcode_gem.png(Build Status)!:http://travis-ci.org/midwire/my_zipcode_gem

Simple gem to handle zipcode lookups and related functionality.  @rake zipcodes:update@ will automatically download and update your local zipcode database.  Generates three models for extended zipcode functionality.

h2. Installation

Add the following line to your Gemfile:

bc. gem 'my_zipcode_gem'

Run:

bc. rake bundle install

Generate the models and populate the data:

bc. rails g my_zipcode_gem:models
rake db:migrate
rake zipcodes:update

You should now have three new tables and three new models, Zipcode, State, County.

h2. Usage

bc. zipcode = Zipcode.find_by_code '66206'
zipcode.state.abbr    # => 'KS'
zipcode.city          # => 'Shawnee Mission'
zipcode.county.name   # => 'Johnson'
zipcode.lat.to_s      # => '38.959356', it is actually a BigDecimal object converted to_s for documentation.
zipcode.lon.to_s      # => '-94.716155', ditto
zipcode.is_geocoded?  # => true, most if not all should be pre-geocoded.<commit_msg>build takes > 900 seconds, removed travis ci build tag<commit_after>h1. My Zipcode Gem

Simple gem to handle zipcode lookups and related functionality.  @rake zipcodes:update@ will automatically download and update your local zipcode database.  Generates three models for extended zipcode functionality.

h2. Installation

Add the following line to your Gemfile:

bc. gem 'my_zipcode_gem'

Run:

bc. rake bundle install

Generate the models and populate the data:

bc. rails g my_zipcode_gem:models
rake db:migrate
rake zipcodes:update

You should now have three new tables and three new models, Zipcode, State, County.

h2. Usage

bc. zipcode = Zipcode.find_by_code '66206'
zipcode.state.abbr    # => 'KS'
zipcode.city          # => 'Shawnee Mission'
zipcode.county.name   # => 'Johnson'
zipcode.lat.to_s      # => '38.959356', it is actually a BigDecimal object converted to_s for documentation.
zipcode.lon.to_s      # => '-94.716155', ditto
zipcode.is_geocoded?  # => true, most if not all should be pre-geocoded.
{'fraction_non_alphanumeric': 0.08658420551855375, 'fraction_numerical': 0.024262607040913417, 'mean_word_length': 4.1292682926829265, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 16, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6560783', 'n_tokens_mistral': 713, 'n_tokens_neox': 670, 'n_words': 237}