Sha256: eef2bc9d0faf303c9ce0d7e6b54440d46ca8c12a42a157e07cdee971e2d04a28

Contents?: true

Size: 1.08 KB

Versions: 2

Compression:

Stored size: 1.08 KB

Contents

=errata

Correct strings based on remote errata files.

==UTF-8

Assumes all input strings are UTF-8. Otherwise there can be problems with Ruby 1.9 and Regexp::FIXEDENCODING. Specifically, ASCII-8BIT regexps might be applied to UTF-8 strings (or vice-versa), resulting in Encoding::CompatibilityError.

==Real-life usage

Used by data_miner (http://github.com/seamusabshere/data_miner)

==Example

Taken from <tt>#{GEMDIR}/test/test_old_syntax.rb</tt>:

  errata = Errata.new(:url => 'http://static.brighterplanet.com/science/data/transport/automobiles/make_fleet_years/errata.csv')
  rover = { 'manufacturer_name' => 'foobar Austin Rover foobar' }
  mercedes = { 'manufacturer_name' => 'MERCEDES' }
  errata.correct! mercedes
  errata.correct! rover

Now you will have

  rover['manufacturer_name']    #=> 'Rover'         (used to be 'foobar Austin Rover foobar')
  mercedes['manufacturer_name'] #=> 'Mercedes-Benz' (used to be 'MERCEDES')

==Authors

* Seamus Abshere <seamus@abshere.net>
* Andy Rossmeissl <andy@rossmeissl.net>

==Copyright

Copyright (c) 2011 Brighter Planet. See LICENSE for details.

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
errata-1.0.3 README.rdoc
errata-1.0.2 README.rdoc