rangefinder 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/CHANGELOG +6 -0
- data/lib/rangefinder.rb +2 -1
- data/lib/rangefinder/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MDA0NzE5MTdlNGNjYzU0MmViMjc3MDIwMzJkNzJlYzFjODI3YTNjYQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NGJhOGU3ZjdmY2QzNGExZTUwN2QyMWY4ZWVlOTU4NmRiZGNkMDY0Ng==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MWRjMDYwODcxMDEzMzc5OTk3NGYxMDEyZDVkZTlhMjI4YTlhY2NiYWE0NGJh
|
10
|
+
ZWJlOTUyYzYzOWEyM2U0ODE0ZTZjNGQ2ZDdkMTU5OWNmZDMwNWQyMDQyOTQy
|
11
|
+
ODRjNjhiNjYxNzllMzY5Mjk2MTE3NjZjODFjYmExZGZlNzFlMWM=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
M2FlMTQxZWNmYjExMDNlYTBlYWU4ZGZiY2ZkNmYzZGIxZmY5MjdiNzcwMzI0
|
14
|
+
MjcwNDk5MTQ0YzQzMGM4NWIyZTUxZmZjYjgyNDM4NmFiYzFlMGQxY2JjMTYw
|
15
|
+
MzNmYjIyNTI3NDhjZWZlODA0YTEyMTY1YjA1MjJkN2Q3ZGVhYWY=
|
data/CHANGELOG
CHANGED
data/lib/rangefinder.rb
CHANGED
@@ -27,6 +27,7 @@ class Rangefinder
|
|
27
27
|
last = [options.fetch(:last, MAX), MAX].min.round
|
28
28
|
max_gap = options.fetch(:max_gap, MAX_GAP)
|
29
29
|
samp = options.fetch(:samp, INIT_SAMP)
|
30
|
+
random = options.fetch(:random, ::Random.new)
|
30
31
|
if samp >= MAX_SAMP
|
31
32
|
memo.ranges << (first..last)
|
32
33
|
else
|
@@ -52,7 +53,7 @@ class Rangefinder
|
|
52
53
|
gap = 0
|
53
54
|
end
|
54
55
|
samp1 = gap > 10 ? samp * Math.log(gap, 10) : samp
|
55
|
-
i += (rand(100) * (1 - samp1)).round
|
56
|
+
i += (random.rand(100) * (1 - samp1)).round
|
56
57
|
end until i >= last or (gap > max_gap and anything) # sorry for mixed metaphor
|
57
58
|
end
|
58
59
|
end
|
data/lib/rangefinder/version.rb
CHANGED