fibonacci_rng 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MTc4YTlhNTQ0NDhjZWIxNDAyNzQzYjU1NDY0MzMzNWM0YzdkYmMyNg==
4
+ NTI1ZTdjMjg4MTMyN2Q0YjBiNjg4NzViYThlZGExOGM4ZmFkYjc4MQ==
5
5
  data.tar.gz: !binary |-
6
- YWM4ODA4ZjQzZmNlYmYxYWQ0M2VmNDM5NzZlMDJkNzI3YmFmODA0MA==
6
+ MGM3NTk5MDk0MDM5ZWE1MGZiYmY3NTM3NjAxZDRiZGExMWFlZjI1OA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MTQ1ZjNmODYxNTc5ZDE0ZDc2YzNkZWY4ZGZmOTM2MzFjYTViNGE1NWI3ZWJl
10
- NTM0NjViZTIzOWNhN2Q3MDI3NmNhODI0OTEwMDA2OTYyNjAyMTJhMTIxYTlm
11
- MTY5ZTAyYzUwZjRjZWI3N2MxY2IyMDUwZmI3MDhjNWE4NTU5YWE=
9
+ NTdmMTkzNzQ5OGU2YThkNzVlN2NmYjJkYjU5YjBjZTE2NTg2M2FmOTllOWI5
10
+ MjdlMzZlY2UwODMwODkxYjYyNWNlZTZhNTkwODYzNWI3ZDA0OTM2ZDgyNWVm
11
+ Y2VkYzA0YzQ3MzFlZTg2NDRjZmIyNWE4NmFlZmU0NmFiMzFiYWY=
12
12
  data.tar.gz: !binary |-
13
- ZmIyNjMzODVkMDNjNTZiNzk1ZTA4MTRhZDhlZTE1ZTcxMTZjYzZkMGVjZjQy
14
- NDUwZjUxN2I3NGQ1Mjg4ZmVjMjQ2N2IzN2U0MTdmYzAzMWY1YzdjYmUxZjQ1
15
- ODNlNTMyNDFkNjc2OTgyNjIxM2NmYzMwZTIyMDk4YmU4YzFmM2U=
13
+ YWQwOGZkZWMzNzZjNWY0MGVhNDE1Mzk2ZmZhNzM5MDlkZGNmYjY0MmY2ODNi
14
+ NDhhNDNjNDQ1NjMxYzRiMTVkZGM5ZmU0YWRmYTk1YmQzNzkwYjMyZDNmODlm
15
+ MTFiOWJkYjE4YzJmOTFkMGU1OGZkM2Y5YTljMDZhMDMyMGY1NDc=
@@ -18,6 +18,8 @@ Gem::Specification.new do |spec|
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ["lib"]
20
20
 
21
+ spec.required_ruby_version = '>= 1.9.3'
22
+
21
23
  spec.add_development_dependency "bundler", "~> 1.3"
22
24
  spec.add_development_dependency "rake"
23
25
  spec.add_development_dependency 'reek', "~> 1.3.8"
data/lib/fibonacci_rng.rb CHANGED
@@ -81,7 +81,7 @@ class FibonacciRng
81
81
  @buffer[-2] = @buffer[0]
82
82
  @buffer[-1] = @buffer[1]
83
83
 
84
- 0...depth do |idx|
84
+ (0...@depth).each do |idx|
85
85
  @buffer[idx] = (@buffer[idx+1] + (@buffer[idx+2] >> 1)) & CHOP
86
86
  end
87
87
  end
@@ -2,5 +2,5 @@
2
2
 
3
3
  #The class of Fibonacci inspired random number generators.
4
4
  class FibonacciRng
5
- VERSION = "0.0.2"
5
+ VERSION = "0.0.3"
6
6
  end
@@ -25,7 +25,6 @@ class CoreTester < MiniTest::Unit::TestCase
25
25
  100.times do
26
26
  assert((0...6) === prng.dice(6))
27
27
  end
28
-
29
28
  end
30
29
 
31
30
  def test_that_it_creates_bytes
@@ -34,7 +33,6 @@ class CoreTester < MiniTest::Unit::TestCase
34
33
  100.times do
35
34
  assert((0...256) === prng.byte)
36
35
  end
37
-
38
36
  end
39
37
 
40
38
  def test_that_it_creates_words
@@ -59,7 +57,6 @@ class CoreTester < MiniTest::Unit::TestCase
59
57
  end
60
58
 
61
59
  assert(buffa != buffb)
62
-
63
60
  end
64
61
 
65
62
  def test_that_it_makes_repeatable_sequnces
@@ -75,7 +72,6 @@ class CoreTester < MiniTest::Unit::TestCase
75
72
  end
76
73
 
77
74
  assert(buffa == buffb)
78
-
79
75
  end
80
76
 
81
77
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fibonacci_rng
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Camilleri
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-15 00:00:00.000000000 Z
11
+ date: 2014-11-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -96,7 +96,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
96
96
  requirements:
97
97
  - - ! '>='
98
98
  - !ruby/object:Gem::Version
99
- version: '0'
99
+ version: 1.9.3
100
100
  required_rubygems_version: !ruby/object:Gem::Requirement
101
101
  requirements:
102
102
  - - ! '>='