prime_8 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +9 -0
- data/.rspec +2 -0
- data/.travis.yml +3 -0
- data/CODE_OF_CONDUCT.md +13 -0
- data/Gemfile +4 -0
- data/README.md +39 -0
- data/Rakefile +7 -0
- data/bin/console +11 -0
- data/bin/setup +7 -0
- data/exe/run +21 -0
- data/lib/prime_8/generators/atkins_generator.rb +23 -0
- data/lib/prime_8/generators/eratosthenes_generator.rb +22 -0
- data/lib/prime_8/generators/prime_generator.rb +53 -0
- data/lib/prime_8/generators.rb +11 -0
- data/lib/prime_8/multiplication.rb +9 -0
- data/lib/prime_8/prime.rb +24 -0
- data/lib/prime_8/report_table.rb +44 -0
- data/lib/prime_8/strategies/atkin_sieve_strategy.rb +94 -0
- data/lib/prime_8/strategies/eratosthenes_sieve_strategy.rb +34 -0
- data/lib/prime_8/strategies/strategy.rb +21 -0
- data/lib/prime_8/strategies.rb +19 -0
- data/lib/prime_8/version.rb +3 -0
- data/lib/prime_8.rb +2 -0
- data/prime_8.gemspec +38 -0
- metadata +181 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 394007c9775ca3dcf6896728ee7d70858da1ed5c
|
4
|
+
data.tar.gz: 46a382ece35a3153bc7b97c9d46ee93b99638f4d
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 7338e9cd86e672a1f28972f49ac9602080b6157483c86be0a91ad3cdfec646fa84925705fd9efc9a2b7c4a30cd628a0bfd0e2a4c8a93d5fc4317468c79ab8994
|
7
|
+
data.tar.gz: 8e3bf1bc5a1d726ea715abbc89c0a7485a412102599d80a26640d9fead46dd29a37796b75ce0651092bd791a355839952e8e3c59668050e80127d0e49caf306c
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.travis.yml
ADDED
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
# Contributor Code of Conduct
|
2
|
+
|
3
|
+
As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
|
4
|
+
|
5
|
+
We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, age, or religion.
|
6
|
+
|
7
|
+
Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
|
8
|
+
|
9
|
+
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.
|
10
|
+
|
11
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
|
12
|
+
|
13
|
+
This Code of Conduct is adapted from the [Contributor Covenant](http:contributor-covenant.org), version 1.0.0, available at [http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/)
|
data/Gemfile
ADDED
data/README.md
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
# Prime8
|
2
|
+
|
3
|
+
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/prime_8`. To experiment with that code, run `bin/console` for an interactive prompt.
|
4
|
+
|
5
|
+
TODO: Delete this and the text above, and describe your gem
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Add this line to your application's Gemfile:
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
gem 'prime_8'
|
13
|
+
```
|
14
|
+
|
15
|
+
And then execute:
|
16
|
+
|
17
|
+
$ bundle
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
|
21
|
+
$ gem install prime_8
|
22
|
+
|
23
|
+
## Usage
|
24
|
+
|
25
|
+
TODO: Write usage instructions here
|
26
|
+
|
27
|
+
## Development
|
28
|
+
|
29
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `bin/console` for an interactive prompt that will allow you to experiment.
|
30
|
+
|
31
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release` to create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
32
|
+
|
33
|
+
## Contributing
|
34
|
+
|
35
|
+
1. Fork it ( https://github.com/[my-github-username]/prime_8/fork )
|
36
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
37
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
38
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
39
|
+
5. Create a new Pull Request
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "prime_8"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
require "pry"
|
11
|
+
Pry.start
|
data/bin/setup
ADDED
data/exe/run
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "prime_8"
|
5
|
+
require 'cri'
|
6
|
+
|
7
|
+
command = Cri::Command.define do
|
8
|
+
name 'print'
|
9
|
+
usage 'usage: print [options]'
|
10
|
+
summary 'prints a table of primes'
|
11
|
+
description <<-EOS
|
12
|
+
Just printing some primes, thank you.
|
13
|
+
Move along, nothin to see here.
|
14
|
+
EOS
|
15
|
+
run do |opts, args|
|
16
|
+
Prime8::ReportTable.new(args[0].to_i).run
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
command.run(ARGV)
|
21
|
+
|
@@ -0,0 +1,23 @@
|
|
1
|
+
require 'prime_8/generators/prime_generator'
|
2
|
+
require 'prime_8/strategies'
|
3
|
+
|
4
|
+
module Prime8::Generators
|
5
|
+
class AtkinsGenerator < PrimeGenerator
|
6
|
+
def initialize
|
7
|
+
@last_prime_index = -1
|
8
|
+
@strategy = Prime8::Strategies.atkins
|
9
|
+
super
|
10
|
+
end
|
11
|
+
|
12
|
+
def succ
|
13
|
+
@last_prime_index += 1
|
14
|
+
@strategy.get_nth_prime(@last_prime_index)
|
15
|
+
end
|
16
|
+
def rewind
|
17
|
+
initialize
|
18
|
+
end
|
19
|
+
alias next succ
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
23
|
+
|
@@ -0,0 +1,22 @@
|
|
1
|
+
require 'prime_8/generators/prime_generator'
|
2
|
+
require 'prime_8/strategies'
|
3
|
+
|
4
|
+
module Prime8::Generators
|
5
|
+
class EratosthenesGenerator < PrimeGenerator
|
6
|
+
def initialize
|
7
|
+
@last_prime_index = -1
|
8
|
+
@strategy = Prime8::Strategies.eraatosthenes
|
9
|
+
super
|
10
|
+
end
|
11
|
+
|
12
|
+
def succ
|
13
|
+
@last_prime_index += 1
|
14
|
+
@strategy.get_nth_prime(@last_prime_index)
|
15
|
+
end
|
16
|
+
|
17
|
+
def rewind
|
18
|
+
initialize
|
19
|
+
end
|
20
|
+
alias next succ
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,53 @@
|
|
1
|
+
module Prime8::Generators
|
2
|
+
class PrimeGenerator
|
3
|
+
include Enumerable
|
4
|
+
def initialize(ubound = nil)
|
5
|
+
@ubound = ubound
|
6
|
+
end
|
7
|
+
|
8
|
+
def upper_bound=(ubound)
|
9
|
+
@ubound = ubound
|
10
|
+
end
|
11
|
+
|
12
|
+
def upper_bound
|
13
|
+
@ubound
|
14
|
+
end
|
15
|
+
|
16
|
+
def succ
|
17
|
+
raise NotImplementedError, "need to define `succ'"
|
18
|
+
end
|
19
|
+
|
20
|
+
def next
|
21
|
+
raise NotImplementedError, "need to define `next'"
|
22
|
+
end
|
23
|
+
|
24
|
+
def rewind
|
25
|
+
raise NotImplementedError, "need to define `rewind'"
|
26
|
+
end
|
27
|
+
|
28
|
+
def each
|
29
|
+
return self.dup unless block_given?
|
30
|
+
if @ubound
|
31
|
+
last_value = nil
|
32
|
+
loop do
|
33
|
+
prime = succ
|
34
|
+
break last_value if prime > @ubound
|
35
|
+
last_value = yield prime
|
36
|
+
end
|
37
|
+
else
|
38
|
+
loop do
|
39
|
+
yield succ
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
alias with_index each_with_index
|
45
|
+
|
46
|
+
def with_object(obj)
|
47
|
+
return enum_for(:with_object) unless block_given?
|
48
|
+
each do |prime|
|
49
|
+
yield prime, obj
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
require 'prime_8/version'
|
2
|
+
require 'prime_8/report_table'
|
3
|
+
require 'prime_8/strategies'
|
4
|
+
require 'prime_8/generators'
|
5
|
+
require 'prime_8/multiplication'
|
6
|
+
|
7
|
+
module Prime8
|
8
|
+
autoload :Generators, "prime_8/generators"
|
9
|
+
autoload :Strategies, "prime_8/strategies"
|
10
|
+
|
11
|
+
class Prime
|
12
|
+
include Singleton
|
13
|
+
|
14
|
+
def prime?(value, generator = Generators.default)
|
15
|
+
return false if value < 2
|
16
|
+
generator.each do |num|
|
17
|
+
q,r = value.divmod num
|
18
|
+
return true if q < num
|
19
|
+
return false if r == 0
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
require 'command_line_reporter'
|
2
|
+
require_relative 'multiplication'
|
3
|
+
require_relative 'strategies'
|
4
|
+
|
5
|
+
module Prime8
|
6
|
+
class ReportTable
|
7
|
+
include CommandLineReporter
|
8
|
+
include Multiplication
|
9
|
+
|
10
|
+
attr_reader :primes
|
11
|
+
def initialize(count=10)
|
12
|
+
@count = count
|
13
|
+
@primes = Prime8::Strategies.default.get_through_nth_prime(@count)
|
14
|
+
end
|
15
|
+
|
16
|
+
def table_headings
|
17
|
+
[""]+@primes
|
18
|
+
end
|
19
|
+
|
20
|
+
def row_datum
|
21
|
+
table_rows(@primes)
|
22
|
+
end
|
23
|
+
|
24
|
+
def run
|
25
|
+
table :border => true do
|
26
|
+
row :header => true do
|
27
|
+
table_headings.each do |prime|
|
28
|
+
column(prime.to_s, :align => 'center', :width => 5, :color => 'blue')
|
29
|
+
end
|
30
|
+
end
|
31
|
+
row_datum.each do |row_data|
|
32
|
+
row do
|
33
|
+
column(row_data.slice!(0).to_s, :align => 'center', :width => 5, :bold => true, :color => 'blue')
|
34
|
+
end
|
35
|
+
row_data.each do |rd|
|
36
|
+
column(rd.to_s, :align => 'center', :width => 5)
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
#column(row_data.slice!(1).to_s)
|
44
|
+
#row_data.each do |column_data|
|
@@ -0,0 +1,94 @@
|
|
1
|
+
require_relative 'strategy'
|
2
|
+
|
3
|
+
module Prime8::Strategies
|
4
|
+
class AtkinSieveStrategy < Strategy
|
5
|
+
|
6
|
+
def initialize
|
7
|
+
@first_set = %w(1 13 17 29 37 41 49 53).map(&:to_i)
|
8
|
+
@second_set = %w(7 19 31 43).map(&:to_i)
|
9
|
+
@third_set = %w(11 23 47 59).map(&:to_i)
|
10
|
+
super
|
11
|
+
end
|
12
|
+
|
13
|
+
|
14
|
+
def compute_primes
|
15
|
+
max_segment_size = 1e6.to_i
|
16
|
+
max_cached_prime = @primes.last
|
17
|
+
@max_checked = max_cached_prime + 1 if max_cached_prime > @max_checked
|
18
|
+
|
19
|
+
segment_min = @max_checked
|
20
|
+
segment_max = [segment_min + max_segment_size, max_cached_prime * 2].min
|
21
|
+
|
22
|
+
((segment_min + 1) .. segment_max).step(2).each do |candidate|
|
23
|
+
remainder = candidate % 60
|
24
|
+
if @first_set.include?(remainder)
|
25
|
+
candidate_is_prime = first_quadratic_form(candidate)
|
26
|
+
elsif @second_set.include?(remainder)
|
27
|
+
candidate_is_prime = second_quadradic_form(candidate)
|
28
|
+
elsif @third_set.include?(remainder)
|
29
|
+
candidate_is_prime = third_quadradic_form(candidate)
|
30
|
+
end
|
31
|
+
|
32
|
+
if candidate_is_prime && !has_prime_divisor?(candidate)
|
33
|
+
@primes << candidate
|
34
|
+
end
|
35
|
+
end
|
36
|
+
@max_checked = segment_max
|
37
|
+
end
|
38
|
+
|
39
|
+
private
|
40
|
+
|
41
|
+
def has_prime_divisor?(candidate)
|
42
|
+
@primes.any? { |prime| candidate % prime == 0 }
|
43
|
+
end
|
44
|
+
|
45
|
+
def first_quadratic_form(n)
|
46
|
+
candidate_is_prime = false
|
47
|
+
x_limit = n >> 2
|
48
|
+
for x in (1..x_limit)
|
49
|
+
break if ((memoized_x = 4*x**2) && (memoized_x >= n))
|
50
|
+
for y in (1..n)
|
51
|
+
break if ((memoized_y = y**2) && (memoized_y >= n))
|
52
|
+
candidate = memoized_x + memoized_y
|
53
|
+
next unless (candidate == n)
|
54
|
+
if ((candidate%12 == 1) || (candidate%12 == 5))
|
55
|
+
candidate_is_prime = !candidate_is_prime
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
candidate_is_prime
|
60
|
+
end
|
61
|
+
|
62
|
+
def second_quadradic_form(n)
|
63
|
+
candidate_is_prime = false
|
64
|
+
x_limit = n >> 1
|
65
|
+
for x in (1..x_limit)
|
66
|
+
break if ((memoized_x = 3*x**2) && (memoized_x >= n))
|
67
|
+
for y in (1..n)
|
68
|
+
break if ((memoized_y = y**2) && (memoized_y >= n))
|
69
|
+
candidate = memoized_x + memoized_y
|
70
|
+
next unless (candidate == n)
|
71
|
+
if (candidate%12 == 7)
|
72
|
+
candidate_is_prime = !candidate_is_prime
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
76
|
+
candidate_is_prime
|
77
|
+
end
|
78
|
+
|
79
|
+
def third_quadradic_form(n)
|
80
|
+
candidate_is_prime = false
|
81
|
+
for x in (1..n)
|
82
|
+
break if (x**2 >= n)
|
83
|
+
for y in (1...x)
|
84
|
+
candidate = 3*x**2 - y**2
|
85
|
+
next unless candidate == n
|
86
|
+
if candidate > 0 && candidate%12 == 11
|
87
|
+
candidate_is_prime = !candidate_is_prime
|
88
|
+
end
|
89
|
+
end
|
90
|
+
end
|
91
|
+
candidate_is_prime
|
92
|
+
end
|
93
|
+
end
|
94
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
require_relative 'strategy'
|
2
|
+
module Prime8::Strategies
|
3
|
+
class EratosthenesSieveStrategy < Strategy
|
4
|
+
def initialize
|
5
|
+
super
|
6
|
+
end
|
7
|
+
|
8
|
+
def compute_primes
|
9
|
+
max_segment_size = 1e6.to_i
|
10
|
+
max_cached_prime = @primes.last
|
11
|
+
@max_checked = max_cached_prime + 1 if max_cached_prime > @max_checked
|
12
|
+
|
13
|
+
segment_min = @max_checked
|
14
|
+
segment_max = [segment_min + max_segment_size, max_cached_prime * 2].min
|
15
|
+
root = Integer(Math.sqrt(segment_max).floor)
|
16
|
+
|
17
|
+
sieving_primes = @primes[1 .. -1].take_while { |prime| prime <= root }
|
18
|
+
offsets = Array.new(sieving_primes.size) do |i|
|
19
|
+
(-(segment_min + 1 + sieving_primes[i]) / 2) % sieving_primes[i]
|
20
|
+
end
|
21
|
+
|
22
|
+
segment = ((segment_min + 1) .. segment_max).step(2).to_a
|
23
|
+
sieving_primes.each_with_index do |prime, index|
|
24
|
+
composite_index = offsets[index]
|
25
|
+
while composite_index < segment.size do
|
26
|
+
segment[composite_index] = nil
|
27
|
+
composite_index += prime
|
28
|
+
end
|
29
|
+
end
|
30
|
+
@primes = @primes | segment.compact
|
31
|
+
@max_checked = segment_max
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
module Prime8::Strategies
|
2
|
+
class Strategy
|
3
|
+
include Singleton
|
4
|
+
|
5
|
+
def initialize
|
6
|
+
@primes = [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]
|
7
|
+
@max_checked = @primes.last + 1
|
8
|
+
end
|
9
|
+
|
10
|
+
def get_nth_prime(n)
|
11
|
+
compute_primes while @primes.size <= n
|
12
|
+
@primes[n]
|
13
|
+
end
|
14
|
+
|
15
|
+
def get_through_nth_prime(n)
|
16
|
+
compute_primes while @primes.size <= n
|
17
|
+
@primes.first(n)
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
require_relative 'strategies/eratosthenes_sieve_strategy'
|
2
|
+
require_relative 'strategies/atkin_sieve_strategy'
|
3
|
+
|
4
|
+
module Prime8
|
5
|
+
module Strategies
|
6
|
+
|
7
|
+
def self.default
|
8
|
+
eraatosthenes
|
9
|
+
end
|
10
|
+
|
11
|
+
def self.eraatosthenes
|
12
|
+
EratosthenesSieveStrategy.instance
|
13
|
+
end
|
14
|
+
|
15
|
+
def self.atkin
|
16
|
+
AtkinSieveStrategy.instance
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
data/lib/prime_8.rb
ADDED
data/prime_8.gemspec
ADDED
@@ -0,0 +1,38 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'prime_8/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "prime_8"
|
8
|
+
spec.version = Prime8::VERSION
|
9
|
+
spec.authors = ["Matthew Jording"]
|
10
|
+
spec.email = ["mjording@gmail.com"]
|
11
|
+
|
12
|
+
spec.summary = %q{A brief excercise and exploration of primes.}
|
13
|
+
spec.description = %q{A brief excercise and exploration of primes. cli, benchmarks and tests between diffent prime generation algorithms, etc}
|
14
|
+
spec.homepage = "http://github.com/mjording/prime_8."
|
15
|
+
|
16
|
+
# Prevent pushing this gem to RubyGems.org by setting 'allowed_push_host', or
|
17
|
+
# delete this section to allow pushing this gem to any host.
|
18
|
+
#if spec.respond_to?(:metadata)
|
19
|
+
#spec.metadata['allowed_push_host'] = "TODO: Set to 'http://mygemserver.com'"
|
20
|
+
#else
|
21
|
+
#raise "RubyGems 2.0 or newer is required to protect against public gem pushes."
|
22
|
+
#end
|
23
|
+
|
24
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
25
|
+
spec.bindir = "exe"
|
26
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
27
|
+
spec.require_paths = ["lib"]
|
28
|
+
|
29
|
+
spec.add_dependency 'cri','2.7.0'
|
30
|
+
spec.add_dependency 'command_line_reporter', '>=3.0'
|
31
|
+
spec.add_development_dependency "bundler", "~> 1.9"
|
32
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
33
|
+
spec.add_development_dependency "benchmark-ips", "~> 2.2.0"
|
34
|
+
spec.add_development_dependency 'rspec', '~> 3.2.0'
|
35
|
+
spec.add_development_dependency 'pry', '~> 0.10.1'
|
36
|
+
spec.add_development_dependency 'awesome_print', '~> 1.6.1'
|
37
|
+
|
38
|
+
end
|
metadata
ADDED
@@ -0,0 +1,181 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: prime_8
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Matthew Jording
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-05-29 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: cri
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - '='
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 2.7.0
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - '='
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 2.7.0
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: command_line_reporter
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '3.0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '3.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: bundler
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '1.9'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '1.9'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rake
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '10.0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '10.0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: benchmark-ips
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 2.2.0
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: 2.2.0
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: rspec
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: 3.2.0
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: 3.2.0
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: pry
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: 0.10.1
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: 0.10.1
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: awesome_print
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - "~>"
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: 1.6.1
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - "~>"
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: 1.6.1
|
125
|
+
description: A brief excercise and exploration of primes. cli, benchmarks and tests
|
126
|
+
between diffent prime generation algorithms, etc
|
127
|
+
email:
|
128
|
+
- mjording@gmail.com
|
129
|
+
executables:
|
130
|
+
- run
|
131
|
+
extensions: []
|
132
|
+
extra_rdoc_files: []
|
133
|
+
files:
|
134
|
+
- ".gitignore"
|
135
|
+
- ".rspec"
|
136
|
+
- ".travis.yml"
|
137
|
+
- CODE_OF_CONDUCT.md
|
138
|
+
- Gemfile
|
139
|
+
- README.md
|
140
|
+
- Rakefile
|
141
|
+
- bin/console
|
142
|
+
- bin/setup
|
143
|
+
- exe/run
|
144
|
+
- lib/prime_8.rb
|
145
|
+
- lib/prime_8/generators.rb
|
146
|
+
- lib/prime_8/generators/atkins_generator.rb
|
147
|
+
- lib/prime_8/generators/eratosthenes_generator.rb
|
148
|
+
- lib/prime_8/generators/prime_generator.rb
|
149
|
+
- lib/prime_8/multiplication.rb
|
150
|
+
- lib/prime_8/prime.rb
|
151
|
+
- lib/prime_8/report_table.rb
|
152
|
+
- lib/prime_8/strategies.rb
|
153
|
+
- lib/prime_8/strategies/atkin_sieve_strategy.rb
|
154
|
+
- lib/prime_8/strategies/eratosthenes_sieve_strategy.rb
|
155
|
+
- lib/prime_8/strategies/strategy.rb
|
156
|
+
- lib/prime_8/version.rb
|
157
|
+
- prime_8.gemspec
|
158
|
+
homepage: http://github.com/mjording/prime_8.
|
159
|
+
licenses: []
|
160
|
+
metadata: {}
|
161
|
+
post_install_message:
|
162
|
+
rdoc_options: []
|
163
|
+
require_paths:
|
164
|
+
- lib
|
165
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
166
|
+
requirements:
|
167
|
+
- - ">="
|
168
|
+
- !ruby/object:Gem::Version
|
169
|
+
version: '0'
|
170
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
171
|
+
requirements:
|
172
|
+
- - ">="
|
173
|
+
- !ruby/object:Gem::Version
|
174
|
+
version: '0'
|
175
|
+
requirements: []
|
176
|
+
rubyforge_project:
|
177
|
+
rubygems_version: 2.4.6
|
178
|
+
signing_key:
|
179
|
+
specification_version: 4
|
180
|
+
summary: A brief excercise and exploration of primes.
|
181
|
+
test_files: []
|