packed-model 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.3
1
+ 0.1.4
@@ -171,6 +171,7 @@ module PackedModel
171
171
 
172
172
  fields.each_with_index do |fld, idx|
173
173
  mask = 1 << idx
174
+ neg_mask = 0xFFFFFFFF ^ mask
174
175
 
175
176
  define_method fld do
176
177
  (self.send(name) & mask) == mask
@@ -180,7 +181,7 @@ module PackedModel
180
181
  if val
181
182
  self.send(name_equals, self.send(name) | mask)
182
183
  else
183
- self.send(name_equals, self.send(name) ^ mask)
184
+ self.send(name_equals, self.send(name) & neg_mask)
184
185
  end
185
186
  end
186
187
  end
data/packed-model.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "packed-model"
8
- s.version = "0.1.3"
8
+ s.version = "0.1.4"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Doug Youch"]
@@ -267,5 +267,12 @@ describe PackedModel::Base do
267
267
  m.send("bit#{n}").should be_true
268
268
  end
269
269
  end
270
+
271
+ it "should not break on ||= false" do
272
+ m = TestBitVectorPackedModel.new
273
+ m.bit1.should be_false
274
+ m.bit1 ||= false
275
+ m.bit1.should be_false
276
+ end
270
277
  end
271
278
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: packed-model
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -83,7 +83,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
83
83
  version: '0'
84
84
  segments:
85
85
  - 0
86
- hash: -849361634013391073
86
+ hash: 4377048112716490985
87
87
  required_rubygems_version: !ruby/object:Gem::Requirement
88
88
  none: false
89
89
  requirements: