Skip to content

PathScrubber cleans strings according to customizable styles.

Notifications You must be signed in to change notification settings

thehenster/path_scrubber

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

h1. PathScrubber

PathScrubber is a simple rails plugin (that can be used independently of rails) to clean up strings according to a customizable style. Its most obvious application is cleaning up paths to be SEO/URL friendly.

Dynamic methods are added to Ruby's native classes so your styles are always available when needed.

h2. Examples

h3. Using the preloaded :url style.

> PathScrubber::Scrubber.set_scrubber_style :url
=> true
> "Sam & John's predicatable post title!".scrub_as_url
=> "sam-and-johns-predicatable-post-title"

h3. Defining your own style and using it from an Array.

> PathScrubber::Scrubber.set_scrubber_style :scream, :upcase => true, :characters => {"." => "!"}
=> true
> ["Please move.", "To be continued..."].scrub_as_scream
=> ["PLEASE MOVE!", "TO BE CONTINUED!!!"]

About

PathScrubber cleans strings according to customizable styles.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages