securer_randomer 0.1.3 → 0.1.4

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 25d43122579ac392adc2e74c8fa6d28e1448bf0b
4
- data.tar.gz: 3978081bda3f60f1e3badf4db94d136afb368d9a
3
+ metadata.gz: 78ef5479ad3ab003521008c6187af14d0fd1bc95
4
+ data.tar.gz: b8de5c893bcdae29488f1001445c73031f667f1d
5
5
  SHA512:
6
- metadata.gz: 509f3a5ea524c8f192cf6b9fea97b06d98727a4bc4929ed8ac1e6626c68a3db527cbbad3fc0e2d127cbf31067096e4323c93c26a4051204efa777ec102061865
7
- data.tar.gz: ec2b8c5873cdd922f5fde5f663150e6773def66475e09e3303d02e6f92a5b560e9af6f7c55b36ddd501c67b248d9e8cf995ad2011d71dcd06afa937a94fe43a8
6
+ metadata.gz: f0ad82e2504fbaec7836f307a5406adf40c1e68af9eb1254440c9bc0b16e310659102e8ceee0a72b444f2dea580fa00590c973d58dcd52b6d3901ae695238d95
7
+ data.tar.gz: 06ef5ada69966a6e9811267098e8ecc3702f63eefad7e51160583d8390220f0149af2599e9b6f0537086f869564240e18fa0edd9d35b87ae243f300d7dbb879c
@@ -29,6 +29,8 @@ module SecurerRandomer
29
29
  break q unless n.exclude_end? and q == n.end
30
30
  end
31
31
  end
32
+ elsif n.begin == n.end and n.exclude_end?
33
+ nil
32
34
  else
33
35
  _rand_range(n)
34
36
  end
@@ -20,7 +20,13 @@ module SecureRandom
20
20
  when nil
21
21
  0
22
22
  when Range
23
- n.end < n.begin ? 0 : n
23
+ if n.end < n.begin
24
+ 0
25
+ elsif n.begin == n.end and n.exclude_end?
26
+ 0
27
+ else
28
+ n
29
+ end
24
30
  when Numeric
25
31
  n > 0 ? n : 0
26
32
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SecurerRandomer
4
- VERSION = '0.1.3' # rubocop:disable Style/MutableConstant
4
+ VERSION = '0.1.4' # rubocop:disable Style/MutableConstant
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: securer_randomer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Pastore