Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/demonstrandum/coins
A simple live terminal currency exchange rate converter in Ruby
https://github.com/demonstrandum/coins
api coins currencies exchange fixer-io linux ruby unix
Last synced: 10 days ago
JSON representation
A simple live terminal currency exchange rate converter in Ruby
- Host: GitHub
- URL: https://github.com/demonstrandum/coins
- Owner: Demonstrandum
- License: gpl-3.0
- Created: 2017-05-16T22:56:12.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-06-01T21:08:41.000Z (over 7 years ago)
- Last Synced: 2024-09-18T11:46:29.414Z (about 2 months ago)
- Topics: api, coins, currencies, exchange, fixer-io, linux, ruby, unix
- Language: Ruby
- Homepage:
- Size: 19.5 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Coins
A simple live terminal currency exchange rate converter in RubyThe currencies are retrieved from [fixer.io](http://fixer.io/) which is a "Foreign exchange rates and currency conversion API" which is a JSON API published by the 'European Central Bank'
The rates are updated daily around 4 PM CET
## Installation
Install the command line application with ruby-gems through rubygems.org
by typing:
```shell
gem install coins
```
you might need to use `sudo`, if the command fails type `sudo !-1`If you prefer to build from source:
```shell
git clone https://github.com/Demonstrandum/Coins.git && cd Coins
gem build coins.gemspec
gem install coins-*.gem
```## Usage
This application is meant purely as a terminal tool.To convert between an amount of money between currencies, simply put:
`from [amount] [currency] to [other currency]` for example:
```shell
coins from 6 GBP to NOK
coins to NOK from 6 GBP
```
either will work just the same.To print all known currencies
```shell
coins rates
```
This will default to showing the currencies against the US dollar (USD).
To change this simply add the word `against CUR` where `CUR` is the currency to check against, e.g. `GBP` (Great British Pound), or use the word `base` instead, anywhere in the command arguments.For example:
```shell
coins rates against GBP
coins base GBP rates
```
both will work.To print a single rate, write rate and the currency, (still defaults to USD if no other currency is specified in either `base` or `against`)
```shell
coins against EUR rate NOK
coins rate NOK base EUR
```