fair_dice_roll 6.0.0 → 7.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGELOG.md +80 -12
- data/LICENSE.txt +17 -18
- data/README.md +5 -7
- data/fair_dice_roll.gemspec +34 -13
- data/lib/fair_dice_roll/version.rb +5 -0
- data/lib/fair_dice_roll.rb +16 -2
- metadata +25 -27
- data/.gitignore +0 -3
- data/.rspec +0 -4
- data/.travis.yml +0 -23
- data/CONTRIBUTING.md +0 -7
- data/Gemfile +0 -8
- data/Rakefile +0 -6
- data/spec/fair_dice_roll_spec.rb +0 -45
- data/spec/spec_helper.rb +0 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 0abd517eb300b75a660d7ff362b396cb3e3b8d69e5084b30d65ca568a770298a
|
4
|
+
data.tar.gz: af9261b74f04b527f18f0bff273db14807d33c6e2a24d86fe4c129b88757542d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1bd9a924676b0623974a9f276bb1631b4c7c3cb0439a215cd029c7706a9eddd4b0408c12da54acddebeb7ede068b3f83cab81a51f9a9ad625d3da2e84b87490d
|
7
|
+
data.tar.gz: e676121ad3d45541f9923d1f99148c9fca42bc4495be785e5bc197ab376e76e98656b4f9bf3800ad830446ecd104d9c606e124e3738b613a84770d667adf8502
|
data/CHANGELOG.md
CHANGED
@@ -1,23 +1,91 @@
|
|
1
|
-
|
1
|
+
# Changelog
|
2
2
|
|
3
|
-
|
3
|
+
All notable changes to this project will be documented in this file.
|
4
4
|
|
5
|
-
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
6
7
|
|
7
|
-
|
8
|
+
## [Unreleased]
|
8
9
|
|
9
|
-
##
|
10
|
+
## [7.0.1] - 2024-04-15
|
10
11
|
|
11
|
-
|
12
|
+
### Fixed
|
12
13
|
|
13
|
-
|
14
|
+
- Corrected link in contribution steps
|
14
15
|
|
15
|
-
|
16
|
+
## [7.0.0] - 2024-04-15
|
16
17
|
|
17
|
-
|
18
|
+
### Added
|
18
19
|
|
19
|
-
|
20
|
+
- Support for truly random Random.random_number, Random#random_number, and SecureRandom.rand methods
|
21
|
+
- Support for maintained Ruby versions 3.0, 3.1, and 3.2
|
22
|
+
- RuboCop for code formatting
|
23
|
+
- Test to assert proper XKCD code formatting
|
20
24
|
|
21
|
-
|
25
|
+
### Changed
|
22
26
|
|
23
|
-
|
27
|
+
- Re-roll
|
28
|
+
|
29
|
+
### Removed
|
30
|
+
|
31
|
+
- Support for EOL Ruby versions earlier than 3.0
|
32
|
+
|
33
|
+
## [6.0.0] - 2015-09-01
|
34
|
+
|
35
|
+
### Changed
|
36
|
+
|
37
|
+
- Re-roll
|
38
|
+
|
39
|
+
## [5.1.0] - 2015-09-01
|
40
|
+
|
41
|
+
### Changed
|
42
|
+
|
43
|
+
- Officially promote the version 5.1.0 release candidate
|
44
|
+
|
45
|
+
## [5.1.0.rc1] - 2015-05-04
|
46
|
+
|
47
|
+
### Changed
|
48
|
+
|
49
|
+
- Re-roll
|
50
|
+
|
51
|
+
## [5.0.0] - 2015-03-31
|
52
|
+
|
53
|
+
### Changed
|
54
|
+
|
55
|
+
- Re-roll
|
56
|
+
|
57
|
+
## [4.0.0] - 2015-03-03
|
58
|
+
|
59
|
+
### Changed
|
60
|
+
|
61
|
+
- Re-roll
|
62
|
+
|
63
|
+
## [3.0.0] - 2014-07-28
|
64
|
+
|
65
|
+
### Changed
|
66
|
+
|
67
|
+
- Re-roll
|
68
|
+
|
69
|
+
## [2.0.0] - 2014-07-11
|
70
|
+
|
71
|
+
### Changed
|
72
|
+
|
73
|
+
- Re-roll
|
74
|
+
|
75
|
+
## [1.0.0] - 2014-07-09
|
76
|
+
|
77
|
+
### Added
|
78
|
+
|
79
|
+
- Initial release!
|
80
|
+
|
81
|
+
[unreleased]: https://github.com/laserlemon/fair_dice_roll/compare/v7.0.1...HEAD
|
82
|
+
[7.0.1]: https://github.com/laserlemon/fair_dice_roll/compare/v7.0.0...v7.0.1
|
83
|
+
[7.0.0]: https://github.com/laserlemon/fair_dice_roll/compare/v6.0.0...v7.0.0
|
84
|
+
[6.0.0]: https://github.com/laserlemon/fair_dice_roll/compare/v5.1.0...v6.0.0
|
85
|
+
[5.1.0]: https://github.com/laserlemon/fair_dice_roll/compare/v5.1.0.rc1...v5.1.0
|
86
|
+
[5.1.0.rc1]: https://github.com/laserlemon/fair_dice_roll/compare/v5.0.0...v5.1.0.rc1
|
87
|
+
[5.0.0]: https://github.com/laserlemon/fair_dice_roll/compare/v4.0.0...v5.0.0
|
88
|
+
[4.0.0]: https://github.com/laserlemon/fair_dice_roll/compare/v3.0.0...v4.0.0
|
89
|
+
[3.0.0]: https://github.com/laserlemon/fair_dice_roll/compare/v2.0.0...v3.0.0
|
90
|
+
[2.0.0]: https://github.com/laserlemon/fair_dice_roll/compare/v1.0.0...v2.0.0
|
91
|
+
[1.0.0]: https://github.com/laserlemon/fair_dice_roll/commits/v1.0.0
|
data/LICENSE.txt
CHANGED
@@ -1,22 +1,21 @@
|
|
1
|
-
|
1
|
+
The MIT License (MIT)
|
2
2
|
|
3
|
-
|
3
|
+
Copyright (c) 2014 Steve Richert
|
4
4
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
the following conditions:
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
12
11
|
|
13
|
-
The above copyright notice and this permission notice shall be
|
14
|
-
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
15
14
|
|
16
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
OF
|
22
|
-
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
CHANGED
@@ -2,11 +2,9 @@
|
|
2
2
|
|
3
3
|
Finally. Truly random numbers in Ruby.
|
4
4
|
|
5
|
-
[![Gem Version](https://img.shields.io/gem/v/fair_dice_roll
|
6
|
-
[![Build Status](https://img.shields.io/
|
7
|
-
[![
|
8
|
-
[![Code Coverage](http://img.shields.io/codeclimate/coverage/github/laserlemon/fair_dice_roll.svg?style=flat)](https://codeclimate.com/github/laserlemon/fair_dice_roll)
|
9
|
-
[![Dependency Status](https://img.shields.io/gemnasium/laserlemon/fair_dice_roll.svg?style=flat)](https://gemnasium.com/laserlemon/fair_dice_roll)
|
5
|
+
[![Gem Version](https://img.shields.io/gem/v/fair_dice_roll)](http://rubygems.org/gems/fair_dice_roll)
|
6
|
+
[![Build Status](https://img.shields.io/github/actions/workflow/status/laserlemon/fair_dice_roll/rake.yml)](https://github.com/laserlemon/fair_dice_roll/actions/workflows/rake.yml)
|
7
|
+
[![License](https://img.shields.io/github/license/laserlemon/fair_dice_roll)](https://github.com/laserlemon/fair_dice_roll/blob/-/LICENSE.txt)
|
10
8
|
|
11
9
|
## Installation
|
12
10
|
|
@@ -28,9 +26,9 @@ Finally. Truly random numbers in Ruby.
|
|
28
26
|
|
29
27
|
1. [Fork](https://github.com/laserlemon/fair_dice_roll/fork) it.
|
30
28
|
2. Roll a die… fairly.
|
31
|
-
3. [Record](https://github.com/laserlemon/fair_dice_roll/blob
|
29
|
+
3. [Record](https://github.com/laserlemon/fair_dice_roll/blob/-/lib/fair_dice_roll.rb#L6-L7) your result.
|
32
30
|
4. Submit a [pull request](https://github.com/laserlemon/fair_dice_roll/pulls).
|
33
|
-
5. Please include photographic [evidence](
|
31
|
+
5. Please include photographic [evidence](https://cloud.githubusercontent.com/assets/34264/6920894/4f46d4de-d78f-11e4-8414-6c436864705e.JPG) of your roll.
|
34
32
|
|
35
33
|
## Thanks
|
36
34
|
|
data/fair_dice_roll.gemspec
CHANGED
@@ -1,19 +1,40 @@
|
|
1
|
-
#
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
spec.name = "fair_dice_roll"
|
5
|
-
spec.version = "6.0.0"
|
3
|
+
require_relative "lib/fair_dice_roll/version"
|
6
4
|
|
7
|
-
|
8
|
-
spec.
|
9
|
-
spec.summary
|
5
|
+
Gem::Specification.new do |spec|
|
6
|
+
spec.name = "fair_dice_roll"
|
7
|
+
spec.summary = "Guaranteed to be random."
|
10
8
|
spec.description = "Chosen by fair dice roll. Guaranteed to be random."
|
11
|
-
spec.
|
12
|
-
|
9
|
+
spec.version = FairDiceRoll::VERSION
|
10
|
+
|
11
|
+
spec.author = "Steve Richert"
|
12
|
+
spec.email = "steve.richert@hey.com"
|
13
|
+
spec.license = "MIT"
|
14
|
+
spec.homepage = "https://github.com/laserlemon/fair_dice_roll"
|
15
|
+
|
16
|
+
spec.metadata = {
|
17
|
+
"allowed_push_host" => "https://rubygems.org",
|
18
|
+
"bug_tracker_uri" => "https://github.com/laserlemon/fair_dice_roll/issues",
|
19
|
+
"funding_uri" => "https://github.com/sponsors/laserlemon",
|
20
|
+
"homepage_uri" => "https://github.com/laserlemon/fair_dice_roll",
|
21
|
+
"rubygems_mfa_required" => "true",
|
22
|
+
"source_code_uri" => "https://github.com/laserlemon/fair_dice_roll",
|
23
|
+
}
|
24
|
+
|
25
|
+
spec.required_ruby_version = ">= 3.0.0"
|
26
|
+
spec.add_development_dependency "bundler", ">= 2"
|
27
|
+
spec.add_development_dependency "rake", ">= 13"
|
13
28
|
|
14
|
-
spec.files
|
15
|
-
|
29
|
+
spec.files = [
|
30
|
+
"fair_dice_roll.gemspec",
|
31
|
+
"lib/fair_dice_roll.rb",
|
32
|
+
"lib/fair_dice_roll/version.rb",
|
33
|
+
"LICENSE.txt",
|
34
|
+
]
|
16
35
|
|
17
|
-
spec.
|
18
|
-
|
36
|
+
spec.extra_rdoc_files = [
|
37
|
+
"CHANGELOG.md",
|
38
|
+
"README.md",
|
39
|
+
]
|
19
40
|
end
|
data/lib/fair_dice_roll.rb
CHANGED
@@ -1,8 +1,10 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require "securerandom"
|
2
4
|
|
3
5
|
module FairDiceRoll
|
4
|
-
RANDOM_NUMBER =
|
5
|
-
|
6
|
+
RANDOM_NUMBER = 12 # chosen by fair dice roll.
|
7
|
+
# guaranteed to be random.
|
6
8
|
end
|
7
9
|
|
8
10
|
module Kernel
|
@@ -20,12 +22,24 @@ class Random
|
|
20
22
|
FairDiceRoll::RANDOM_NUMBER
|
21
23
|
end
|
22
24
|
|
25
|
+
def self.random_number(*)
|
26
|
+
FairDiceRoll::RANDOM_NUMBER
|
27
|
+
end
|
28
|
+
|
23
29
|
def rand(*)
|
24
30
|
FairDiceRoll::RANDOM_NUMBER
|
25
31
|
end
|
32
|
+
|
33
|
+
def random_number(*)
|
34
|
+
FairDiceRoll::RANDOM_NUMBER
|
35
|
+
end
|
26
36
|
end
|
27
37
|
|
28
38
|
module SecureRandom
|
39
|
+
def self.rand(*)
|
40
|
+
FairDiceRoll::RANDOM_NUMBER
|
41
|
+
end
|
42
|
+
|
29
43
|
def self.random_number(*)
|
30
44
|
FairDiceRoll::RANDOM_NUMBER
|
31
45
|
end
|
metadata
CHANGED
@@ -1,66 +1,67 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fair_dice_roll
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 7.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Steve Richert
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-04-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '2'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '2'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '13'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - "
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '13'
|
41
41
|
description: Chosen by fair dice roll. Guaranteed to be random.
|
42
|
-
email: steve.richert@
|
42
|
+
email: steve.richert@hey.com
|
43
43
|
executables: []
|
44
44
|
extensions: []
|
45
|
-
extra_rdoc_files:
|
45
|
+
extra_rdoc_files:
|
46
|
+
- CHANGELOG.md
|
47
|
+
- README.md
|
46
48
|
files:
|
47
|
-
- ".gitignore"
|
48
|
-
- ".rspec"
|
49
|
-
- ".travis.yml"
|
50
49
|
- CHANGELOG.md
|
51
|
-
- CONTRIBUTING.md
|
52
|
-
- Gemfile
|
53
50
|
- LICENSE.txt
|
54
51
|
- README.md
|
55
|
-
- Rakefile
|
56
52
|
- fair_dice_roll.gemspec
|
57
53
|
- lib/fair_dice_roll.rb
|
58
|
-
-
|
59
|
-
- spec/spec_helper.rb
|
54
|
+
- lib/fair_dice_roll/version.rb
|
60
55
|
homepage: https://github.com/laserlemon/fair_dice_roll
|
61
56
|
licenses:
|
62
57
|
- MIT
|
63
|
-
metadata:
|
58
|
+
metadata:
|
59
|
+
allowed_push_host: https://rubygems.org
|
60
|
+
bug_tracker_uri: https://github.com/laserlemon/fair_dice_roll/issues
|
61
|
+
funding_uri: https://github.com/sponsors/laserlemon
|
62
|
+
homepage_uri: https://github.com/laserlemon/fair_dice_roll
|
63
|
+
rubygems_mfa_required: 'true'
|
64
|
+
source_code_uri: https://github.com/laserlemon/fair_dice_roll
|
64
65
|
post_install_message:
|
65
66
|
rdoc_options: []
|
66
67
|
require_paths:
|
@@ -69,18 +70,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
69
70
|
requirements:
|
70
71
|
- - ">="
|
71
72
|
- !ruby/object:Gem::Version
|
72
|
-
version:
|
73
|
+
version: 3.0.0
|
73
74
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
74
75
|
requirements:
|
75
76
|
- - ">="
|
76
77
|
- !ruby/object:Gem::Version
|
77
78
|
version: '0'
|
78
79
|
requirements: []
|
79
|
-
|
80
|
-
rubygems_version: 2.4.6
|
80
|
+
rubygems_version: 3.4.19
|
81
81
|
signing_key:
|
82
82
|
specification_version: 4
|
83
83
|
summary: Guaranteed to be random.
|
84
|
-
test_files:
|
85
|
-
- spec/fair_dice_roll_spec.rb
|
86
|
-
- spec/spec_helper.rb
|
84
|
+
test_files: []
|
data/.gitignore
DELETED
data/.rspec
DELETED
data/.travis.yml
DELETED
@@ -1,23 +0,0 @@
|
|
1
|
-
before_install:
|
2
|
-
- gem update bundler rake
|
3
|
-
branches:
|
4
|
-
only:
|
5
|
-
- master
|
6
|
-
cache: bundler
|
7
|
-
env:
|
8
|
-
global:
|
9
|
-
secure: | # CODECLIMATE_REPO_TOKEN
|
10
|
-
EEoiWSHrAnv1VAlN6msYZPWcdKohINin6vmghWn54uvNcowgLwIr/0S5+Cx7
|
11
|
-
YqY/iYA0OzELX5j5pTgMHLroG4kkbgTnBQe09pFGxhoqA0WOp/uZkyX6dFro
|
12
|
-
yatmOosa1UUiw4aZogfjv2KdP18oILxV3d+lIfqZgUb7o9bTzbw=
|
13
|
-
language: ruby
|
14
|
-
matrix:
|
15
|
-
allow_failures:
|
16
|
-
- rvm: ruby-head
|
17
|
-
rvm:
|
18
|
-
- "2.0"
|
19
|
-
- "2.1"
|
20
|
-
- "2.2"
|
21
|
-
- ruby-head
|
22
|
-
script: bundle exec rspec
|
23
|
-
sudo: false
|
data/CONTRIBUTING.md
DELETED
@@ -1,7 +0,0 @@
|
|
1
|
-
# Contributing
|
2
|
-
|
3
|
-
1. [Fork](https://github.com/laserlemon/fair_dice_roll/fork) it.
|
4
|
-
2. Roll a die… fairly.
|
5
|
-
3. [Record](https://github.com/laserlemon/fair_dice_roll/blob/master/lib/fair_dice_roll.rb#L4) your result.
|
6
|
-
4. Submit a [pull request](https://github.com/laserlemon/fair_dice_roll/pulls).
|
7
|
-
5. Please include photographic [evidence](http://imgur.com/XT16hzE) of your roll.
|
data/Gemfile
DELETED
data/Rakefile
DELETED
data/spec/fair_dice_roll_spec.rb
DELETED
@@ -1,45 +0,0 @@
|
|
1
|
-
describe FairDiceRoll do
|
2
|
-
let(:random_number) { FairDiceRoll::RANDOM_NUMBER }
|
3
|
-
|
4
|
-
describe "#rand" do
|
5
|
-
it "is guaranteed to be random" do
|
6
|
-
expect(rand).to eq(random_number)
|
7
|
-
expect(rand(3)).to eq(random_number)
|
8
|
-
end
|
9
|
-
end
|
10
|
-
|
11
|
-
describe Kernel do
|
12
|
-
describe "#rand" do
|
13
|
-
it "is guaranteed to be random" do
|
14
|
-
expect(Kernel.rand).to eq(random_number)
|
15
|
-
expect(Kernel.rand(3)).to eq(random_number)
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
19
|
-
|
20
|
-
describe Random do
|
21
|
-
describe ".rand" do
|
22
|
-
it "is guaranteed to be random" do
|
23
|
-
expect(Random.rand).to eq(random_number)
|
24
|
-
expect(Random.rand(3)).to eq(random_number)
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
|
-
describe "#rand" do
|
29
|
-
it "is guaranteed to be random" do
|
30
|
-
random = Random.new
|
31
|
-
expect(random.rand).to eq(random_number)
|
32
|
-
expect(random.rand(3)).to eq(random_number)
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|
36
|
-
|
37
|
-
describe SecureRandom do
|
38
|
-
describe "#random_number" do
|
39
|
-
it "is guaranteed to be random" do
|
40
|
-
expect(SecureRandom.random_number).to eq(random_number)
|
41
|
-
expect(SecureRandom.random_number(3)).to eq(random_number)
|
42
|
-
end
|
43
|
-
end
|
44
|
-
end
|
45
|
-
end
|