funding_primer 0.2.2 → 0.3.0

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.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- funding_primer (0.1.2)
4
+ funding_primer (0.2.2)
5
5
  gem-man (~> 0.3.0)
6
6
  methadone (~> 1.2.2)
7
7
  rainbow (~> 1.1.4)
@@ -50,6 +50,6 @@ PLATFORMS
50
50
  DEPENDENCIES
51
51
  aruba
52
52
  funding_primer!
53
- rake (~> 0.9.2)
53
+ rake
54
54
  rdoc
55
55
  rspec
data/README.md CHANGED
@@ -29,6 +29,8 @@ Or install it yourself as:
29
29
  funding_primer --help
30
30
  gem man funding_primer
31
31
 
32
+ [RDoc](http://rubydoc.info/github/mattgibb/funding_primer)
33
+
32
34
  ## Usage
33
35
 
34
36
  funding_primer # prints a multiplication table of the first 10 primes
data/bin/funding_primer CHANGED
@@ -20,7 +20,8 @@ class App
20
20
  end
21
21
  end
22
22
 
23
- matrix = MultiplicationTable.new(1..Integer(number_of_primes)).with_headings
23
+ primes = Prime.first(Integer number_of_primes)
24
+ matrix = MultiplicationTable.new(primes).with_headings
24
25
 
25
26
  if options[:color]
26
27
  matrix = ColorMatrix.new(matrix)
@@ -7,29 +7,29 @@ Feature: Funding Primer outputs a table of prime numbers
7
7
  When I run `funding_primer`
8
8
  Then the output should contain exactly:
9
9
  """
10
- +----+----+----+----+----+----+----+----+----+----+-----+
11
- | | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
12
- +----+----+----+----+----+----+----+----+----+----+-----+
13
- | 1 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
14
- +----+----+----+----+----+----+----+----+----+----+-----+
15
- | 2 | 2 | 4 | 6 | 8 | 10 | 12 | 14 | 16 | 18 | 20 |
16
- +----+----+----+----+----+----+----+----+----+----+-----+
17
- | 3 | 3 | 6 | 9 | 12 | 15 | 18 | 21 | 24 | 27 | 30 |
18
- +----+----+----+----+----+----+----+----+----+----+-----+
19
- | 4 | 4 | 8 | 12 | 16 | 20 | 24 | 28 | 32 | 36 | 40 |
20
- +----+----+----+----+----+----+----+----+----+----+-----+
21
- | 5 | 5 | 10 | 15 | 20 | 25 | 30 | 35 | 40 | 45 | 50 |
22
- +----+----+----+----+----+----+----+----+----+----+-----+
23
- | 6 | 6 | 12 | 18 | 24 | 30 | 36 | 42 | 48 | 54 | 60 |
24
- +----+----+----+----+----+----+----+----+----+----+-----+
25
- | 7 | 7 | 14 | 21 | 28 | 35 | 42 | 49 | 56 | 63 | 70 |
26
- +----+----+----+----+----+----+----+----+----+----+-----+
27
- | 8 | 8 | 16 | 24 | 32 | 40 | 48 | 56 | 64 | 72 | 80 |
28
- +----+----+----+----+----+----+----+----+----+----+-----+
29
- | 9 | 9 | 18 | 27 | 36 | 45 | 54 | 63 | 72 | 81 | 90 |
30
- +----+----+----+----+----+----+----+----+----+----+-----+
31
- | 10 | 10 | 20 | 30 | 40 | 50 | 60 | 70 | 80 | 90 | 100 |
32
- +----+----+----+----+----+----+----+----+----+----+-----+
10
+ +----+----+----+-----+-----+-----+-----+-----+-----+-----+-----+
11
+ | | 2 | 3 | 5 | 7 | 11 | 13 | 17 | 19 | 23 | 29 |
12
+ +----+----+----+-----+-----+-----+-----+-----+-----+-----+-----+
13
+ | 2 | 4 | 6 | 10 | 14 | 22 | 26 | 34 | 38 | 46 | 58 |
14
+ +----+----+----+-----+-----+-----+-----+-----+-----+-----+-----+
15
+ | 3 | 6 | 9 | 15 | 21 | 33 | 39 | 51 | 57 | 69 | 87 |
16
+ +----+----+----+-----+-----+-----+-----+-----+-----+-----+-----+
17
+ | 5 | 10 | 15 | 25 | 35 | 55 | 65 | 85 | 95 | 115 | 145 |
18
+ +----+----+----+-----+-----+-----+-----+-----+-----+-----+-----+
19
+ | 7 | 14 | 21 | 35 | 49 | 77 | 91 | 119 | 133 | 161 | 203 |
20
+ +----+----+----+-----+-----+-----+-----+-----+-----+-----+-----+
21
+ | 11 | 22 | 33 | 55 | 77 | 121 | 143 | 187 | 209 | 253 | 319 |
22
+ +----+----+----+-----+-----+-----+-----+-----+-----+-----+-----+
23
+ | 13 | 26 | 39 | 65 | 91 | 143 | 169 | 221 | 247 | 299 | 377 |
24
+ +----+----+----+-----+-----+-----+-----+-----+-----+-----+-----+
25
+ | 17 | 34 | 51 | 85 | 119 | 187 | 221 | 289 | 323 | 391 | 493 |
26
+ +----+----+----+-----+-----+-----+-----+-----+-----+-----+-----+
27
+ | 19 | 38 | 57 | 95 | 133 | 209 | 247 | 323 | 361 | 437 | 551 |
28
+ +----+----+----+-----+-----+-----+-----+-----+-----+-----+-----+
29
+ | 23 | 46 | 69 | 115 | 161 | 253 | 299 | 391 | 437 | 529 | 667 |
30
+ +----+----+----+-----+-----+-----+-----+-----+-----+-----+-----+
31
+ | 29 | 58 | 87 | 145 | 203 | 319 | 377 | 493 | 551 | 667 | 841 |
32
+ +----+----+----+-----+-----+-----+-----+-----+-----+-----+-----+
33
33
 
34
34
  """
35
35
  And the exit status should be 0
@@ -7,6 +7,6 @@ Feature: Output a pretty table with highlighted headings
7
7
 
8
8
  Scenario: Print colour table
9
9
  When I run `funding_primer 3 --color`
10
- Then the output should contain "| | #{'1'.bright.color :green} | #{'2'.bright.color :green} | #{'3'.bright.color :green} |"
11
- And the output should contain "| #{'1'.bright.color :green} | #{'1'.color :yellow} | 2 | 3 |"
10
+ Then the output should contain "| | #{'2'.bright.color :green} | #{'3'.bright.color :green} | #{'5'.bright.color :green} |"
11
+ And the output should contain "| #{'2'.bright.color :green} | #{'4'.color :yellow} | 6 | 10 |"
12
12
 
@@ -7,15 +7,15 @@ Feature: Output a user-specified number of primes
7
7
  When I run `funding_primer 3`
8
8
  Then the output should contain exactly:
9
9
  """
10
- +---+---+---+---+
11
- | | 1 | 2 | 3 |
12
- +---+---+---+---+
13
- | 1 | 1 | 2 | 3 |
14
- +---+---+---+---+
15
- | 2 | 2 | 4 | 6 |
16
- +---+---+---+---+
17
- | 3 | 3 | 6 | 9 |
18
- +---+---+---+---+
19
-
10
+ +---+----+----+----+
11
+ | | 2 | 3 | 5 |
12
+ +---+----+----+----+
13
+ | 2 | 4 | 6 | 10 |
14
+ +---+----+----+----+
15
+ | 3 | 6 | 9 | 15 |
16
+ +---+----+----+----+
17
+ | 5 | 10 | 15 | 25 |
18
+ +---+----+----+----+
19
+
20
20
  """
21
21
  And the exit status should be 0
@@ -17,7 +17,7 @@ Gem::Specification.new do |gem|
17
17
  gem.add_development_dependency('rspec')
18
18
  gem.add_development_dependency('rdoc')
19
19
  gem.add_development_dependency('aruba')
20
- gem.add_development_dependency('rake', '~> 0.9.2')
20
+ gem.add_development_dependency('rake')
21
21
  gem.add_dependency('methadone', '~> 1.2.2')
22
22
  gem.add_dependency('terminal-table', '~> 1.4.5')
23
23
  gem.add_dependency('gem-man', '~> 0.3.0')
@@ -2,3 +2,4 @@ require "funding_primer/version"
2
2
  require 'funding_primer/format'
3
3
  require 'funding_primer/multiplication_table'
4
4
  require 'funding_primer/color_matrix'
5
+ require 'funding_primer/prime'
@@ -1,3 +1,3 @@
1
1
  module FundingPrimer
2
- VERSION = "0.2.2"
2
+ VERSION = "0.3.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: funding_primer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.3.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -64,17 +64,17 @@ dependencies:
64
64
  requirement: !ruby/object:Gem::Requirement
65
65
  none: false
66
66
  requirements:
67
- - - ~>
67
+ - - ! '>='
68
68
  - !ruby/object:Gem::Version
69
- version: 0.9.2
69
+ version: '0'
70
70
  type: :development
71
71
  prerelease: false
72
72
  version_requirements: !ruby/object:Gem::Requirement
73
73
  none: false
74
74
  requirements:
75
- - - ~>
75
+ - - ! '>='
76
76
  - !ruby/object:Gem::Version
77
- version: 0.9.2
77
+ version: '0'
78
78
  - !ruby/object:Gem::Dependency
79
79
  name: methadone
80
80
  requirement: !ruby/object:Gem::Requirement