https://github.com/nisevi/primes_table
Command line tool for printing a multiplication table of the first N prime numbers.
https://github.com/nisevi/primes_table
codeclimate codecoverage gem gems methadone multiplication-tables oop oop-principles prime-matrix prime-numbers primes primes-search-algorithm rspec ruby ruby-gem ruby-gems ruby-library semaphoreci sieve-of-eratosthenes simplecov
Last synced: 3 months ago
JSON representation
Command line tool for printing a multiplication table of the first N prime numbers.
- Host: GitHub
- URL: https://github.com/nisevi/primes_table
- Owner: nisevi
- License: apache-2.0
- Created: 2018-04-16T15:46:17.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2021-07-27T02:15:03.000Z (over 4 years ago)
- Last Synced: 2025-02-04T16:34:13.107Z (about 1 year ago)
- Topics: codeclimate, codecoverage, gem, gems, methadone, multiplication-tables, oop, oop-principles, prime-matrix, prime-numbers, primes, primes-search-algorithm, rspec, ruby, ruby-gem, ruby-gems, ruby-library, semaphoreci, sieve-of-eratosthenes, simplecov
- Language: Ruby
- Homepage: https://rubygems.org/gems/primes_table
- Size: 93.8 KB
- Stars: 0
- Watchers: 3
- Forks: 1
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
[](https://codeclimate.com/github/nisevi/primes_table/maintainability) [](https://codeclimate.com/github/nisevi/primes_table/test_coverage) [](https://semaphoreci.com/nisevi/primes_table) [](https://badge.fury.io/rb/primes_table)
[](https://app.fossa.io/projects/git%2Bgithub.com%2Fnisevi%2Fprimes_table?ref=badge_shield)
# PrimesTable
Command line tool for printing out a multiplication table of the first N prime numbers.
## Installation
Add this line to your application's Gemfile:
```ruby
gem 'primes_table'
```
And then execute:
$ bundle
Or install it yourself as:
$ gem install primes_table
## Usage
- By default the table will be generated as a matrix of 10X10;
- Only values greater or equal than 10 will be considered for specifying rows or columns;
- If you enter a value minor than 10, it will default to 10;
- Only integer values are considered. For example, if you enter an string, it will be converted to integer, the result will be 0 (zero) and will default to 10 because zero is minor than 10;
- Options:
- `-h, --help` to see the available options;
- `-r, --rows ROWS` to specify how many rows;
- `-c, --columns COLUMNS` to specify how many columns;
- `--version` it will give you the version of the gem you are using;
- Command examples:
- `primes_table --version`;
- `primes_table --help`;
- `primes_table`;
- `primes_table -r 17`;
- `primes_table -c 23`;
- `primes_table -r 17 -c 23`;
## Tests
- Rspec:
- `bundle exec rspec`
## Development
When working on this gem locally, if you want to run it, you just need to:
`$ bundle exec bin/primes_table`
and you will get the default output:
| | 2 | 3 | 5 | 7 |
|:---:|:----:|:---:|:----:|:----:|
| 2 | 4 | 6 | 10 | 14 |
| 3 | 6 | 9 | 15 | 21 |
| 5 | 10 | 15 | 25 | 35 |
| 7 | 14 | 21 | 35 | 49 |
## License
[](https://app.fossa.io/projects/git%2Bgithub.com%2Fnisevi%2Fprimes_table?ref=badge_large)