dumb_numb_set 0.1.0 → 1.0.0
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 +5 -5
- data/lib/dumb_numb_set.rb +2 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: ad6440ff6cac0235045715cc5b43a774e6752c38c22fd2cc071769cca04165c0
|
4
|
+
data.tar.gz: 2917634c3084c936d03c099ec06ea0805611e682d3f390d9efe0489b5d412945
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 982f5fe95d7bcf714323dff02713fb9799fd2ac1f6c7f2c42c53cf3a30994e5e4f73a47bf80bc386b12119d0ddc66fb08fdc71bd058c1ad6967ec984f13287f5
|
7
|
+
data.tar.gz: fed3a8ad98614d687d5cd555de70fe01b7d80ea6c87fef73f6e884b7aa578232738cc119b2c66dd5dfdda871df7ed138480764c7a5355131f99b3d574cdab93c
|
data/lib/dumb_numb_set.rb
CHANGED
@@ -39,7 +39,7 @@ class DumbNumbSet
|
|
39
39
|
@bitsets = {}
|
40
40
|
|
41
41
|
# Set divisor so that bit-wise operations are always performed
|
42
|
-
# with
|
42
|
+
# with Integers.
|
43
43
|
if 1.size == 4
|
44
44
|
@div = 29
|
45
45
|
else
|
@@ -50,7 +50,7 @@ class DumbNumbSet
|
|
50
50
|
# Add a non-negative integer to the set.
|
51
51
|
# Raises an ArgumentError if the number given is not a non-negative integer.
|
52
52
|
def add num
|
53
|
-
raise ArgumentError, "Argument must be positive integer" unless num.is_a?
|
53
|
+
raise ArgumentError, "Argument must be positive integer" unless num.is_a? Integer and num.integer? and num >= 0
|
54
54
|
|
55
55
|
index = num / @div
|
56
56
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dumb_numb_set
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justin Collins
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-05-20 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: |
|
14
14
|
Ever needed to compactly store and query a set of mostly consecutive,
|
@@ -41,7 +41,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
41
41
|
version: '0'
|
42
42
|
requirements: []
|
43
43
|
rubyforge_project:
|
44
|
-
rubygems_version: 2.
|
44
|
+
rubygems_version: 2.7.6
|
45
45
|
signing_key:
|
46
46
|
specification_version: 4
|
47
47
|
summary: A compact data structure for mostly consecutive, non-negative integers.
|