To we understand the concepts, let's create a sinatra app, that will simple calculate the inputs.
You're not limited by any structure files. Do what you learn in the last few days.
Create the base app, adding the Gemfile (including the lock one), the rb files following the "rackup way", with a route /status
that should returns a simple text "OK". Also add the rspecs for that. The server should be able to run with "bundle exec rackup". The rspec should cover the /status
.
Add the root route (/
) that will receive the inputs and respond to the user. Use the ERB template render to show the calculator/input form, and the response. You can use the same path for both (form and response).
Add the +
(sum), -
(minus) and *
(multiplication) operations. Anything besides that should throw an exception/error message to the user.
Rspec are mandatory.
ATTENTION! You do not need a fancy template in this task.
Add in the calculator the divisor operator. Remember! We cannot divide by some numbers, treat it!
Only to show that you can.
Improve the calculator adding a custom HTML. Use your creativity.
Make your application fancy! Besides that we're a backend class, we also gonna need to write some interface. Add a custom CSS to improve the calculator.