nerd_dice 0.1.2 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/.rubocop.yml +117 -16
- data/CHANGELOG.md +38 -4
- data/Gemfile +2 -2
- data/Gemfile.lock +42 -67
- data/README.md +52 -5
- data/bin/generate_checksums +2 -2
- data/certs/msducheminjr.pem +24 -25
- data/lib/nerd_dice/configuration.rb +47 -0
- data/lib/nerd_dice/version.rb +1 -1
- data/lib/nerd_dice.rb +148 -19
- data/nerd_dice.gemspec +5 -8
- data.tar.gz.sig +0 -0
- metadata +48 -77
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7a931b4532dcafcb4ce3aeddf3ac30399bb9334d25bf78671a0811366670d719
|
4
|
+
data.tar.gz: 970d96a32b68dc1fc75618376bf059707c5c711441d30edd6302dcd37e831c8b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5cdbd36e786d2c4e6f8950f4486119548bb1a62babdbf3c9ae4fadba095170b9300461411926d19ca50e5e8d277804c3f8cb61e28d96605fd5fad8b7e9c9b700
|
7
|
+
data.tar.gz: 21b2b92dbf7ad4060a888d267383e9c87b3e310dff4931bb1853f401fb417f480a2bea7cca859ad75d3eac83608a4631541a36afc7449955a68ea8ff84c319c7
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/.rubocop.yml
CHANGED
@@ -1,11 +1,3 @@
|
|
1
|
-
# RuboCop configuration file for NerdDice gem
|
2
|
-
#
|
3
|
-
# This is the RuboCop configuration for the gem. By default new cops are enabled
|
4
|
-
# by default when the RuboCop gems are updated in the bundle. Before the would
|
5
|
-
# show up as warnings until they were added to the configuration file. Now they
|
6
|
-
# will be enabled by default, and a case-by-case descision can be made whether
|
7
|
-
# to exclude new violations in the configuration explicitly or update the
|
8
|
-
# codebase to the gem to conform to the new standard.
|
9
1
|
require:
|
10
2
|
- rubocop-performance
|
11
3
|
- rubocop-rake
|
@@ -16,12 +8,14 @@ AllCops:
|
|
16
8
|
# RuboCop has a bunch of cops enabled by default. This setting tells RuboCop
|
17
9
|
# to ignore them, so only the ones explicitly set in this file are enabled.
|
18
10
|
#DisabledByDefault: true
|
19
|
-
|
20
|
-
# New cops are now enabled by default as of 2023-02-20
|
21
|
-
NewCops: enable
|
22
11
|
Exclude:
|
23
12
|
- '**/templates/**/*'
|
24
13
|
- '**/vendor/**/*'
|
14
|
+
- 'node_modules/**/*'
|
15
|
+
|
16
|
+
Performance:
|
17
|
+
Exclude:
|
18
|
+
- '**/test/**/*'
|
25
19
|
|
26
20
|
# Prefer &&/|| over and/or.
|
27
21
|
Style/AndOr:
|
@@ -117,6 +111,15 @@ Style/MethodDefParentheses:
|
|
117
111
|
Style/FrozenStringLiteralComment:
|
118
112
|
Enabled: true
|
119
113
|
EnforcedStyle: always
|
114
|
+
Exclude:
|
115
|
+
- 'actionview/test/**/*.builder'
|
116
|
+
- 'actionview/test/**/*.ruby'
|
117
|
+
- 'actionpack/test/**/*.builder'
|
118
|
+
- 'actionpack/test/**/*.ruby'
|
119
|
+
- 'activestorage/db/migrate/**/*.rb'
|
120
|
+
- 'activestorage/db/update_migrate/**/*.rb'
|
121
|
+
- 'actionmailbox/db/migrate/**/*.rb'
|
122
|
+
- 'actiontext/db/migrate/**/*.rb'
|
120
123
|
|
121
124
|
Style/RedundantFreeze:
|
122
125
|
Enabled: true
|
@@ -188,6 +191,30 @@ Lint/UselessAssignment:
|
|
188
191
|
Lint/DeprecatedClassMethods:
|
189
192
|
Enabled: true
|
190
193
|
|
194
|
+
Lint/DuplicateBranch: # (new in 1.3)
|
195
|
+
Enabled: true
|
196
|
+
|
197
|
+
Lint/DuplicateRegexpCharacterClassElement: # (new in 1.1)
|
198
|
+
Enabled: true
|
199
|
+
|
200
|
+
Lint/EmptyBlock: # (new in 1.1)
|
201
|
+
Enabled: true
|
202
|
+
|
203
|
+
Lint/EmptyClass: # (new in 1.3)
|
204
|
+
Enabled: true
|
205
|
+
|
206
|
+
Lint/NoReturnInBeginEndBlocks: # (new in 1.2)
|
207
|
+
Enabled: true
|
208
|
+
|
209
|
+
Lint/ToEnumArguments: # (new in 1.1)
|
210
|
+
Enabled: true
|
211
|
+
|
212
|
+
Lint/UnexpectedBlockArity: # (new in 1.5)
|
213
|
+
Enabled: true
|
214
|
+
|
215
|
+
Lint/UnmodifiedReduceAccumulator: # (new in 1.1)
|
216
|
+
Enabled: true
|
217
|
+
|
191
218
|
Style/ParenthesesAroundCondition:
|
192
219
|
Enabled: true
|
193
220
|
|
@@ -209,6 +236,27 @@ Style/ColonMethodCall:
|
|
209
236
|
Style/TrivialAccessors:
|
210
237
|
Enabled: true
|
211
238
|
|
239
|
+
Style/ArgumentsForwarding: # (new in 1.1)
|
240
|
+
Enabled: true
|
241
|
+
|
242
|
+
Style/CollectionCompact: # (new in 1.2)
|
243
|
+
Enabled: true
|
244
|
+
|
245
|
+
Style/DocumentDynamicEvalDefinition: # (new in 1.1)
|
246
|
+
Enabled: true
|
247
|
+
|
248
|
+
Style/NegatedIfElseCondition: # (new in 1.2)
|
249
|
+
Enabled: true
|
250
|
+
|
251
|
+
Style/NilLambda: # (new in 1.3)
|
252
|
+
Enabled: true
|
253
|
+
|
254
|
+
Style/RedundantArgument: # (new in 1.4)
|
255
|
+
Enabled: true
|
256
|
+
|
257
|
+
Style/SwapValues: # (new in 1.1)
|
258
|
+
Enabled: true
|
259
|
+
|
212
260
|
Performance/FlatMap:
|
213
261
|
Enabled: true
|
214
262
|
|
@@ -227,9 +275,62 @@ Performance/RegexpMatch:
|
|
227
275
|
Performance/UnfreezeString:
|
228
276
|
Enabled: true
|
229
277
|
|
230
|
-
|
231
|
-
|
278
|
+
Performance/AncestorsInclude: # (new in 1.7)
|
279
|
+
Enabled: true
|
280
|
+
|
281
|
+
Performance/BigDecimalWithNumericArgument: # (new in 1.7)
|
282
|
+
Enabled: true
|
283
|
+
|
284
|
+
Performance/BlockGivenWithExplicitBlock: # (new in 1.9)
|
285
|
+
Enabled: true
|
286
|
+
|
287
|
+
Performance/CollectionLiteralInLoop: # (new in 1.8)
|
288
|
+
Enabled: true
|
289
|
+
|
290
|
+
Performance/ConstantRegexp: # (new in 1.9)
|
291
|
+
Enabled: true
|
292
|
+
|
293
|
+
Performance/MethodObjectAsBlock: # (new in 1.9)
|
294
|
+
Enabled: true
|
295
|
+
|
296
|
+
Performance/RedundantSortBlock: # (new in 1.7)
|
297
|
+
Enabled: true
|
298
|
+
|
299
|
+
Performance/RedundantStringChars: # (new in 1.7)
|
300
|
+
Enabled: true
|
301
|
+
|
302
|
+
Performance/ReverseFirst: # (new in 1.7)
|
303
|
+
Enabled: true
|
304
|
+
|
305
|
+
Performance/SortReverse: # (new in 1.7)
|
306
|
+
Enabled: true
|
307
|
+
|
308
|
+
Performance/Squeeze: # (new in 1.7)
|
309
|
+
Enabled: true
|
310
|
+
|
311
|
+
Performance/StringInclude: # (new in 1.7)
|
312
|
+
Enabled: true
|
313
|
+
|
314
|
+
Performance/Sum: # (new in 1.8)
|
315
|
+
Enabled: true
|
316
|
+
|
317
|
+
Layout/SpaceBeforeBrackets: # (new in 1.7)
|
318
|
+
Enabled: true
|
319
|
+
|
320
|
+
Lint/AmbiguousAssignment: # (new in 1.7)
|
321
|
+
Enabled: true
|
232
322
|
|
233
|
-
#
|
234
|
-
|
235
|
-
|
323
|
+
Lint/DeprecatedConstants: # (new in 1.8)
|
324
|
+
Enabled: true
|
325
|
+
|
326
|
+
Lint/LambdaWithoutLiteralBlock: # (new in 1.8)
|
327
|
+
Enabled: true
|
328
|
+
|
329
|
+
Lint/RedundantDirGlobSort: # (new in 1.8)
|
330
|
+
Enabled: true
|
331
|
+
|
332
|
+
Style/EndlessMethod: # (new in 1.8)
|
333
|
+
Enabled: true
|
334
|
+
|
335
|
+
Style/HashExcept: # (new in 1.7)
|
336
|
+
Enabled: true
|
data/CHANGELOG.md
CHANGED
@@ -1,8 +1,42 @@
|
|
1
1
|
# Nerd Dice Changelog
|
2
2
|
|
3
|
-
|
3
|
+
## master \(unreleased\)
|
4
|
+
### Added
|
5
|
+
### Changed
|
6
|
+
### Fixed
|
4
7
|
|
5
|
-
##
|
6
|
-
|
8
|
+
## 0.2.0 \(2020-12-12\)
|
9
|
+
### Added
|
10
|
+
* Add ability to configure with `NerdDice.configure` block or `NerdDice.configuration`
|
11
|
+
- Configure `randomization_technique` as `:random_rand`, `:securerandom`, `:random_object`, or `randomized`
|
12
|
+
- Configure `refresh_seed_interval` to allow a periodic refresh of the seed
|
13
|
+
* Add `randomization_technique` option to `NerdDice.total_dice` method keyword arguments
|
14
|
+
* Add a lower-level `execute_die_roll` method that allows you to roll a single die with a generator specified
|
15
|
+
* Add ability to manually refresh or specify seed with `:refresh_seed!` method
|
16
|
+
### Changed
|
17
|
+
* Change `opts = {}` final argument to use keyword args `**opts` in the `NerdDice.total_dice` method. Now the method can be called as follows:
|
18
|
+
```ruby
|
19
|
+
# old
|
20
|
+
NerdDice.total_dice(20, 1, {bonus: 5})
|
21
|
+
NerdDice.total_dice(6, 3, {bonus: 1})
|
7
22
|
|
8
|
-
|
23
|
+
# new
|
24
|
+
NerdDice.total_dice(20, bonus: 5)
|
25
|
+
NerdDice.total_dice(6, 3, bonus: 1)
|
26
|
+
```
|
27
|
+
* Call `:to_i` on bonus instead of using `:is_a?` and raise ArgumentError in the `NerdDice.total_dice` method if it doesn't respond to `:to_i`
|
28
|
+
* Added `securerandom` as an explicit dependency due to Ruby 3.x change to bundled gem
|
29
|
+
* `total_dice` no longer calls unqualified `.rand` which improves performance on all generators except for `:securerandom`
|
30
|
+
### Fixed
|
31
|
+
|
32
|
+
## 0.1.1 \(2020-12-12\)
|
33
|
+
### Added
|
34
|
+
### Changed
|
35
|
+
### Fixed
|
36
|
+
* Fix broken link to CHANGELOG in gemspec
|
37
|
+
* Fix rubocop offenses from 0.1.0 and refactor specs
|
38
|
+
|
39
|
+
## 0.1.0 \(2020-12-07\)
|
40
|
+
|
41
|
+
### Added
|
42
|
+
* Add NerdDice.total_dice class method with the ability to roll multiple polyhedral dice and add a bonus
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,93 +1,68 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
nerd_dice (0.
|
5
|
-
securerandom (~> 0.
|
4
|
+
nerd_dice (0.2.0)
|
5
|
+
securerandom (~> 0.1, >= 0.1.0)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
10
|
ast (2.4.2)
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
thor (~> 1.2)
|
15
|
-
tins (~> 1.32)
|
16
|
-
diff-lcs (1.5.0)
|
17
|
-
docile (1.4.0)
|
18
|
-
json (2.6.3)
|
19
|
-
parallel (1.22.1)
|
20
|
-
parser (3.2.1.0)
|
11
|
+
diff-lcs (1.4.4)
|
12
|
+
parallel (1.20.1)
|
13
|
+
parser (3.0.0.0)
|
21
14
|
ast (~> 2.4.1)
|
22
|
-
rainbow (3.
|
23
|
-
rake (
|
24
|
-
regexp_parser (2.
|
25
|
-
rexml (3.2.
|
26
|
-
rspec (3.
|
27
|
-
rspec-core (~> 3.
|
28
|
-
rspec-expectations (~> 3.
|
29
|
-
rspec-mocks (~> 3.
|
30
|
-
rspec-core (3.
|
31
|
-
rspec-support (~> 3.
|
32
|
-
rspec-expectations (3.
|
15
|
+
rainbow (3.0.0)
|
16
|
+
rake (12.3.3)
|
17
|
+
regexp_parser (2.0.3)
|
18
|
+
rexml (3.2.4)
|
19
|
+
rspec (3.10.0)
|
20
|
+
rspec-core (~> 3.10.0)
|
21
|
+
rspec-expectations (~> 3.10.0)
|
22
|
+
rspec-mocks (~> 3.10.0)
|
23
|
+
rspec-core (3.10.1)
|
24
|
+
rspec-support (~> 3.10.0)
|
25
|
+
rspec-expectations (3.10.1)
|
33
26
|
diff-lcs (>= 1.2.0, < 2.0)
|
34
|
-
rspec-support (~> 3.
|
35
|
-
rspec-mocks (3.
|
27
|
+
rspec-support (~> 3.10.0)
|
28
|
+
rspec-mocks (3.10.1)
|
36
29
|
diff-lcs (>= 1.2.0, < 2.0)
|
37
|
-
rspec-support (~> 3.
|
38
|
-
rspec-support (3.
|
39
|
-
rubocop (1.
|
40
|
-
json (~> 2.3)
|
30
|
+
rspec-support (~> 3.10.0)
|
31
|
+
rspec-support (3.10.1)
|
32
|
+
rubocop (1.8.1)
|
41
33
|
parallel (~> 1.10)
|
42
|
-
parser (>= 3.
|
34
|
+
parser (>= 3.0.0.0)
|
43
35
|
rainbow (>= 2.2.2, < 4.0)
|
44
36
|
regexp_parser (>= 1.8, < 3.0)
|
45
|
-
rexml
|
46
|
-
rubocop-ast (>= 1.
|
37
|
+
rexml
|
38
|
+
rubocop-ast (>= 1.2.0, < 2.0)
|
47
39
|
ruby-progressbar (~> 1.7)
|
48
|
-
unicode-display_width (>=
|
49
|
-
rubocop-ast (1.
|
50
|
-
parser (>=
|
51
|
-
rubocop-
|
52
|
-
rubocop (
|
53
|
-
rubocop-performance (1.16.0)
|
54
|
-
rubocop (>= 1.7.0, < 2.0)
|
40
|
+
unicode-display_width (>= 1.4.0, < 3.0)
|
41
|
+
rubocop-ast (1.4.1)
|
42
|
+
parser (>= 2.7.1.5)
|
43
|
+
rubocop-performance (1.9.2)
|
44
|
+
rubocop (>= 0.90.0, < 2.0)
|
55
45
|
rubocop-ast (>= 0.4.0)
|
56
|
-
rubocop-rake (0.
|
46
|
+
rubocop-rake (0.5.1)
|
47
|
+
rubocop
|
48
|
+
rubocop-rspec (2.1.0)
|
57
49
|
rubocop (~> 1.0)
|
58
|
-
|
59
|
-
rubocop (~> 1.33)
|
60
|
-
rubocop-capybara (~> 2.17)
|
50
|
+
rubocop-ast (>= 1.1.0)
|
61
51
|
ruby-progressbar (1.11.0)
|
62
|
-
securerandom (0.
|
63
|
-
|
64
|
-
docile (~> 1.1)
|
65
|
-
simplecov-html (~> 0.11)
|
66
|
-
simplecov_json_formatter (~> 0.1)
|
67
|
-
simplecov-html (0.12.3)
|
68
|
-
simplecov-lcov (0.8.0)
|
69
|
-
simplecov_json_formatter (0.1.4)
|
70
|
-
sync (0.5.0)
|
71
|
-
term-ansicolor (1.7.1)
|
72
|
-
tins (~> 1.0)
|
73
|
-
thor (1.2.1)
|
74
|
-
tins (1.32.1)
|
75
|
-
sync
|
76
|
-
unicode-display_width (2.4.2)
|
52
|
+
securerandom (0.1.0)
|
53
|
+
unicode-display_width (2.0.0)
|
77
54
|
|
78
55
|
PLATFORMS
|
79
56
|
ruby
|
80
57
|
|
81
58
|
DEPENDENCIES
|
82
|
-
coveralls_reborn (~> 0.27.0)
|
83
59
|
nerd_dice!
|
84
|
-
rake (~>
|
85
|
-
rspec (~> 3.
|
86
|
-
rubocop (~> 1.
|
87
|
-
rubocop-performance (~> 1.
|
88
|
-
rubocop-rake (~> 0.
|
89
|
-
rubocop-rspec (~> 2.
|
90
|
-
simplecov-lcov (~> 0.8.0)
|
60
|
+
rake (~> 12.0)
|
61
|
+
rspec (~> 3.0)
|
62
|
+
rubocop (~> 1.8, >= 1.8.1)
|
63
|
+
rubocop-performance (~> 1.9, >= 1.9.1)
|
64
|
+
rubocop-rake (~> 0.5, >= 0.5.1)
|
65
|
+
rubocop-rspec (~> 2.1, >= 2.1.0)
|
91
66
|
|
92
67
|
BUNDLED WITH
|
93
|
-
2.
|
68
|
+
2.2.3
|
data/README.md
CHANGED
@@ -18,18 +18,64 @@ Or install it yourself as:
|
|
18
18
|
$ gem install nerd_dice
|
19
19
|
|
20
20
|
## Usage
|
21
|
+
### Configuration
|
22
|
+
You can customize the behavior of NerdDice via a configuration block as below or by assigning an individual property via the ```NerdDice.configuration.property = value``` syntax \(where ```property``` is the config property and ```value``` is the value you want to assign\)\. The available configuration options as well as their defaults, if applicable, are listed in the example configuration block below:
|
23
|
+
|
24
|
+
```ruby
|
25
|
+
NerdDice.configure do | config|
|
26
|
+
|
27
|
+
# number of ability scores to place in an ability score array
|
28
|
+
config.ability_score_array_size = 6
|
29
|
+
|
30
|
+
# randomization technique options are:
|
31
|
+
# :securerandom => Uses SecureRandom.rand(). Good entropy, medium speed.
|
32
|
+
# :random_rand => Uses Random.rand(). Class method. Poor entropy, fastest speed.
|
33
|
+
# (Seed is shared with other processes. Too predictable)
|
34
|
+
# :random_object => Uses Random.new() and calls rand()
|
35
|
+
# Medium entropy, fastest speed. (Performs the best under speed benchmark)
|
36
|
+
# :randomized => Uses a random choice of the :securerandom, :rand, and :random_new_interval options above
|
37
|
+
config.randomization_technique = :random_object # fast with independent seed
|
38
|
+
|
39
|
+
# Number of iterations to use on a generator before refreshing the seed
|
40
|
+
# 1 very slow and heavy pressure on processor and memory but very high entropy
|
41
|
+
# 1000 would refresh the object every 1000 times you call rand()
|
42
|
+
config.refresh_seed_interval = nil # don't refresh the seed
|
43
|
+
end
|
44
|
+
```
|
45
|
+
|
21
46
|
### Rolling a number of dice and adding a bonus
|
22
47
|
```ruby
|
23
48
|
# roll a single d4
|
24
49
|
NerdDice.total_dice(4) # => return random Integer between 1-4
|
25
50
|
|
26
51
|
# roll 3d6
|
27
|
-
NerdDice.total_dice(6, 3) => return Integer total of three 6-sided dice
|
52
|
+
NerdDice.total_dice(6, 3) # => return Integer total of three 6-sided dice
|
28
53
|
|
29
54
|
# roll a d20 and add 5 to the value
|
30
|
-
NerdDice.total_dice(20,
|
55
|
+
NerdDice.total_dice(20, bonus: 5)
|
56
|
+
|
57
|
+
# roll a d20 and overide the configured randomization_technique one time
|
58
|
+
# without changing the config
|
59
|
+
NerdDice.total_dice(20, randomization_technique: :randomized)
|
31
60
|
```
|
32
|
-
__NOTE:__ If provided, the bonus must
|
61
|
+
__NOTE:__ If provided, the bonus must respond to `:to_i` or an `ArgumentError` will be raised
|
62
|
+
|
63
|
+
### Manually setting or refreshing the random generator seed
|
64
|
+
For randomization techniques other than `:securerandom` you can manually set or refresh the generator's seed by calling the `refresh_seed!` method. This is automatically called at the interval specified in `NerdDice.configuration.refresh_seed_interval` if it is not nil.
|
65
|
+
|
66
|
+
```ruby
|
67
|
+
# no arguments, will refresh the seed for the configured generator(s) only
|
68
|
+
NerdDice.refresh_seed! # => hash with old seed(s) or nil if :securerandom
|
69
|
+
|
70
|
+
# OPTIONS:
|
71
|
+
# randomization_technique (Symbol) => NerdDice::RANDOMIZATION_TECHNIQUES
|
72
|
+
# random_rand_seed (Integer) => Seed to set for Random
|
73
|
+
# random_object_seed (Integer) => Seed to set for new Random object
|
74
|
+
NerdDice.refresh_seed!(randomization_technique: :randomized,
|
75
|
+
random_rand_seed: 1337,
|
76
|
+
random_object_seed: 24601)
|
77
|
+
```
|
78
|
+
__NOTE:__ Ability to specify a seed it primarily provided for testing purposes. This makes all random numbers generated _transparently deterministic_ and should not be used if you want behavior approximating randomness.
|
33
79
|
|
34
80
|
## Development
|
35
81
|
|
@@ -39,8 +85,9 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
39
85
|
|
40
86
|
## Contributing
|
41
87
|
|
42
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/statelesscode/nerd_dice/issues. We welcome and encourage your participation in this open-source project. We welcome those of all backgrounds and abilities, but we refuse to adopt the Contributor Covenant for reasons outlined in [BURN_THE_CONTRIBUTOR_COVENANT_WITH_FIRE.md](BURN_THE_CONTRIBUTOR_COVENANT_WITH_FIRE.md)
|
88
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/statelesscode/nerd_dice/issues. We welcome and encourage your participation in this open-source project. We welcome those of all backgrounds and abilities, but we refuse to adopt the Contributor Covenant for reasons outlined in [BURN_THE_CONTRIBUTOR_COVENANT_WITH_FIRE.md](https://github.com/statelesscode/nerd_dice/blob/master/BURN_THE_CONTRIBUTOR_COVENANT_WITH_FIRE.md)
|
89
|
+
|
43
90
|
|
44
91
|
## Unlicense, License, and Copyright
|
45
92
|
|
46
|
-
The document is dual-licensed under the [MIT](https://opensource.org/licenses/MIT) license and the [UNLICENSE](https://unlicense.org/) \(with strong preference toward the UNLICENSE\)\. The content is released under [CC0](https://creativecommons.org/share-your-work/public-domain/cc0/) \(no rights reserved\). You are free to include it in its original form or modified with or without modification in your own project\.
|
93
|
+
The document is dual-licensed under the [MIT](https://opensource.org/licenses/MIT) license and the [UNLICENSE](https://unlicense.org/) \(with strong preference toward the UNLICENSE\)\. The content is released under [CC0](https://creativecommons.org/share-your-work/public-domain/cc0/) \(no rights reserved\). You are free to include it in its original form or modified with or without modification in your own project\.
|
data/bin/generate_checksums
CHANGED
@@ -7,7 +7,7 @@ version = ARGV[0]
|
|
7
7
|
built_gem_path = "pkg/nerd_dice-#{version}.gem"
|
8
8
|
checksum = Digest::SHA512.new.hexdigest(File.read(built_gem_path))
|
9
9
|
checksum_path = "checksum/nerd_dice-#{version}.gem.sha512"
|
10
|
-
File.
|
10
|
+
File.open(checksum_path, "w") { |f| f.write(checksum) }
|
11
11
|
sha256 = Digest::SHA256.new.hexdigest(File.read(built_gem_path))
|
12
12
|
checksum_256_path = "checksum/nerd_dice-#{version}.gem.sha256"
|
13
|
-
File.
|
13
|
+
File.open(checksum_256_path, "w") { |f| f.write(sha256) }
|
data/certs/msducheminjr.pem
CHANGED
@@ -1,27 +1,26 @@
|
|
1
1
|
-----BEGIN CERTIFICATE-----
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
t+NX7PDOWx4k
|
2
|
+
MIIETTCCArWgAwIBAgIBATANBgkqhkiG9w0BAQsFADAoMSYwJAYDVQQDDB1zdGF0
|
3
|
+
ZWxlc3Njb2RlL0RDPWdtYWlsL0RDPWNvbTAeFw0yMDEyMDYyMzQ1NTZaFw0yMTEy
|
4
|
+
MDYyMzQ1NTZaMCgxJjAkBgNVBAMMHXN0YXRlbGVzc2NvZGUvREM9Z21haWwvREM9
|
5
|
+
Y29tMIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEAyHIMJi0o3bwBZsx5
|
6
|
+
TQ35XByFsdDRsro3T+0NY7EAILtOiU04o9C2NPOp/RQE7BXQgMjGebwp6bT6QvzN
|
7
|
+
6noV4jPL7Fi5pWw08QygG7f+73YUBb+8d8o+3xGrC+UO5h1PZEtVcZwUWUG18QBE
|
8
|
+
fbDinQT6P4IDQoZwhfrPCB+aBfUyQp4Ok7oD7MEWqsq9SjrSxqxfk4+oZdXUySe7
|
9
|
+
Vi5vnzVQ5uFf56NHwWnNKCzJzmH84mBO5MzHaQpHNzKGJPoUmzLU5RBlCH6YXqBG
|
10
|
+
KhXTMUDBWKJmJ3RDry/FpGgJLKu4wzFRYjXla6IjeKozWGuPNNJ+2mesXKhsX7bo
|
11
|
+
vVCzRxPEupbEg/0FkJiWpiGlSPOdd6oJiwX8E6rlEeV605xrbOQewkbovHkYTMtG
|
12
|
+
+NH+u08x0z4Oj71kmDLwuj812uS0mtrCg2VhiYO0ZCQ4XrwBsBfK+/MtMlR+o6sG
|
13
|
+
/zvz/vHVJKaLTQxRp5oGo4QH6HfbOnwzTkXdZnt5AlN31ErJAgMBAAGjgYEwfzAJ
|
14
|
+
BgNVHRMEAjAAMAsGA1UdDwQEAwIEsDAdBgNVHQ4EFgQUC7seYydsGO6O1qT4nVVD
|
15
|
+
G/LkiHYwIgYDVR0RBBswGYEXc3RhdGVsZXNzY29kZUBnbWFpbC5jb20wIgYDVR0S
|
16
|
+
BBswGYEXc3RhdGVsZXNzY29kZUBnbWFpbC5jb20wDQYJKoZIhvcNAQELBQADggGB
|
17
|
+
ADPRFRB1cjqdcE2O0jtqiDRmrR62uEYBiUbkRPVhyoEp/cK0TVhAs9mGWAyCWu0M
|
18
|
+
LewUeqNTUvQ9MgvagcKcnxa2RTjdrP3nGnwpStMr9bm3ArNJEzvWEs0Eusk9y73x
|
19
|
+
fjy0qH2pw5WPfWcKYlDehMXqOP+a4udYsz0YSNiI8qEfkDCSqTJN11d5kSjVjwGB
|
20
|
+
xkauxDT68j1JZRjPmQl3dl+DCgxkoziWX2mFTPLfGg5vZ0t6gmhdUtLvJtNIo0IX
|
21
|
+
477E5UjmE1+rULQp/fsH6n5+H+t2eCED41ST+gkKbaQBUfIuUaCmdHz9sJaIIBw2
|
22
|
+
6ordFa1nrLV4w5Uf6qYFnWVhIWX4GToyZSPO2s0DPYp3PWFJ4VtzKa2vp1TR5ZEA
|
23
|
+
dkij2eQ9M8bzWWmW+A7RNaI0CzLl967bKGBSaMVCsZGBarggWD8UwJnBhTuOPZGR
|
24
|
+
WQ4faXJSevxT+x9TgyUNJINPkz/KqreClzdL83cwxPzFFQto7zF6zMCsj0slqJjW
|
25
|
+
EQ==
|
27
26
|
-----END CERTIFICATE-----
|
@@ -0,0 +1,47 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module NerdDice
|
4
|
+
# The NerdDice::Configuration class allows you to configure and customize the
|
5
|
+
# options of the NerdDice gem to suit your specific needs. You can specify
|
6
|
+
# properties like the randomization technique used by the gem, the number of
|
7
|
+
# ability scores in an ability score array, etc. See the README for a list of
|
8
|
+
# configurable attributes.
|
9
|
+
#
|
10
|
+
# Usage:
|
11
|
+
# The configuration can either be set via a configure block:
|
12
|
+
# <tt>NerdDice.configure do |config|
|
13
|
+
# config.randomization_technique = :random_new_interval
|
14
|
+
# config.new_random_interval = 100
|
15
|
+
# end
|
16
|
+
# </tt>
|
17
|
+
#
|
18
|
+
# You can also set a particular property without a block using inline assignment
|
19
|
+
# <tt>NerdDice.configuration.randomization_technique = :random_new_once</tt>
|
20
|
+
class Configuration
|
21
|
+
attr_reader :randomization_technique, :refresh_seed_interval
|
22
|
+
attr_accessor :ability_score_array_size
|
23
|
+
|
24
|
+
def randomization_technique=(value)
|
25
|
+
unless RANDOMIZATION_TECHNIQUES.include?(value)
|
26
|
+
raise NerdDice::Error, "randomization_technique must be one of #{RANDOMIZATION_TECHNIQUES.join(', ')}"
|
27
|
+
end
|
28
|
+
|
29
|
+
@randomization_technique = value
|
30
|
+
end
|
31
|
+
|
32
|
+
def refresh_seed_interval=(value)
|
33
|
+
unless value.nil?
|
34
|
+
value = value&.to_i
|
35
|
+
raise NerdDice::Error, "refresh_seed_interval must be a positive integer or nil" unless value.positive?
|
36
|
+
end
|
37
|
+
@refresh_seed_interval = value
|
38
|
+
end
|
39
|
+
|
40
|
+
private
|
41
|
+
|
42
|
+
def initialize
|
43
|
+
@ability_score_array_size = 6
|
44
|
+
@randomization_technique = :random_object
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
data/lib/nerd_dice/version.rb
CHANGED
data/lib/nerd_dice.rb
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require "nerd_dice/version"
|
4
|
+
require "nerd_dice/configuration"
|
5
|
+
require "securerandom"
|
4
6
|
# Nerd dice allows you to roll polyhedral dice and add bonuses as you would in
|
5
7
|
# a tabletop roleplaying game. You can choose to roll multiple dice and keep a
|
6
8
|
# specified number of dice such as rolling 4d6 and dropping the lowest for
|
@@ -23,25 +25,152 @@ require "nerd_dice/version"
|
|
23
25
|
module NerdDice
|
24
26
|
class Error < StandardError; end
|
25
27
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
28
|
+
RANDOMIZATION_TECHNIQUES = %i[securerandom random_rand random_object randomized].freeze
|
29
|
+
|
30
|
+
class << self
|
31
|
+
attr_reader :count_since_last_refresh
|
32
|
+
|
33
|
+
############################
|
34
|
+
# configure class method
|
35
|
+
############################
|
36
|
+
# Arguments: None
|
37
|
+
# Expects and yields to a block where configuration is specified.
|
38
|
+
# See README and NerdDice::Configuration class for config options
|
39
|
+
# Return (NerdDice::Configuration) the Configuration object tied to the
|
40
|
+
# @configuration class instance variable
|
41
|
+
def configure
|
42
|
+
yield configuration
|
43
|
+
configuration
|
44
|
+
end
|
45
|
+
|
46
|
+
############################
|
47
|
+
# configuration class method
|
48
|
+
############################
|
49
|
+
# Arguments: None
|
50
|
+
# Provides the lazy-loaded class instance variable @configuration
|
51
|
+
# Return (NerdDice::Configuration) the Configuration object tied to the
|
52
|
+
# @configuration class instance variable
|
53
|
+
def configuration
|
54
|
+
@configuration ||= Configuration.new
|
55
|
+
end
|
56
|
+
|
57
|
+
############################
|
58
|
+
# total_dice class method
|
59
|
+
############################
|
60
|
+
# Arguments:
|
61
|
+
# number_of_sides (Integer) => the number of sides of the dice to roll
|
62
|
+
# number_of_dice (Integer, DEFAULT: 1) => the quantity to roll of the type
|
63
|
+
# of die specified in the number_of_sides argument.
|
64
|
+
# options (Hash, DEFAULT: {}) any additional options you wish to include
|
65
|
+
# :bonus (Integer) => The total bonus (positive integer) or penalty
|
66
|
+
# (negative integer) to modify the total by. Is added to the total of
|
67
|
+
# all dice after they are totaled, not to each die rolled
|
68
|
+
#
|
69
|
+
# Return (Integer) => Total of the dice rolled, plus modifier if applicable
|
70
|
+
def total_dice(number_of_sides, number_of_dice = 1, **opts)
|
71
|
+
total = 0
|
72
|
+
number_of_dice.times do
|
73
|
+
total += execute_die_roll(number_of_sides, opts[:randomization_technique])
|
74
|
+
end
|
75
|
+
begin
|
76
|
+
total += opts[:bonus].to_i
|
77
|
+
rescue NoMethodError
|
78
|
+
raise ArgumentError, "Bonus must be a value that responds to :to_i"
|
79
|
+
end
|
80
|
+
total
|
81
|
+
end
|
82
|
+
|
83
|
+
############################
|
84
|
+
# execute_die_roll class method
|
85
|
+
############################
|
86
|
+
# Arguments:
|
87
|
+
# number_of_sides (Integer) => the number of sides of the die to roll
|
88
|
+
# using_generator (Symbol) => must be one of the symbols in
|
89
|
+
# RANDOMIZATION_TECHNIQUES or nil
|
90
|
+
#
|
91
|
+
# Return (Integer) => Value of the single die rolled
|
92
|
+
def execute_die_roll(number_of_sides, using_generator = nil)
|
93
|
+
@count_since_last_refresh ||= 0
|
94
|
+
gen = get_number_generator(using_generator)
|
95
|
+
result = gen.rand(number_of_sides) + 1
|
96
|
+
increment_and_evalutate_refresh_seed
|
97
|
+
result
|
98
|
+
end
|
99
|
+
|
100
|
+
############################
|
101
|
+
# refresh_seed! class method
|
102
|
+
############################
|
103
|
+
# Options: (none required)
|
104
|
+
# randomization_technique (Symbol) => must be one of the symbols in
|
105
|
+
# RANDOMIZATION_TECHNIQUES if specified
|
106
|
+
# random_rand_seed (Integer) => Seed to set for Random
|
107
|
+
# random_object_seed (Integer) => Seed to set for new Random object
|
108
|
+
# Return (Hash or nil) => Previous values of generator seeds that were refreshed
|
109
|
+
def refresh_seed!(**opts)
|
110
|
+
technique, random_rand_new_seed, random_object_new_seed = parse_refresh_options(opts)
|
111
|
+
@count_since_last_refresh = 0
|
112
|
+
return nil if technique == :securerandom
|
113
|
+
|
114
|
+
reset_appropriate_seeds!(technique, random_rand_new_seed, random_object_new_seed)
|
43
115
|
end
|
44
|
-
|
45
|
-
|
116
|
+
|
117
|
+
private
|
118
|
+
|
119
|
+
def get_number_generator(using_generator = nil)
|
120
|
+
using_generator ||= configuration.randomization_technique
|
121
|
+
case using_generator
|
122
|
+
when :securerandom then SecureRandom
|
123
|
+
when :random_rand then Random
|
124
|
+
when :random_object then @random_object ||= Random.new
|
125
|
+
when :randomized then random_generator
|
126
|
+
else raise ArgumentError, "Unrecognized generator. Must be one of #{RANDOMIZATION_TECHNIQUES.join(', ')}"
|
127
|
+
end
|
128
|
+
end
|
129
|
+
|
130
|
+
def random_generator
|
131
|
+
gen = RANDOMIZATION_TECHNIQUES.reject { |el| el == :randomized }.sample
|
132
|
+
get_number_generator(gen)
|
133
|
+
end
|
134
|
+
|
135
|
+
def refresh_random_rand_seed!(new_seed)
|
136
|
+
new_seed ? Random.srand(new_seed) : Random.srand
|
137
|
+
end
|
138
|
+
|
139
|
+
def refresh_random_object_seed!(new_seed)
|
140
|
+
old_seed = @random_object&.seed
|
141
|
+
@random_object = new_seed ? Random.new(new_seed) : Random.new
|
142
|
+
old_seed
|
143
|
+
end
|
144
|
+
|
145
|
+
def parse_refresh_options(opts)
|
146
|
+
[
|
147
|
+
opts[:randomization_technique] || configuration.randomization_technique,
|
148
|
+
opts[:random_rand_seed],
|
149
|
+
opts[:random_object_seed]
|
150
|
+
]
|
151
|
+
end
|
152
|
+
|
153
|
+
# rubocop:disable Metrics/MethodLength
|
154
|
+
def reset_appropriate_seeds!(technique, random_rand_new_seed, random_object_new_seed)
|
155
|
+
return_hash = {}
|
156
|
+
case technique
|
157
|
+
when :random_rand
|
158
|
+
return_hash[:random_rand_prior_seed] = refresh_random_rand_seed!(random_rand_new_seed)
|
159
|
+
when :random_object
|
160
|
+
return_hash[:random_object_prior_seed] = refresh_random_object_seed!(random_object_new_seed)
|
161
|
+
when :randomized
|
162
|
+
return_hash[:random_rand_prior_seed] = refresh_random_rand_seed!(random_rand_new_seed)
|
163
|
+
return_hash[:random_object_prior_seed] = refresh_random_object_seed!(random_object_new_seed)
|
164
|
+
end
|
165
|
+
return_hash
|
166
|
+
end
|
167
|
+
# rubocop:enable Metrics/MethodLength
|
168
|
+
|
169
|
+
def increment_and_evalutate_refresh_seed
|
170
|
+
@count_since_last_refresh += 1
|
171
|
+
return unless configuration.refresh_seed_interval
|
172
|
+
|
173
|
+
refresh_seed! if @count_since_last_refresh >= configuration.refresh_seed_interval
|
174
|
+
end
|
46
175
|
end
|
47
176
|
end
|
data/nerd_dice.gemspec
CHANGED
@@ -28,7 +28,6 @@ Gem::Specification.new do |spec|
|
|
28
28
|
spec.metadata["bug_tracker_uri"] = "https://github.com/statelesscode/nerd_dice/issues"
|
29
29
|
spec.metadata["documentation_uri"] = "https://github.com/statelesscode/nerd_dice/README.md"
|
30
30
|
spec.metadata["github_repo"] = "https://github.com/statelesscode/nerd_dice"
|
31
|
-
spec.metadata["rubygems_mfa_required"] = "true"
|
32
31
|
|
33
32
|
# Specify which files should be added to the gem when it is released.
|
34
33
|
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
@@ -44,13 +43,11 @@ Gem::Specification.new do |spec|
|
|
44
43
|
spec.signing_key = File.expand_path("~/.ssh/gem-private_key.pem") if $PROGRAM_NAME.end_with?("gem")
|
45
44
|
|
46
45
|
# Dependencies
|
47
|
-
spec.add_dependency "securerandom", "~> 0.
|
46
|
+
spec.add_dependency "securerandom", "~> 0.1", ">= 0.1.0"
|
48
47
|
|
49
48
|
# Development Dependencies
|
50
|
-
spec.add_development_dependency "
|
51
|
-
spec.add_development_dependency "rubocop", "~> 1.
|
52
|
-
spec.add_development_dependency "rubocop-
|
53
|
-
spec.add_development_dependency "rubocop-
|
54
|
-
spec.add_development_dependency "rubocop-rspec", "~> 2.18", ">= 2.18.1"
|
55
|
-
spec.add_development_dependency "simplecov-lcov", "~> 0.8.0"
|
49
|
+
spec.add_development_dependency "rubocop", "~> 1.8", ">= 1.8.1"
|
50
|
+
spec.add_development_dependency "rubocop-performance", "~> 1.9", ">= 1.9.1"
|
51
|
+
spec.add_development_dependency "rubocop-rake", "~> 0.5", ">= 0.5.1"
|
52
|
+
spec.add_development_dependency "rubocop-rspec", "~> 2.1", ">= 2.1.0"
|
56
53
|
end
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nerd_dice
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Duchemin
|
@@ -10,33 +10,32 @@ bindir: bin
|
|
10
10
|
cert_chain:
|
11
11
|
- |
|
12
12
|
-----BEGIN CERTIFICATE-----
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
t+NX7PDOWx4k
|
13
|
+
MIIETTCCArWgAwIBAgIBATANBgkqhkiG9w0BAQsFADAoMSYwJAYDVQQDDB1zdGF0
|
14
|
+
ZWxlc3Njb2RlL0RDPWdtYWlsL0RDPWNvbTAeFw0yMDEyMDYyMzQ1NTZaFw0yMTEy
|
15
|
+
MDYyMzQ1NTZaMCgxJjAkBgNVBAMMHXN0YXRlbGVzc2NvZGUvREM9Z21haWwvREM9
|
16
|
+
Y29tMIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEAyHIMJi0o3bwBZsx5
|
17
|
+
TQ35XByFsdDRsro3T+0NY7EAILtOiU04o9C2NPOp/RQE7BXQgMjGebwp6bT6QvzN
|
18
|
+
6noV4jPL7Fi5pWw08QygG7f+73YUBb+8d8o+3xGrC+UO5h1PZEtVcZwUWUG18QBE
|
19
|
+
fbDinQT6P4IDQoZwhfrPCB+aBfUyQp4Ok7oD7MEWqsq9SjrSxqxfk4+oZdXUySe7
|
20
|
+
Vi5vnzVQ5uFf56NHwWnNKCzJzmH84mBO5MzHaQpHNzKGJPoUmzLU5RBlCH6YXqBG
|
21
|
+
KhXTMUDBWKJmJ3RDry/FpGgJLKu4wzFRYjXla6IjeKozWGuPNNJ+2mesXKhsX7bo
|
22
|
+
vVCzRxPEupbEg/0FkJiWpiGlSPOdd6oJiwX8E6rlEeV605xrbOQewkbovHkYTMtG
|
23
|
+
+NH+u08x0z4Oj71kmDLwuj812uS0mtrCg2VhiYO0ZCQ4XrwBsBfK+/MtMlR+o6sG
|
24
|
+
/zvz/vHVJKaLTQxRp5oGo4QH6HfbOnwzTkXdZnt5AlN31ErJAgMBAAGjgYEwfzAJ
|
25
|
+
BgNVHRMEAjAAMAsGA1UdDwQEAwIEsDAdBgNVHQ4EFgQUC7seYydsGO6O1qT4nVVD
|
26
|
+
G/LkiHYwIgYDVR0RBBswGYEXc3RhdGVsZXNzY29kZUBnbWFpbC5jb20wIgYDVR0S
|
27
|
+
BBswGYEXc3RhdGVsZXNzY29kZUBnbWFpbC5jb20wDQYJKoZIhvcNAQELBQADggGB
|
28
|
+
ADPRFRB1cjqdcE2O0jtqiDRmrR62uEYBiUbkRPVhyoEp/cK0TVhAs9mGWAyCWu0M
|
29
|
+
LewUeqNTUvQ9MgvagcKcnxa2RTjdrP3nGnwpStMr9bm3ArNJEzvWEs0Eusk9y73x
|
30
|
+
fjy0qH2pw5WPfWcKYlDehMXqOP+a4udYsz0YSNiI8qEfkDCSqTJN11d5kSjVjwGB
|
31
|
+
xkauxDT68j1JZRjPmQl3dl+DCgxkoziWX2mFTPLfGg5vZ0t6gmhdUtLvJtNIo0IX
|
32
|
+
477E5UjmE1+rULQp/fsH6n5+H+t2eCED41ST+gkKbaQBUfIuUaCmdHz9sJaIIBw2
|
33
|
+
6ordFa1nrLV4w5Uf6qYFnWVhIWX4GToyZSPO2s0DPYp3PWFJ4VtzKa2vp1TR5ZEA
|
34
|
+
dkij2eQ9M8bzWWmW+A7RNaI0CzLl967bKGBSaMVCsZGBarggWD8UwJnBhTuOPZGR
|
35
|
+
WQ4faXJSevxT+x9TgyUNJINPkz/KqreClzdL83cwxPzFFQto7zF6zMCsj0slqJjW
|
36
|
+
EQ==
|
38
37
|
-----END CERTIFICATE-----
|
39
|
-
date:
|
38
|
+
date: 2021-01-28 00:00:00.000000000 Z
|
40
39
|
dependencies:
|
41
40
|
- !ruby/object:Gem::Dependency
|
42
41
|
name: securerandom
|
@@ -44,128 +43,100 @@ dependencies:
|
|
44
43
|
requirements:
|
45
44
|
- - "~>"
|
46
45
|
- !ruby/object:Gem::Version
|
47
|
-
version: '0.
|
46
|
+
version: '0.1'
|
48
47
|
- - ">="
|
49
48
|
- !ruby/object:Gem::Version
|
50
|
-
version: 0.
|
49
|
+
version: 0.1.0
|
51
50
|
type: :runtime
|
52
51
|
prerelease: false
|
53
52
|
version_requirements: !ruby/object:Gem::Requirement
|
54
53
|
requirements:
|
55
54
|
- - "~>"
|
56
55
|
- !ruby/object:Gem::Version
|
57
|
-
version: '0.
|
56
|
+
version: '0.1'
|
58
57
|
- - ">="
|
59
58
|
- !ruby/object:Gem::Version
|
60
|
-
version: 0.
|
61
|
-
- !ruby/object:Gem::Dependency
|
62
|
-
name: coveralls_reborn
|
63
|
-
requirement: !ruby/object:Gem::Requirement
|
64
|
-
requirements:
|
65
|
-
- - "~>"
|
66
|
-
- !ruby/object:Gem::Version
|
67
|
-
version: 0.27.0
|
68
|
-
type: :development
|
69
|
-
prerelease: false
|
70
|
-
version_requirements: !ruby/object:Gem::Requirement
|
71
|
-
requirements:
|
72
|
-
- - "~>"
|
73
|
-
- !ruby/object:Gem::Version
|
74
|
-
version: 0.27.0
|
59
|
+
version: 0.1.0
|
75
60
|
- !ruby/object:Gem::Dependency
|
76
61
|
name: rubocop
|
77
62
|
requirement: !ruby/object:Gem::Requirement
|
78
63
|
requirements:
|
79
64
|
- - "~>"
|
80
65
|
- !ruby/object:Gem::Version
|
81
|
-
version: '1.
|
66
|
+
version: '1.8'
|
82
67
|
- - ">="
|
83
68
|
- !ruby/object:Gem::Version
|
84
|
-
version: 1.
|
69
|
+
version: 1.8.1
|
85
70
|
type: :development
|
86
71
|
prerelease: false
|
87
72
|
version_requirements: !ruby/object:Gem::Requirement
|
88
73
|
requirements:
|
89
74
|
- - "~>"
|
90
75
|
- !ruby/object:Gem::Version
|
91
|
-
version: '1.
|
76
|
+
version: '1.8'
|
92
77
|
- - ">="
|
93
78
|
- !ruby/object:Gem::Version
|
94
|
-
version: 1.
|
79
|
+
version: 1.8.1
|
95
80
|
- !ruby/object:Gem::Dependency
|
96
81
|
name: rubocop-performance
|
97
82
|
requirement: !ruby/object:Gem::Requirement
|
98
83
|
requirements:
|
99
84
|
- - "~>"
|
100
85
|
- !ruby/object:Gem::Version
|
101
|
-
version: '1.
|
86
|
+
version: '1.9'
|
102
87
|
- - ">="
|
103
88
|
- !ruby/object:Gem::Version
|
104
|
-
version: 1.
|
89
|
+
version: 1.9.1
|
105
90
|
type: :development
|
106
91
|
prerelease: false
|
107
92
|
version_requirements: !ruby/object:Gem::Requirement
|
108
93
|
requirements:
|
109
94
|
- - "~>"
|
110
95
|
- !ruby/object:Gem::Version
|
111
|
-
version: '1.
|
96
|
+
version: '1.9'
|
112
97
|
- - ">="
|
113
98
|
- !ruby/object:Gem::Version
|
114
|
-
version: 1.
|
99
|
+
version: 1.9.1
|
115
100
|
- !ruby/object:Gem::Dependency
|
116
101
|
name: rubocop-rake
|
117
102
|
requirement: !ruby/object:Gem::Requirement
|
118
103
|
requirements:
|
119
104
|
- - "~>"
|
120
105
|
- !ruby/object:Gem::Version
|
121
|
-
version: '0.
|
106
|
+
version: '0.5'
|
122
107
|
- - ">="
|
123
108
|
- !ruby/object:Gem::Version
|
124
|
-
version: 0.
|
109
|
+
version: 0.5.1
|
125
110
|
type: :development
|
126
111
|
prerelease: false
|
127
112
|
version_requirements: !ruby/object:Gem::Requirement
|
128
113
|
requirements:
|
129
114
|
- - "~>"
|
130
115
|
- !ruby/object:Gem::Version
|
131
|
-
version: '0.
|
116
|
+
version: '0.5'
|
132
117
|
- - ">="
|
133
118
|
- !ruby/object:Gem::Version
|
134
|
-
version: 0.
|
119
|
+
version: 0.5.1
|
135
120
|
- !ruby/object:Gem::Dependency
|
136
121
|
name: rubocop-rspec
|
137
122
|
requirement: !ruby/object:Gem::Requirement
|
138
123
|
requirements:
|
139
124
|
- - "~>"
|
140
125
|
- !ruby/object:Gem::Version
|
141
|
-
version: '2.
|
126
|
+
version: '2.1'
|
142
127
|
- - ">="
|
143
128
|
- !ruby/object:Gem::Version
|
144
|
-
version: 2.
|
129
|
+
version: 2.1.0
|
145
130
|
type: :development
|
146
131
|
prerelease: false
|
147
132
|
version_requirements: !ruby/object:Gem::Requirement
|
148
133
|
requirements:
|
149
134
|
- - "~>"
|
150
135
|
- !ruby/object:Gem::Version
|
151
|
-
version: '2.
|
136
|
+
version: '2.1'
|
152
137
|
- - ">="
|
153
138
|
- !ruby/object:Gem::Version
|
154
|
-
version: 2.
|
155
|
-
- !ruby/object:Gem::Dependency
|
156
|
-
name: simplecov-lcov
|
157
|
-
requirement: !ruby/object:Gem::Requirement
|
158
|
-
requirements:
|
159
|
-
- - "~>"
|
160
|
-
- !ruby/object:Gem::Version
|
161
|
-
version: 0.8.0
|
162
|
-
type: :development
|
163
|
-
prerelease: false
|
164
|
-
version_requirements: !ruby/object:Gem::Requirement
|
165
|
-
requirements:
|
166
|
-
- - "~>"
|
167
|
-
- !ruby/object:Gem::Version
|
168
|
-
version: 0.8.0
|
139
|
+
version: 2.1.0
|
169
140
|
description: |2
|
170
141
|
Nerd dice allows you to roll polyhedral dice and add bonuses as you would in
|
171
142
|
a tabletop roleplaying game. You can choose to roll multiple dice and keep a
|
@@ -202,6 +173,7 @@ files:
|
|
202
173
|
- checksum/nerd_dice-0.1.1.gem.sha256
|
203
174
|
- checksum/nerd_dice-0.1.1.gem.sha512
|
204
175
|
- lib/nerd_dice.rb
|
176
|
+
- lib/nerd_dice/configuration.rb
|
205
177
|
- lib/nerd_dice/version.rb
|
206
178
|
- nerd_dice.gemspec
|
207
179
|
homepage: https://github.com/statelesscode/nerd_dice
|
@@ -216,7 +188,6 @@ metadata:
|
|
216
188
|
bug_tracker_uri: https://github.com/statelesscode/nerd_dice/issues
|
217
189
|
documentation_uri: https://github.com/statelesscode/nerd_dice/README.md
|
218
190
|
github_repo: https://github.com/statelesscode/nerd_dice
|
219
|
-
rubygems_mfa_required: 'true'
|
220
191
|
post_install_message:
|
221
192
|
rdoc_options: []
|
222
193
|
require_paths:
|
@@ -232,7 +203,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
232
203
|
- !ruby/object:Gem::Version
|
233
204
|
version: '0'
|
234
205
|
requirements: []
|
235
|
-
rubygems_version: 3.
|
206
|
+
rubygems_version: 3.2.3
|
236
207
|
signing_key:
|
237
208
|
specification_version: 4
|
238
209
|
summary: A Ruby Gem for rolling polyhedral dice.
|
metadata.gz.sig
CHANGED
Binary file
|