Skip to content

hanchang/reverse-polish-notation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Reverse Polish Notation Calculator

Demo is available at: http://reverse-polish-notation.herokuapp.com

Algorithm derived from: http://en.wikipedia.org/wiki/Reverse_Polish_notation#Current_implementations

Dependencies

This Rails 3.2.12 project uses HAML, RSpec, and Webrat, which means Nokogiri is required.

On Ubuntu / Debian systems, you may have to install some libraries for Nokogiri:

sudo apt-get install libxslt1-dev libxml2-dev

No database is used whatsoever as it was unnecessary.

Installation

bundle install

Running Tests

rake

I neglected to write view tests and only wrote controller tests.

Improvements

The following areas could be improved:

  • Allow all valid Ruby operators by using Ruby metaprogramming instead of whitelisting approved operators
  • Moving the calculator logic into a model or library for a slimmer controller and eschewing private controller method tests
  • Some front end tender love and care
  • Trying my hand at a decimal compatible RPN?

About

Reverse Polish Notation Calculator

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors