github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

ionfish / urlify

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 3
    • 1
  • Source
  • Commits
  • Network (1)
  • Issues (0)
  • Downloads (3)
  • Graphs
  • Branch: master

click here to add a description

click here to add a homepage

  • Branches (1)
    • master ✓
  • Tags (3)
    • 0.2.1
    • 0.2.0
    • 0.1.0
Sending Request…
Enable Donations

Pledgie Donations

Once activated, we'll place the following badge in your repository's detail box:
Pledgie_example
This service is courtesy of Pledgie.

Convert accented characters to their ASCII equivalents — Read more

  cancel

http://github.com/ionfish/urlify

  cancel
  • Private
  • Read-Only
  • HTTP Read-Only

This URL has Read+Write access

Move license text to a separate LICENSE file. 
ionfish (author)
Tue Oct 13 01:30:55 -0700 2009
commit  a8463d00ef40e2a1780e4a1c8ca8be7319fc75d8
tree    394105c2dadf4067c8db3f02b19eb4b78ffede90
parent  679c195d93df7fdb79cabbf9139b719f5d619826
urlify /
name age
history
message
file LICENSE Loading commit data...
file README.md
file Rakefile
file VERSION.yml
directory lib/
directory pkg/
directory test/
file urlify.gemspec
README.md

URLify

A tiny library to convert diacritical marks to unaccented equivalents, for ASCII-safe URI creation. It also includes a utility method to remove subtitles.

Installation

sudo gem install urlify

URLify is available from Gemcutter and in source form on GitHub.

API

URLify.deaccentuate "Kurt Gödel"        # => "Kurt Godel"

URLify.strip_subtitle "Begriffsschrift:
  eine der arithmetischen nachgebildete
  Formelsprache des reinen Denkens"     # => "Begriffsschrift"

URLify.urlify "Über Sinn und Bedeutung" # => "uber_sinn_und_bedeutung"

URLify.urlify "Moses Schönfinkel", "-"  # => "moses-schoenfinkel"

The URLify module may be mixed into the String class to add the above class methods--deaccentuate, strip_subtitle and urlify--as instance methods on the String class. It is not mixed in by default, for obvious reasons.

class String
  include URLify
end

"Grundzüge der theoretischen Logik".urlify
  # => "grundzuge_der_theoretischen_logik"

Please note that non-a-z characters are removed by the deaccentuate and urlify methods, and only characters in URLify's accent library will be replaced by their ASCII counterparts. If the library doesn't include a particular conversion, please consider forking the project and adding it.

Licence

URLify is released under the BSD license. Please see the LICENSE file for details.

Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server