Live Calculator + Math module using ruby and sinatra this calculator will open port 3000 using sinatra and listen on two paths the root (localhost:3000/) to load the calculator HTML and /calc path (localhost:3000/calc) to evaluate expression when you write any expression such as (2+2) javascrip will send the expression as you type to /calc path and get teh result into a div with id=result i included the Math module so you can use cos, sin, tan and any method within the ruby Math Module. also as this calculator uses eval method you can use it to evaluate a pure ruby expression such as Emad *10 this will print Emad 10 times have fun and let me know how did you use it ;) Gist: https://gist.github/9565542
Posted on: Sat, 15 Mar 2014 12:13:41 +0000