kit 0.1.1 → 0.1.2

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. data/lib/kit.rb +4 -2
  2. data/lib/kit/bit.rb +1 -1
  3. metadata +2 -2
data/lib/kit.rb CHANGED
@@ -85,9 +85,11 @@ class Kit
85
85
  if info.is_a? Integer
86
86
  Bit.new info
87
87
  elsif info.is_a? Hash
88
- Bit.new Bit::lookup_id info
88
+ ids = Bit::lookup_id info
89
+ raise Bit::DuplicateElement unless ids.length == 1
90
+ Bit.new ids.first
89
91
  end
90
- rescue Bit::NoElement
92
+ rescue Bit::NoElement, Bit::DuplicateElement
91
93
  nil
92
94
  end
93
95
  end
@@ -74,7 +74,7 @@ class Bit < Kit
74
74
  uniq = @@unique[:bits].hash_ivars self
75
75
  uniq.each { |x| fail MissingValues if x.nil? }
76
76
 
77
- fail DuplicateElement if lookup_id uniq
77
+ fail DuplicateElement if ( lookup_id uniq ).first
78
78
 
79
79
  data = @@info[:bits].hash_ivars self, [ :rowid ]
80
80
  @@db.insert_info :bits, data
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 1
9
- version: 0.1.1
8
+ - 2
9
+ version: 0.1.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - Evan Boyd Sosenko