Hi Friend! This is a static copy of Mendicant's old Community Site. This project has been sunset therefore we are no longer updating it. For the latest news about the school, check out our main site. Thanks for visiting!
Dentaku - a calculator for Ruby

I recently released Dentaku, a gem for parsing and evaluating math and logic expressions in Ruby. You can use it to evaluate expressions like:

calculator = Dentaku::Calculator.new
calculator.evaluate('10 + 2')
=> 12

This is not especially useful, but you can also use named variables that get substituted in at runtime, like so:

calculator.evaluate('10 * x', :x => 3)
=> 30

So what would something like this be useful for? Check out "Dentaku - a calculator for Ruby", my blog article that explains the motivation behind the gem with a use case.

« There is more where that came from