bernoulli 0.2.0 → 0.2.1

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/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source :rubygems
2
+
3
+ gemspec
4
+
data/README.md CHANGED
@@ -41,11 +41,11 @@ We could also calculate the standard deviation, excess or skewness:
41
41
 
42
42
  x.standard_deviation # => 5.0
43
43
  x.excess # => 0.006666666666666665
44
- x.skewness => 0.13333333333333336
44
+ x.skewness # => 0.13333333333333336
45
45
 
46
46
  `bernoulli` can also do empirical tests. Let's look at a smaller example We can simulate the tossing of 4 fair coins
47
47
 
48
- y = y = Bernoulli.new(4, 0.5)
48
+ y = Bernoulli.new(4, 0.5)
49
49
  # => #<Bernoulli:0x007ff894293198 @n=4, @p=0.5>
50
50
 
51
51
  The method `sample` gives as a random array of length `n`, where each entry is `1` with a probability of `p`. The methods `sample_value` gives us the number of wins in a random expriment, we could than compare it to `expected_value`.
@@ -77,4 +77,11 @@ will produce
77
77
 
78
78
  `bernoulli` is a really small project. After writing the same code for some project and then losing it two or three times I decided to do it one time and well, so I can just call in the code from here next time.
79
79
 
80
- Feel free to cantact me about anything I could/should add or to contribute in any way to this simple library.
80
+ Feel free to cantact me about anything I could/should add or to contribute in any way to this simple library.
81
+
82
+ 1. Fork it
83
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
84
+ 3. Commit your changes (`git commit -am 'Added some feature'`)
85
+ 4. Push to the branch (`git push origin my-new-feature`)
86
+ 5. Create new Pull Request
87
+
data/Rakefile CHANGED
@@ -1,13 +1,20 @@
1
1
  require 'rake/testtask'
2
+ require 'bundler/gem_tasks'
3
+
4
+ task :default => :test
2
5
 
3
- desc 'Run tests'
4
6
  Rake::TestTask.new do |test|
5
7
  end
6
8
 
7
- task :default => :test
9
+ desc 'Remove pkg directory'
10
+ task :clean do
11
+ rm_rf 'pkg/'
12
+ end
13
+
14
+ spec = eval File.read('bernoulli.gemspec')
8
15
 
9
- desc 'Build gem'
10
- task :gem do
11
- sh 'gem build bernoulli.gemspec'
16
+ desc "Remove and uninstall #{spec.name}-#{spec.version}.gem from system gems"
17
+ task :uninstall => :clean do
18
+ sh 'gem uninstall bernoulli'
12
19
  end
13
20
 
data/bernoulli.gemspec CHANGED
@@ -1,31 +1,24 @@
1
+ require File.expand_path('../lib/bernoulli/version', __FILE__)
2
+
1
3
  Gem::Specification.new do |spec|
2
4
 
3
5
  spec.name = 'bernoulli'
4
- spec.version = '0.2.0'
6
+ spec.version = Bernoulli::VERSION
5
7
  spec.summary = 'Binomial experiments library'
6
- spec.description = 'A Library that allows calculation of probibilities and properties of binomial experiments like coin tossing'
8
+ spec.description = 'A library that allows calculation of probibilities and properties of binomial experiments like coin tossing'
7
9
  spec.homepage = 'http://mkonutgan.github.com/bernoulli'
8
10
 
9
- spec.date = '2012-05-28'
10
-
11
11
  spec.author = 'Mikael Konutgan'
12
12
  spec.email = 'mkonutgan@shortmail.com'
13
13
 
14
14
  spec.required_ruby_version = '>= 1.9.2'
15
15
 
16
- spec.files = [
17
- 'README.md',
18
- 'Rakefile',
19
- 'bernoulli.gemspec',
20
- 'lib/bernoulli.rb',
21
- 'lib/bernoulli/math.rb',
22
- 'test/test_bernoulli.rb',
23
- 'test/test_math.rb'
24
- ]
25
- spec.test_files = [
26
- 'test/test_bernoulli.rb',
27
- 'test/test_math.rb'
28
- ]
16
+ spec.files = `git ls-files`.split($\)
17
+ spec.test_files = spec.files.grep(/test/)
18
+
19
+ spec.add_development_dependency 'minitest', '~> 3.0.1'
20
+ spec.add_development_dependency 'rake', '~> 0.9.2.2'
21
+ spec.add_development_dependency 'bundler', '~> 1.1.4'
29
22
 
30
23
  end
31
24
 
@@ -0,0 +1,4 @@
1
+ module Bernoulli
2
+ VERSION = "0.2.1"
3
+ end
4
+
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bernoulli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,20 +9,70 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-05-28 00:00:00.000000000 Z
13
- dependencies: []
14
- description: A Library that allows calculation of probibilities and properties of
12
+ date: 2012-05-29 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: minitest
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ~>
20
+ - !ruby/object:Gem::Version
21
+ version: 3.0.1
22
+ type: :development
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ~>
28
+ - !ruby/object:Gem::Version
29
+ version: 3.0.1
30
+ - !ruby/object:Gem::Dependency
31
+ name: rake
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ~>
36
+ - !ruby/object:Gem::Version
37
+ version: 0.9.2.2
38
+ type: :development
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ~>
44
+ - !ruby/object:Gem::Version
45
+ version: 0.9.2.2
46
+ - !ruby/object:Gem::Dependency
47
+ name: bundler
48
+ requirement: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ~>
52
+ - !ruby/object:Gem::Version
53
+ version: 1.1.4
54
+ type: :development
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ~>
60
+ - !ruby/object:Gem::Version
61
+ version: 1.1.4
62
+ description: A library that allows calculation of probibilities and properties of
15
63
  binomial experiments like coin tossing
16
64
  email: mkonutgan@shortmail.com
17
65
  executables: []
18
66
  extensions: []
19
67
  extra_rdoc_files: []
20
68
  files:
69
+ - Gemfile
21
70
  - README.md
22
71
  - Rakefile
23
72
  - bernoulli.gemspec
24
73
  - lib/bernoulli.rb
25
74
  - lib/bernoulli/math.rb
75
+ - lib/bernoulli/version.rb
26
76
  - test/test_bernoulli.rb
27
77
  - test/test_math.rb
28
78
  homepage: http://mkonutgan.github.com/bernoulli