A simple command line calculator
Ruby
Switch branches/tags
Nothing to show
Pull request Compare This branch is 1 commit behind juanje:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
bin
features
lib
.gitignore
Gemfile
README.rdoc
Rakefile
rcalc.gemspec
rcalc.rdoc

README.rdoc

rcalc

A simple command line calculator

Description

This is a very simple and silly tool for educational purposes. It is meant to be a project for practise how to create a command-suite CLI using GLI and how to create a project driven by behavior with Cucumber.

Install

You can install from the sources by doing:

git clone git://github.com/juanje/rcalc.git
cd rcalc
rake gem
gem install pkg/rcalc-*.gem

Usage

The usage is quite simple and you can get the help by typing rcalc. You'll get a info like this:

A simple command line calculator

usage: rcalc [global options] command [command options]

Version: 0.0.1

Global Options:
    --help - Show this message

Commands:
    divide    - Divide two numbers
    help      - Shows list of commands or help for one command
    multiply  - Multiply two numbers
    substract - Substract to numbers
    sum       - Sum two numbers

Testing features

The features are written using Cucumber and are under the directory features.

features/
├── adding.feature
├── division.feature
├── multiply.feature
├── substract.feature
└── step_definitions
    └── calculator_steps.rb

To test the features you'll need to install the gem cucumber and gli. The best way to be sure you don't miss any dependency is by running:

bundle install

Then you just need to run the features:

rake features