juanje/rcalc — pull request #1 by ayosec (2012-02-18 16:21:12+00:00)
Title: The “Just for the lulz” pull request

This _pull request_ contains some changes that I'd like.

Furthermore, I think that the `bin/rcalc` should be redone. Maybe, a `Calculator` class with all the operations. You could have a class method `with_operands`

```ruby
class Calculator
def self.with_operands(operands)
calc = new
calc.operands = operands.map {|operand| parse_operand(operand) }
end

def self.parse_operand(operand)
# ...
```

The `parse_operand`can validate the format (with a _regexp_, `to_i`, whatever) and transform it to a numeric object. Some strings can have an special value, like `pi` or `e`.

This make much easier to test the code. Right now, you run a new `ruby` command with the parameters. If there is any exception in the code, your only feedback is that the `$?.success?` is false.