Sha256: 4c09295c7860f3079e7051896def27c981def85dc7c47a6dc6177de7b0ddec04

Contents?: true

Size: 1.59 KB

Versions: 3

Compression:

Stored size: 1.59 KB

Contents

## Table of Contents
* [Scope](#scope)
* [Design](#design)
  * [SRP](#srp)
  * [Roman numerals](#roman-numerals)
* [Installation](#installation)
* [Usage](#usage)
  * [CLI](#cli)

## Scope
This gem is the Ruby implementation of the `Merchant's Guide to the Galaxy` code-kata.

## Design

### SRP
The code design follows the single responsibility principle by using a dedicated class/module for any specific task.  

### Roman numerals
The design behind the `Roman numerals` logic was inspired by Sandi Metz's [solution](https://www.sandimetz.com/blog/2016/6/9/make-everything-the-same): in the beginning roman numerals can be expressed both with `subtractive` (eg `IV`) and `additive` (eg `IIII`) form. 
Switching to the additive form makes easier to convert to Arabic numerals.  

## Installation
Install the gem from your shell:
```shell
gem install galaxy_converter
```

## Usage

### CLI
The gem provides a CLI interface. 
The program accepts as input a file containing several conversion notes:
```txt
# ~/notes.txt
glob is I
prok is V
pish is X
tegj is L
glob glob Silver is 34 Credits
glob prok Gold is 57800 Credits
pish pish Iron is 3910 Credits
how much is pish tegj glob glob ?
how many Credits is glob prok Silver ?
how many Credits is glob prok Gold ?
how many Credits is glob prok Iron ?
how much wood could a woodchuck chuck if a woodchuck could chuck wood ?
```

Just pass the file path to the program:
```shell
galaxy_converter ~/notes.txt
> pish tegj glob glob is 42
> glob prok Silver is 68 Credits
> glob prok Gold is 57800 Credits
> glob prok Iron is 782 Credits
> I have no idea what you are talking about
```

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
galaxy_converter-3.1.2 README.md
galaxy_converter-3.1.1 README.md
galaxy_converter-3.0.1 README.md