README.md in eratostene_sieve-0.0.2.alpha vs README.md in eratostene_sieve-0.0.3.alpha
- old
+ new
@@ -2,14 +2,21 @@
This gem provides you a set of minimal utility functions to manage prime numbers.
## Changelog
- - **1.0.0**: initial release. It provides just these class functions:
+ - **0.0.3**:
+ - Renames .prime_serie into .enumerator.
+ - Adds .serie class method.
+
+ - **0.0.2**: Fix .prime_serie.
+
+ - **0.0.1**: initial release. It provides just these class functions:
+
- `nth_prime(n)` : retun the nth prime number.
- - `prime_serie` : return an enumerator over the prime serie.
+ - `enumerator` : return an enumerator over the prime serie.
## Installation
Add this line to your application's Gemfile:
@@ -32,14 +39,18 @@
Then call the function you like in your code:
# nth_prime(n) example
EratosterneSieve.nth_prime(10) # => 29
- # prime_serie example
- enumerator = EratosteneSieve.prime_serie
+ # enumerator example
+ enumerator = EratosteneSieve.enumerator
serie = []
(0..9).each { |i| serie << enumerator.next }
- puts serie # => [1, 2, 3, 5, 7, 11, 13, 17, 19, 23]
+ puts serie # => [2, 3, 5, 7, 11, 13, 17, 19, 23, 29]
+
+ # serie example
+ serie = EratosteneSieve.serie(:from => 1, :up_to => 10)
+ puts serie # => [2, 3, 5, 7, 11, 13, 17, 19, 23, 29]
## Contributing
1. Fork it ( http://github.com/<my-github-username>/eratostene_sieve/fork )
2. Create your feature branch (`git checkout -b my-new-feature`)