23 May '14, 11am

Exception handling, the #ruby way...

At some point every apprentice is tempted to look for a quick escape from a self-painted corner. The apprentice sees the trap of her own making at the bottom of many nested methods or loops. "I know!" she thinks. "I'll jump out with an exception!" But therein lies danger: exceptions are meant to be quite literal . One should raise an exception under exceptional circumstances , and only then. The temptation to use exceptions to move about the code is one we all experience; don't worry. But that doesn't make it any less wrong. "Moving about the code" is known in fancy circles as "flow control." Your tools for flow control include if (and its friends, unless and else ), Enumerable#each , for , method calls, and the like. The reason not to use exceptions for flow control isn't simply one of semantics, either. Exceptions are designed to provide you, the programmer, with as much...

Full article: http://rubymonk.com/learning/books/4-ruby-primer-ascent/c...

Tweets

Mocking and Ruby

rubyflow.com 22 May '14, 11am

Mocking and Ruby Posted by solnic on May 22, 2014 — 0 comments Here are some thoughts about mocking and ruby: Mocking and ...

@cdl yes. it's pretty much possible with any ru...

sinatrarb.com 30 May '14, 8pm

helper. This addon improves the streaming API by making the stream object immitate an IO object, turing it into a real Def...

[Ben Krasnow] and His 8 kJ Ruby Laser

hackaday.com 23 May '14, 5pm

We were again pleased to find another person who attended Maker Faire just to show off the awesome and not to hawk some go...

My first "useful" Ruby gem:

rubygems.org 26 May '14, 10pm

FancyOpenStruct is a subclass of OpenStruct, and is a variant of RecursiveOpenStruct. It differs from OpenStruct in that i...

`define_method` like a BOSS. #ruby

apidock.com 24 May '14, 10pm

Defines an instance method in the receiver. The method parameter can be a Proc, a Method or an UnboundMethod object. If a ...

"Ruby even lets you put semicolons at the ends ...

railstutorial.org 28 May '14, 6pm

The Ruby on Rails Tutorial book and screencast series teach you how to develop and deploy real, industrial-strength web ap...

VIDEO: Chinese men catch baby falling from building

VIDEO: Chinese men catch baby falling from buil...

straitstimes.com 23 May '14, 9am

BEIJING (AFP) - Dramatic images of two Chinese men catching a young child after he fell from a second storey window were r...

ActiveResourceってよくわかってなかったけど、これ使えばredmineから情報落と...

redmine.org 25 May '14, 11am

Redmine REST API follows the Rails's RESTful conventions, so using it with ActiveResource is pretty straightforward. Activ...

Just noticed that my last project in #ruby went...

rubygems.org 27 May '14, 5am

Exodus is a migration framework for MongoDb

Thanks to @ChrisGSeaton for starting a Ruby res...

rubyspec.org 29 May '14, 3pm

Ruby hasn't historically been the subject of many research projects. A lot of systems research has used languages like C, ...