noreprand 0.0.2 → 0.0.3

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/noreprand.rb +8 -0
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3eaea0eb233c720c365dc443d6b79b314741a0d3
4
- data.tar.gz: 9d4c70f9c2c186fd0585d68f9e66d7614a6cb86c
3
+ metadata.gz: 527457765885148cbb46458c4ad9a8c7ffd6046f
4
+ data.tar.gz: 0ed0c080a8ba9796c6ddc721ccf6d14a6790c034
5
5
  SHA512:
6
- metadata.gz: bce996c001e1ff0714f02235f56aabfc9f3b3dbf8bde1e2c5d54a8f07c40404e2d3f36ffe82229c2470179e81bda8a8aef13b6543264545a9ece7e80a4df73f7
7
- data.tar.gz: f0cdd7b44fecf40d6e890a69e024cf377293fce5cd4ce408d79fe5bd72f865ccfab55ad275b10ec35324d1cf7ea57008b4f15d2aa8f258df51d1c5b3892e53ad
6
+ metadata.gz: 370d703a48410f8f45782ba2d2549b8dce817b1361943aa6951952fdebf4187f20fe090b68e7225dab2a65317cfa5581cb9242c7d5242141288b3f735ca9ae9f
7
+ data.tar.gz: c722df87db768dee19003056ced7b0c3de297bcbaece43e0bb726cdabc63ac22e5b659e80e996c89bd20ff7593259bea1eebabd185bb458a1b303dc44ca11bab
@@ -4,10 +4,18 @@ class ExceededDigitLimit < StandardError
4
4
  end
5
5
  end
6
6
 
7
+ class BelowDigitMinimum < StandardError
8
+ def initialize(msg = "Needs to have at least 1 digit")
9
+ super
10
+ end
11
+ end
12
+
7
13
  class NoRepRand
8
14
  def raand(digitcount, nostartwithzero = false)
9
15
  if digitcount > 10
10
16
  raise ExceededDigitLimit
17
+ elsif digitcount <= 0
18
+ raise BelowDigitMinimum
11
19
  else
12
20
  digits = Array(0..9)
13
21
  tempnum = []
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: noreprand
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonathan Tan