Rails new:
-T #do not generate a test Directory; do this to replace test with Rspec also need to install Rspec $rails generate rspec:install
I started this blog as a personal notepad, but it seems I'm getting more and more hits. Since people are reading this I starting sharing anything that I find interesting or usfull. I'm currently dedicating my time to expanding my knowledge into the more modern languages and ideas. If you find this information useful or a waste of your tome let me know by leaving commits or using the google +1 function at the bottom of the post. Thanks for viewing Daniel Haro
Showing posts with label ruby. Show all posts
Showing posts with label ruby. Show all posts
Saturday, August 11, 2012
Ruby programming !sort
I was searching for a quick way to sort objects in Ruby and
I found this ingenious method online.
deviceArray.sort! {|a,b| a.getName.downcase <=> b.getName.downcase}
notes
deviceArray : an array of objects of type device
downcase : only needed if sorting alpa numerically or can use upcase
Subscribe to:
Posts (Atom)