fair_dice_roll 6.0.0 → 7.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: ffb04977915f9dafbe2255c46c633aac23811d91
4
- data.tar.gz: 21d984236f913cf0b6a87282c5d26cb037e4365c
2
+ SHA256:
3
+ metadata.gz: 4eb996f7a81bf7468f00f5d9942ea458799a7fd576208914aa0ea01292bcfd13
4
+ data.tar.gz: 5cdaeb753e467c049bcb82506185c0dff2c62df09b6cdc90aba585fca93fe935
5
5
  SHA512:
6
- metadata.gz: ecb01844d76e489205a98ec6559d510b3c2e2ffb4956f1abcf7c2d82b97479035a6c6a2025010f0ca64e716fbf73398b6356708f043bcebf8d61d2967ad6e28b
7
- data.tar.gz: 13429ad90d0c571f0964195ea3c5668b83c18dde256cfbb2188b833ea1837de067a7ca33219c002ac2838f81f8c501027012bceee2710af4c72673434cbcbb70
6
+ metadata.gz: 509c3175f9f80d1be8293510677b4823235811566404ce1e6aecc896dfed70a7d3142e709601a8969bd07a44168e5db054baf89a48a0424b19071a7857f1e759
7
+ data.tar.gz: 26be6a460899b204358c3aae4d9f0b4ce5ed0ff28470d4e575118478a70840cf0cc7b493e3124e9b196b778993fdf51c672086cfe45b13d494c3f1f593d57693
data/CHANGELOG.md CHANGED
@@ -1,23 +1,84 @@
1
- ## 5.1.0.rc1 / 2015-05-04
1
+ # Changelog
2
2
 
3
- * [ENHANCEMENT] Re-roll
3
+ All notable changes to this project will be documented in this file.
4
4
 
5
- ## 5.0.0 / 2015-03-31
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
- * [ENHANCEMENT] Re-roll
8
+ ## [Unreleased]
8
9
 
9
- ## 4.0.0 / 2015-03-03
10
+ ## [7.0.0] - 2024-04-15
10
11
 
11
- * [ENHANCEMENT] Re-roll
12
+ ### Added
12
13
 
13
- ## 3.0.0 / 2014-07-28
14
+ - Support for truly random Random.random_number, Random#random_number, and SecureRandom.rand methods
15
+ - Support for maintained Ruby versions 3.0, 3.1, and 3.2
16
+ - RuboCop for code formatting
17
+ - Test to assert proper XKCD code formatting
14
18
 
15
- * [ENHANCEMENT] Re-roll
19
+ ### Changed
16
20
 
17
- ## 2.0.0 / 2014-07-11
21
+ - Re-roll
18
22
 
19
- * [ENHANCEMENT] Re-roll
23
+ ### Removed
20
24
 
21
- ## 1.0.0 / 2014-07-09
25
+ - Support for EOL Ruby versions earlier than 3.0
22
26
 
23
- * Initial release!
27
+ ## [6.0.0] - 2015-09-01
28
+
29
+ ### Changed
30
+
31
+ - Re-roll
32
+
33
+ ## [5.1.0] - 2015-09-01
34
+
35
+ ### Changed
36
+
37
+ - Officially promote the version 5.1.0 release candidate
38
+
39
+ ## [5.1.0.rc1] - 2015-05-04
40
+
41
+ ### Changed
42
+
43
+ - Re-roll
44
+
45
+ ## [5.0.0] - 2015-03-31
46
+
47
+ ### Changed
48
+
49
+ - Re-roll
50
+
51
+ ## [4.0.0] - 2015-03-03
52
+
53
+ ### Changed
54
+
55
+ - Re-roll
56
+
57
+ ## [3.0.0] - 2014-07-28
58
+
59
+ ### Changed
60
+
61
+ - Re-roll
62
+
63
+ ## [2.0.0] - 2014-07-11
64
+
65
+ ### Changed
66
+
67
+ - Re-roll
68
+
69
+ ## [1.0.0] - 2014-07-09
70
+
71
+ ### Added
72
+
73
+ - Initial release!
74
+
75
+ [unreleased]: https://github.com/laserlemon/fair_dice_roll/compare/v7.0.0...HEAD
76
+ [7.0.0]: https://github.com/laserlemon/fair_dice_roll/compare/v6.0.0...v7.0.0
77
+ [6.0.0]: https://github.com/laserlemon/fair_dice_roll/compare/v5.1.0...v6.0.0
78
+ [5.1.0]: https://github.com/laserlemon/fair_dice_roll/compare/v5.1.0.rc1...v5.1.0
79
+ [5.1.0.rc1]: https://github.com/laserlemon/fair_dice_roll/compare/v5.0.0...v5.1.0.rc1
80
+ [5.0.0]: https://github.com/laserlemon/fair_dice_roll/compare/v4.0.0...v5.0.0
81
+ [4.0.0]: https://github.com/laserlemon/fair_dice_roll/compare/v3.0.0...v4.0.0
82
+ [3.0.0]: https://github.com/laserlemon/fair_dice_roll/compare/v2.0.0...v3.0.0
83
+ [2.0.0]: https://github.com/laserlemon/fair_dice_roll/compare/v1.0.0...v2.0.0
84
+ [1.0.0]: https://github.com/laserlemon/fair_dice_roll/commits/v1.0.0
data/LICENSE.txt CHANGED
@@ -1,22 +1,21 @@
1
- Copyright (c) 2014 Steve Richert
1
+ The MIT License (MIT)
2
2
 
3
- MIT License
3
+ Copyright (c) 2014 Steve Richert
4
4
 
5
- Permission is hereby granted, free of charge, to any person obtaining
6
- a copy of this software and associated documentation files (the
7
- "Software"), to deal in the Software without restriction, including
8
- without limitation the rights to use, copy, modify, merge, publish,
9
- distribute, sublicense, and/or sell copies of the Software, and to
10
- permit persons to whom the Software is furnished to do so, subject to
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
- included in all copies or substantial portions of the Software.
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
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
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.svg?style=flat)](http://rubygems.org/gems/fair_dice_roll)
6
- [![Build Status](https://img.shields.io/travis/laserlemon/fair_dice_roll/master.svg?style=flat)](https://travis-ci.org/laserlemon/fair_dice_roll)
7
- [![Code Climate](https://img.shields.io/codeclimate/github/laserlemon/fair_dice_roll.svg?style=flat)](https://codeclimate.com/github/laserlemon/fair_dice_roll)
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/master/lib/fair_dice_roll.rb#L4) your result.
29
+ 3. [Record](https://github.com/laserlemon/fair_dice_roll/blob/-/lib/fair_dice_roll.rb#L4) your result.
32
30
  4. Submit a [pull request](https://github.com/laserlemon/fair_dice_roll/pulls).
33
- 5. Please include photographic [evidence](http://imgur.com/XT16hzE) of your roll.
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
 
@@ -1,19 +1,40 @@
1
- # encoding: utf-8
1
+ # frozen_string_literal: true
2
2
 
3
- Gem::Specification.new do |spec|
4
- spec.name = "fair_dice_roll"
5
- spec.version = "6.0.0"
3
+ require_relative "lib/fair_dice_roll/version"
6
4
 
7
- spec.author = "Steve Richert"
8
- spec.email = "steve.richert@gmail.com"
9
- spec.summary = "Guaranteed to be random."
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.homepage = "https://github.com/laserlemon/fair_dice_roll"
12
- spec.license = "MIT"
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 = `git ls-files -z`.split("\x0")
15
- spec.test_files = spec.files.grep(/^spec/)
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.add_development_dependency "bundler", "~> 1.9"
18
- spec.add_development_dependency "rake", "~> 10.4"
36
+ spec.extra_rdoc_files = [
37
+ "CHANGELOG.md",
38
+ "README.md",
39
+ ]
19
40
  end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module FairDiceRoll
4
+ VERSION = Gem::Version.new("7.0.0")
5
+ end
@@ -1,8 +1,10 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "securerandom"
2
4
 
3
5
  module FairDiceRoll
4
- RANDOM_NUMBER = "P" # chosen by fair dice roll.
5
- # guaranteed to be random.
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: 6.0.0
4
+ version: 7.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steve Richert
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-09-01 00:00:00.000000000 Z
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: '1.9'
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: '1.9'
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: '10.4'
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: '10.4'
40
+ version: '13'
41
41
  description: Chosen by fair dice roll. Guaranteed to be random.
42
- email: steve.richert@gmail.com
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
- - spec/fair_dice_roll_spec.rb
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: '0'
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
- rubyforge_project:
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
@@ -1,3 +0,0 @@
1
- /.bundle/
2
- /Gemfile.lock
3
- /pkg/
data/.rspec DELETED
@@ -1,4 +0,0 @@
1
- --color
2
- --format documentation
3
- --order random
4
- --require spec_helper
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
@@ -1,8 +0,0 @@
1
- source "https://rubygems.org"
2
-
3
- gemspec
4
-
5
- group :test do
6
- gem "codeclimate-test-reporter", require: false
7
- gem "rspec", "~> 3.2"
8
- end
data/Rakefile DELETED
@@ -1,6 +0,0 @@
1
- require "bundler/gem_tasks"
2
- require "rspec/core/rake_task"
3
-
4
- RSpec::Core::RakeTask.new(:spec)
5
-
6
- task default: :spec
@@ -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
data/spec/spec_helper.rb DELETED
@@ -1,6 +0,0 @@
1
- if ENV["CODECLIMATE_REPO_TOKEN"]
2
- require "codeclimate-test-reporter"
3
- CodeClimate::TestReporter.start
4
- end
5
-
6
- require "fair_dice_roll"