prime_time 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +14 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +42 -0
- data/Rakefile +10 -0
- data/bin/primetime +10 -0
- data/lib/prime_time.rb +7 -0
- data/lib/prime_time/calculate.rb +36 -0
- data/lib/prime_time/prime_table.rb +23 -0
- data/lib/prime_time/table.rb +67 -0
- data/lib/prime_time/version.rb +3 -0
- data/prime_time.gemspec +24 -0
- data/spec/calculate_spec.rb +63 -0
- data/spec/prime_table_spec.rb +37 -0
- data/spec/spec_helper.rb +1 -0
- data/spec/table_spec.rb +61 -0
- metadata +108 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 3efeb837e9715e4e896a0142c21e7fdd070798de
|
4
|
+
data.tar.gz: 23c612ee3dbf7155e68c0e4769da55ae8793de05
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 66a12d98dbffc4d291ac7c2abe74b031484dc6cadc97a05dd719badafb4f52c20d94b8f3192b25a9d334a7369d03eb50425b42f362bcb678c776be0628be2f0e
|
7
|
+
data.tar.gz: 79521f397e5073957a73f41119bd6bed63abc0225f08af016d2ccd42ea69ef46fc17cf6fe05c3a458479c7c40d3773fea5cde26c0cc3f4094a16495cd0349b2e
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2015 Dru Ibarra
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,42 @@
|
|
1
|
+
# PrimeTime
|
2
|
+
|
3
|
+
Command line program that prints out a table of primes with each cell containing the product of the primes.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
gem 'prime_time'
|
11
|
+
```
|
12
|
+
|
13
|
+
And then execute:
|
14
|
+
|
15
|
+
$ bundle
|
16
|
+
|
17
|
+
Or install it yourself as:
|
18
|
+
|
19
|
+
$ gem install prime_time
|
20
|
+
|
21
|
+
## Usage
|
22
|
+
|
23
|
+
$ primetime 10
|
24
|
+
x 2 3 5 7 11 13 17 19 23 29
|
25
|
+
2 4 6 10 14 22 26 34 38 46 58
|
26
|
+
3 6 9 15 21 33 39 51 57 69 87
|
27
|
+
5 10 15 25 35 55 65 85 95 115 145
|
28
|
+
7 14 21 35 49 77 91 119 133 161 203
|
29
|
+
11 22 33 55 77 121 143 187 209 253 319
|
30
|
+
13 26 39 65 91 143 169 221 247 299 377
|
31
|
+
17 34 51 85 119 187 221 289 323 391 493
|
32
|
+
19 38 57 95 133 209 247 323 361 437 551
|
33
|
+
23 46 69 115 161 253 299 391 437 529 667
|
34
|
+
29 58 87 145 203 319 377 493 551 667 841
|
35
|
+
|
36
|
+
## Contributing
|
37
|
+
|
38
|
+
1. Fork it ( https://github.com/[my-github-username]/prime_time/fork )
|
39
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
40
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
41
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
42
|
+
5. Create a new Pull Request
|
data/Rakefile
ADDED
data/bin/primetime
ADDED
data/lib/prime_time.rb
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
module PrimeTime
|
2
|
+
module Calculate
|
3
|
+
|
4
|
+
class << self
|
5
|
+
def primes(n)
|
6
|
+
result = []
|
7
|
+
i = 2
|
8
|
+
|
9
|
+
while result.size < n do
|
10
|
+
result << i if is_prime?(i)
|
11
|
+
(i % 2 == 0)? i += 1 : i += 2
|
12
|
+
end
|
13
|
+
|
14
|
+
result
|
15
|
+
end
|
16
|
+
|
17
|
+
# worst case O(sqrt(n)/2)
|
18
|
+
def is_prime?(n)
|
19
|
+
n = n.to_i
|
20
|
+
return false if n == 1 || n < 0 # 1 and negative numbers are not prime
|
21
|
+
return true if n == 2 # 2 is a special case the only even prime
|
22
|
+
return false if n % 2 == 0 # even numbers are not prime
|
23
|
+
|
24
|
+
# start with 3 and go up to the square root of n to see is divisable
|
25
|
+
divisor = 3
|
26
|
+
while divisor <= Math.sqrt(n)
|
27
|
+
return false if n % divisor == 0
|
28
|
+
divisor += 2
|
29
|
+
end
|
30
|
+
|
31
|
+
true
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
module PrimeTime
|
2
|
+
class PrimeTable < Table
|
3
|
+
attr_accessor :primes
|
4
|
+
|
5
|
+
def initialize(n)
|
6
|
+
@primes = PrimeTime::Calculate.primes(n)
|
7
|
+
super(width: n, height: n)
|
8
|
+
build_table
|
9
|
+
end
|
10
|
+
|
11
|
+
private
|
12
|
+
def build_table
|
13
|
+
self.col_headers = self.primes
|
14
|
+
self.row_headers = self.primes
|
15
|
+
|
16
|
+
self.row_headers.each_with_index do |row_header, row_i|
|
17
|
+
self.col_headers.each_with_index do |col_header, col_i|
|
18
|
+
self.rows[row_i][col_i] = row_header * col_header
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,67 @@
|
|
1
|
+
module PrimeTime
|
2
|
+
class Table
|
3
|
+
attr_accessor :width, :height, :col_headers, :row_headers, :rows
|
4
|
+
|
5
|
+
def initialize(width: 1, height: 1)
|
6
|
+
@width = width
|
7
|
+
@height = height
|
8
|
+
@col_headers = Array.new(width).fill(' ')
|
9
|
+
@row_headers = Array.new(height).fill(' ')
|
10
|
+
@rows = Array.new
|
11
|
+
height.times do
|
12
|
+
@rows << Array.new(width).fill('-')
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
def to_s
|
17
|
+
String.new.tap { |table_string|
|
18
|
+
table_string << col_header_string
|
19
|
+
|
20
|
+
self.rows.each_with_index do |r, i|
|
21
|
+
table_string << row_string(r, i)
|
22
|
+
end
|
23
|
+
}.to_s.strip
|
24
|
+
end
|
25
|
+
|
26
|
+
private
|
27
|
+
def col_header_string
|
28
|
+
s = self.col_headers.collect do |header|
|
29
|
+
header.to_s.rjust(cell_padding_value)
|
30
|
+
end
|
31
|
+
|
32
|
+
corner = 'x'.ljust(row_header_padding_vale)
|
33
|
+
"#{corner} #{s.join(' ')}\n"
|
34
|
+
end
|
35
|
+
|
36
|
+
def row_string(row, index)
|
37
|
+
row_header = self.row_headers[index]
|
38
|
+
s = row.collect do |cell|
|
39
|
+
cell.to_s.rjust(cell_padding_value)
|
40
|
+
end
|
41
|
+
|
42
|
+
"#{row_header.to_s.ljust(row_header_padding_vale)} #{s.join(' ')}\n"
|
43
|
+
end
|
44
|
+
|
45
|
+
def max_cell_value
|
46
|
+
result = nil
|
47
|
+
self.rows.each do |row|
|
48
|
+
max_value_in_row = row.map(&:to_i).sort.last
|
49
|
+
result = max_value_in_row if result.nil? || max_value_in_row > result
|
50
|
+
end
|
51
|
+
result
|
52
|
+
end
|
53
|
+
|
54
|
+
def max_row_header_value
|
55
|
+
self.row_headers.map(&:to_i).sort.last
|
56
|
+
end
|
57
|
+
|
58
|
+
def cell_padding_value
|
59
|
+
max_cell_value.to_s.size
|
60
|
+
end
|
61
|
+
|
62
|
+
def row_header_padding_vale
|
63
|
+
max_row_header_value.to_s.size
|
64
|
+
end
|
65
|
+
|
66
|
+
end
|
67
|
+
end
|
data/prime_time.gemspec
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'prime_time/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "prime_time"
|
8
|
+
spec.version = PrimeTime::VERSION
|
9
|
+
spec.authors = ["Dru Ibarra"]
|
10
|
+
spec.email = ["Druwerd@gmail.com"]
|
11
|
+
spec.summary = %q{Prints out a multiplication table of prime numbers}
|
12
|
+
spec.description = %q{Command line program that prints out a table of primes with each cell containing the product of the primes.}
|
13
|
+
spec.homepage = ""
|
14
|
+
spec.license = "MIT"
|
15
|
+
|
16
|
+
spec.files = `git ls-files -z`.split("\x0")
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
+
spec.require_paths = ["lib"]
|
20
|
+
|
21
|
+
spec.add_development_dependency "bundler", "~> 1.7"
|
22
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
23
|
+
spec.add_development_dependency "rspec", "~> 3.1"
|
24
|
+
end
|
@@ -0,0 +1,63 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe PrimeTime::Calculate do
|
4
|
+
|
5
|
+
describe ".is_prime?" do
|
6
|
+
it "can detect if a number is prime" do
|
7
|
+
expect(PrimeTime::Calculate.is_prime?(2)).to be true
|
8
|
+
expect(PrimeTime::Calculate.is_prime?(3)).to be true
|
9
|
+
expect(PrimeTime::Calculate.is_prime?(5)).to be true
|
10
|
+
expect(PrimeTime::Calculate.is_prime?(7)).to be true
|
11
|
+
expect(PrimeTime::Calculate.is_prime?(11)).to be true
|
12
|
+
expect(PrimeTime::Calculate.is_prime?(13)).to be true
|
13
|
+
expect(PrimeTime::Calculate.is_prime?(17)).to be true
|
14
|
+
expect(PrimeTime::Calculate.is_prime?(19)).to be true
|
15
|
+
expect(PrimeTime::Calculate.is_prime?(23)).to be true
|
16
|
+
expect(PrimeTime::Calculate.is_prime?(29)).to be true
|
17
|
+
expect(PrimeTime::Calculate.is_prime?(71)).to be true
|
18
|
+
expect(PrimeTime::Calculate.is_prime?(113)).to be true
|
19
|
+
expect(PrimeTime::Calculate.is_prime?(173)).to be true
|
20
|
+
expect(PrimeTime::Calculate.is_prime?(229)).to be true
|
21
|
+
expect(PrimeTime::Calculate.is_prime?(281)).to be true
|
22
|
+
expect(PrimeTime::Calculate.is_prime?(349)).to be true
|
23
|
+
expect(PrimeTime::Calculate.is_prime?(409)).to be true
|
24
|
+
expect(PrimeTime::Calculate.is_prime?(7919)).to be true
|
25
|
+
expect(PrimeTime::Calculate.is_prime?(99971)).to be true
|
26
|
+
expect(PrimeTime::Calculate.is_prime?(104729)).to be true
|
27
|
+
end
|
28
|
+
|
29
|
+
it "can detect if a number is not prime" do
|
30
|
+
expect(PrimeTime::Calculate.is_prime?(-7919)).to be false
|
31
|
+
expect(PrimeTime::Calculate.is_prime?(-1009)).to be false
|
32
|
+
expect(PrimeTime::Calculate.is_prime?(-3)).to be false
|
33
|
+
expect(PrimeTime::Calculate.is_prime?(-2)).to be false
|
34
|
+
expect(PrimeTime::Calculate.is_prime?(-1)).to be false
|
35
|
+
expect(PrimeTime::Calculate.is_prime?(0)).to be false
|
36
|
+
expect(PrimeTime::Calculate.is_prime?(1)).to be false
|
37
|
+
expect(PrimeTime::Calculate.is_prime?(4)).to be false
|
38
|
+
expect(PrimeTime::Calculate.is_prime?(10)).to be false
|
39
|
+
expect(PrimeTime::Calculate.is_prime?(49)).to be false
|
40
|
+
expect(PrimeTime::Calculate.is_prime?(50)).to be false
|
41
|
+
expect(PrimeTime::Calculate.is_prime?(100)).to be false
|
42
|
+
expect(PrimeTime::Calculate.is_prime?(121)).to be false
|
43
|
+
expect(PrimeTime::Calculate.is_prime?(169)).to be false
|
44
|
+
expect(PrimeTime::Calculate.is_prime?(534535)).to be false
|
45
|
+
expect(PrimeTime::Calculate.is_prime?(3424235)).to be false
|
46
|
+
expect(PrimeTime::Calculate.is_prime?(23434349)).to be false
|
47
|
+
expect(PrimeTime::Calculate.is_prime?(100000001)).to be false
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
describe ".primes" do
|
52
|
+
it "returns a list of the first n primes" do
|
53
|
+
expect(PrimeTime::Calculate.primes(0)).to eq []
|
54
|
+
expect(PrimeTime::Calculate.primes(1)).to eq [2]
|
55
|
+
expect(PrimeTime::Calculate.primes(2)).to eq [2, 3]
|
56
|
+
expect(PrimeTime::Calculate.primes(5)).to eq [2, 3, 5, 7, 11]
|
57
|
+
expect(PrimeTime::Calculate.primes(10)).to eq [2, 3, 5, 7, 11, 13, 17, 19, 23, 29]
|
58
|
+
expect(PrimeTime::Calculate.primes(20)).to eq [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71]
|
59
|
+
expect(PrimeTime::Calculate.primes(100)).to eq [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541]
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe PrimeTime::PrimeTable do
|
4
|
+
|
5
|
+
describe "#initialize" do
|
6
|
+
subject(:new_prime_table) { PrimeTime::PrimeTable.new(10)}
|
7
|
+
|
8
|
+
it "creates a PrimeTable instance" do
|
9
|
+
expect(new_prime_table).to be_a PrimeTime::PrimeTable
|
10
|
+
end
|
11
|
+
|
12
|
+
it "has width" do
|
13
|
+
expect(new_prime_table.width).to be 10
|
14
|
+
end
|
15
|
+
|
16
|
+
it "has height" do
|
17
|
+
expect(new_prime_table.height).to be 10
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
context "5 by 5 PrimeTable" do
|
22
|
+
subject(:five_by_five_prime_table) { PrimeTime::PrimeTable.new(5) }
|
23
|
+
subject(:five_by_five_prime_table_string) {
|
24
|
+
%Q(x 2 3 5 7 11
|
25
|
+
2 4 6 10 14 22
|
26
|
+
3 6 9 15 21 33
|
27
|
+
5 10 15 25 35 55
|
28
|
+
7 14 21 35 49 77
|
29
|
+
11 22 33 55 77 121)
|
30
|
+
}
|
31
|
+
|
32
|
+
it "prints to STDOUT" do
|
33
|
+
expect(five_by_five_prime_table.to_s).to eq(five_by_five_prime_table_string)
|
34
|
+
end
|
35
|
+
|
36
|
+
end
|
37
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require 'prime_time'
|
data/spec/table_spec.rb
ADDED
@@ -0,0 +1,61 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe PrimeTime::Table do
|
4
|
+
|
5
|
+
describe "#initialize" do
|
6
|
+
it "creates a Table instance" do
|
7
|
+
expect(PrimeTime::Table.new).to be_a PrimeTime::Table
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
context "empty table" do
|
12
|
+
subject(:empty_table) { PrimeTime::Table.new(width: 5, height: 5)}
|
13
|
+
subject(:empty_table_string){
|
14
|
+
%Q(x
|
15
|
+
- - - - -
|
16
|
+
- - - - -
|
17
|
+
- - - - -
|
18
|
+
- - - - -
|
19
|
+
- - - - -)
|
20
|
+
}
|
21
|
+
|
22
|
+
it "has width" do
|
23
|
+
expect(empty_table.width).to be 5
|
24
|
+
end
|
25
|
+
|
26
|
+
it "has height" do
|
27
|
+
expect(empty_table.height).to be 5
|
28
|
+
end
|
29
|
+
|
30
|
+
it "prints to STDOUT" do
|
31
|
+
expect(empty_table.to_s).to eq(empty_table_string)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
context "5 by 5 multiplication table" do
|
36
|
+
subject(:five_by_five_table) { PrimeTime::Table.new(width: 5, height: 5)}
|
37
|
+
subject(:five_by_five_table_string) {
|
38
|
+
%Q(x 1 2 3 4 5
|
39
|
+
1 1 2 3 4 5
|
40
|
+
2 2 4 6 8 10
|
41
|
+
3 3 6 9 12 15
|
42
|
+
4 4 8 12 16 20
|
43
|
+
5 5 10 15 20 25)
|
44
|
+
}
|
45
|
+
|
46
|
+
before {
|
47
|
+
five_by_five_table.col_headers = %w(1 2 3 4 5)
|
48
|
+
five_by_five_table.row_headers = %w(1 2 3 4 5)
|
49
|
+
five_by_five_table.rows[0] = %w(1 2 3 4 5)
|
50
|
+
five_by_five_table.rows[1] = %w(2 4 6 8 10)
|
51
|
+
five_by_five_table.rows[2] = %w(3 6 9 12 15)
|
52
|
+
five_by_five_table.rows[3] = %w(4 8 12 16 20)
|
53
|
+
five_by_five_table.rows[4] = %w(5 10 15 20 25)
|
54
|
+
}
|
55
|
+
|
56
|
+
it "prints to STDOUT" do
|
57
|
+
expect(five_by_five_table.to_s).to eq(five_by_five_table_string)
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
end
|
metadata
ADDED
@@ -0,0 +1,108 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: prime_time
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Dru Ibarra
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-01-10 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.7'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.7'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '3.1'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '3.1'
|
55
|
+
description: Command line program that prints out a table of primes with each cell
|
56
|
+
containing the product of the primes.
|
57
|
+
email:
|
58
|
+
- Druwerd@gmail.com
|
59
|
+
executables:
|
60
|
+
- primetime
|
61
|
+
extensions: []
|
62
|
+
extra_rdoc_files: []
|
63
|
+
files:
|
64
|
+
- ".gitignore"
|
65
|
+
- Gemfile
|
66
|
+
- LICENSE.txt
|
67
|
+
- README.md
|
68
|
+
- Rakefile
|
69
|
+
- bin/primetime
|
70
|
+
- lib/prime_time.rb
|
71
|
+
- lib/prime_time/calculate.rb
|
72
|
+
- lib/prime_time/prime_table.rb
|
73
|
+
- lib/prime_time/table.rb
|
74
|
+
- lib/prime_time/version.rb
|
75
|
+
- prime_time.gemspec
|
76
|
+
- spec/calculate_spec.rb
|
77
|
+
- spec/prime_table_spec.rb
|
78
|
+
- spec/spec_helper.rb
|
79
|
+
- spec/table_spec.rb
|
80
|
+
homepage: ''
|
81
|
+
licenses:
|
82
|
+
- MIT
|
83
|
+
metadata: {}
|
84
|
+
post_install_message:
|
85
|
+
rdoc_options: []
|
86
|
+
require_paths:
|
87
|
+
- lib
|
88
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
89
|
+
requirements:
|
90
|
+
- - ">="
|
91
|
+
- !ruby/object:Gem::Version
|
92
|
+
version: '0'
|
93
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
94
|
+
requirements:
|
95
|
+
- - ">="
|
96
|
+
- !ruby/object:Gem::Version
|
97
|
+
version: '0'
|
98
|
+
requirements: []
|
99
|
+
rubyforge_project:
|
100
|
+
rubygems_version: 2.4.4
|
101
|
+
signing_key:
|
102
|
+
specification_version: 4
|
103
|
+
summary: Prints out a multiplication table of prime numbers
|
104
|
+
test_files:
|
105
|
+
- spec/calculate_spec.rb
|
106
|
+
- spec/prime_table_spec.rb
|
107
|
+
- spec/spec_helper.rb
|
108
|
+
- spec/table_spec.rb
|