ruby-mext 0.16.2 → 0.17.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 26f50f4afe891591e62142fe16d024b11cbcd449768a767eefebebe33a24ef06
4
- data.tar.gz: 86927dc189922f5b892d44b62e1cf57d7bf5aaa1f232025352b8c5267915ec8b
3
+ metadata.gz: 14bb04ea6a49d39b2bfff16e1caaad92dbb6242ce7482dc1293c48f01d578aac
4
+ data.tar.gz: 81aa5f792ce7265f175350a02c787e1ed0f0d025bfc289a566fc211e5c87c692
5
5
  SHA512:
6
- metadata.gz: 0e43239a0b3eba6f45e1d8cc0a5b5b9fbb8f5014e22f5f724fba0d04765bcbd058a7d38276ca5b2b41b599e9fdbacfb1e168619175c8455ff3315f9b7d8e2093
7
- data.tar.gz: 53bee0c4d2798b2a4233eea7788d6bb26359e1e910cc32bd53eaf76cf9d6b5f78232c5375910e49fe1192a89df3af6aba4db8b51728ed042411bc77115a79ae2
6
+ metadata.gz: 444a91aeb11d33fa0104690b7f6fa05d298531a760ff6fd13787dbf4a56a052eed491664ad841ce73a8ccea29c8607d87afbf04e69f3a69bab8c1e2d135668c4
7
+ data.tar.gz: 375f273a8ac894dc2ac4ab2b9efd226780f79575651c4e2d439bce4d5a65a27270e6f916fbec47dfd93924108e177fb5c1e11e1d53326c06df73831e8ae2e7ab
@@ -7,6 +7,7 @@ end
7
7
  %w(
8
8
  exceptions
9
9
  utilities
10
+ random_generator
10
11
  numeric
11
12
  array
12
13
  math
@@ -8,7 +8,7 @@ class Array
8
8
  #:nodoc:
9
9
 
10
10
  def choose
11
- idx = (rand()*(self.size-1)).round
11
+ idx = (Mext::PRNG.rand*(self.size-1)).round
12
12
  self[idx]
13
13
  end
14
14
 
@@ -17,7 +17,7 @@ class Numeric
17
17
  lobound = self.to_f
18
18
  rng = upper.to_f - lobound
19
19
 
20
- (rand()*rng) + lobound
20
+ (Mext::PRNG.rand*rng) + lobound
21
21
  end
22
22
 
23
23
  end
@@ -0,0 +1,16 @@
1
+ module Mext
2
+
3
+ #
4
+ # +Mext::RandomGenerator+
5
+ #
6
+ # singleton version of the standard Random Generator
7
+ #
8
+ class RandomGenerator < ::Random
9
+
10
+ private_class_method :new
11
+
12
+ end
13
+
14
+ PRNG = RandomGenerator.send(:new)
15
+
16
+ end
@@ -1,3 +1,3 @@
1
1
  module Mext
2
- VERSION = '0.16.2'
2
+ VERSION = '0.17.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-mext
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.16.2
4
+ version: 0.17.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nicola Bernardini
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-07-12 00:00:00.000000000 Z
11
+ date: 2019-07-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: wavefile
@@ -163,6 +163,7 @@ files:
163
163
  - lib/mext/numeric/pitch_fork.rb
164
164
  - lib/mext/numeric/rrand.rb
165
165
  - lib/mext/numeric/semitopch.rb
166
+ - lib/mext/random_generator.rb
166
167
  - lib/mext/sound.rb
167
168
  - lib/mext/sound/info.rb
168
169
  - lib/mext/utilities.rb