Skip to content

Simple Rails plugin providing various extensions to base Ruby classes.

License

Notifications You must be signed in to change notification settings

pjg/ruby_extensions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RubyExtensions
==============

Simple Rails plugin providing various extensions to base Ruby classes.


Installation
============

git submodule add git://github.com/pjg/ruby_extensions.git vendor/plugins/ruby_extensions
git commit -m "Add ruby_extensions plugin as a submodule"


Examples
========

Array.arithmetic_mean

>> [1, 2, 3, 4, 5].arithmetic_mean
=> 3.0


Array.geometric_mean

>> [2, 3, 4.5].geometric_mean
=> 3.0


String.to_slug

>> "Iñtërnâtiônàlizætiøn".to_slug
=> "internationalizaetion"

>> "中文測試".to_slug
=> "zhong-wen-ce-shi"


Time.to_s extensions

>> Time.now.to_s(:detailed)
=> "2009-01-02 12:20"

>> Time.now.to_s(:brief)
=> "2010-02-06"



Copyright (c) 2008-2010 Paweł Gościcki, released under the MIT license

About

Simple Rails plugin providing various extensions to base Ruby classes.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages