Welcome To Snipplr


Everyone's Recent Ruby Snippets



1 2 3 4 5 6 7 ... 12
A monkey patch splitting a string into sentences.
0 507 posted 12 years ago by cocomo
This assumes the modules names are CamelCase and not UPPERCASE.
0 586 posted 12 years ago by blasterpal
Groovy has the as keyword which enables the implementation of a Java interface by using the as keyword, its quite easy to mimic this in JRuby.
0 354 posted 12 years ago by narkisr
To run, save as twitterbackup.rb: ruby twitterbackup.rb yourtwittername
1 348 posted 12 years ago by beandr
Code for a Rake task that allows compiles all LESS stylesheets (.less) contained within a single directory.
0 305 posted 12 years ago by brettbergeron
0 252 posted 12 years ago by kungfoo
1 242 posted 12 years ago by webstic
0 215 posted 12 years ago by kungfoo
Probably not the most elegant solution, but it works. Needed this for a capistrano deploy task which shows the most recent tagged releases in my repository. Very bare bones, and needs tweaking if your versions are not in X.X.X.X format.
1 422 posted 12 years ago by bananastalktome
For moving from older gem to newest if ' sudo gem update --system ' doesn't work
1 257 posted 12 years ago by inkdeep
What a gotcha!
2 274 posted 12 years ago by wdso
1 290 posted 12 years ago by chrisaiv
3 379 posted 12 years ago by sionnnn
1 322 posted 12 years ago by dbug13
Creating a object that doesn't have any methods in Ruby (regular objects inherit methods from Object class), useful for Proxies that use method missing (http://onestepback.org/index.cgi/Tech/Ruby/BlankSlate.rdoc).
1 449 posted 12 years ago by narkisr
An example of redo statement in Ruby, redo makes an iteration step repeat itself again (http://www.rubyrailways.com/rubys-most-underused-keyword/).
1 261 posted 12 years ago by narkisr
1 2 3 4 5 6 7 ... 12