croupier 1.0.1 → 1.1.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.
- data/MIT-LICENSE.txt +1 -1
- data/README.md +8 -8
- data/RUNNING_TESTS.md +4 -4
- data/bin/croupier +1 -1
- data/lib/croupier/cli/application.rb +10 -10
- data/lib/croupier/cli/trollop.rb +4 -4
- data/lib/croupier/distribution.rb +8 -7
- data/lib/croupier/distributions/exponential.rb +7 -7
- data/lib/croupier/distributions/normal.rb +56 -0
- data/lib/croupier/distributions/uniform.rb +6 -6
- data/lib/croupier/exceptions.rb +1 -1
- data/test/distributions/R_tests/test_normal.R +52 -0
- data/test/distributions/generated_samples/normal_0_1.data +10000 -0
- data/test/distributions/generated_samples/normal_5_6.data +10000 -0
- data/test/test_distribution_class.rb +7 -5
- data/test/testsuite.R +1 -1
- metadata +9 -2
@@ -7,7 +7,7 @@ class TestDistributionClass < MiniTest::Unit::TestCase
|
|
7
7
|
assert_respond_to dist, 'name'
|
8
8
|
assert_respond_to dist, 'description'
|
9
9
|
end
|
10
|
-
|
10
|
+
|
11
11
|
def test_distribution_accepts_parameter_configuration
|
12
12
|
dist = Croupier::Distribution.new
|
13
13
|
assert_equal dist.parameters, dist.default_parameters
|
@@ -16,14 +16,16 @@ class TestDistributionClass < MiniTest::Unit::TestCase
|
|
16
16
|
assert_equal dist.parameters[:larry], 'bird'
|
17
17
|
assert_equal dist.parameters[:leonard], 'euler'
|
18
18
|
end
|
19
|
-
|
19
|
+
|
20
20
|
def test_distribution_has_trollop_options_info
|
21
21
|
assert_respond_to Croupier::Distribution, 'cli_name'
|
22
22
|
assert_respond_to Croupier::Distribution, 'cli_options'
|
23
23
|
end
|
24
|
-
|
24
|
+
|
25
25
|
def test_distribution_generates_array_of_n_results
|
26
|
-
|
26
|
+
a = Croupier::Distribution.new
|
27
|
+
def a.generate_number; 15; end
|
28
|
+
assert_equal a.generate_sample(15).size, 15
|
27
29
|
end
|
28
30
|
|
29
|
-
end
|
31
|
+
end
|
data/test/testsuite.R
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: croupier
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-06-
|
12
|
+
date: 2012-06-09 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: Croupier is a Ruby gem to generate a random sample of numbers with a
|
15
15
|
given probability distribution.
|
@@ -28,13 +28,17 @@ files:
|
|
28
28
|
- lib/croupier/cli/trollop.rb
|
29
29
|
- lib/croupier/distribution.rb
|
30
30
|
- lib/croupier/distributions/exponential.rb
|
31
|
+
- lib/croupier/distributions/normal.rb
|
31
32
|
- lib/croupier/distributions/uniform.rb
|
32
33
|
- lib/croupier/exceptions.rb
|
33
34
|
- lib/croupier.rb
|
34
35
|
- test/distributions/R_tests/test_exponential.R
|
36
|
+
- test/distributions/R_tests/test_normal.R
|
35
37
|
- test/distributions/R_tests/test_uniform.R
|
36
38
|
- test/distributions/generated_samples/exponential_1.data
|
37
39
|
- test/distributions/generated_samples/exponential_1_6.data
|
40
|
+
- test/distributions/generated_samples/normal_0_1.data
|
41
|
+
- test/distributions/generated_samples/normal_5_6.data
|
38
42
|
- test/distributions/generated_samples/uniform_0_1.data
|
39
43
|
- test/distributions/generated_samples/uniform_5_33.data
|
40
44
|
- test/test_croupier_module.rb
|
@@ -70,9 +74,12 @@ specification_version: 3
|
|
70
74
|
summary: Samples of random numbers with specific probability distributions
|
71
75
|
test_files:
|
72
76
|
- test/distributions/R_tests/test_exponential.R
|
77
|
+
- test/distributions/R_tests/test_normal.R
|
73
78
|
- test/distributions/R_tests/test_uniform.R
|
74
79
|
- test/distributions/generated_samples/exponential_1.data
|
75
80
|
- test/distributions/generated_samples/exponential_1_6.data
|
81
|
+
- test/distributions/generated_samples/normal_0_1.data
|
82
|
+
- test/distributions/generated_samples/normal_5_6.data
|
76
83
|
- test/distributions/generated_samples/uniform_0_1.data
|
77
84
|
- test/distributions/generated_samples/uniform_5_33.data
|
78
85
|
- test/test_croupier_module.rb
|