packed-model 0.1.4 → 0.1.5

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.4
1
+ 0.1.5
@@ -162,6 +162,11 @@ module PackedModel
162
162
  self.class_eval method_src, __FILE__, __LINE__
163
163
  end
164
164
 
165
+ @@valid_true_boolean_values = nil
166
+ def self.valid_true_boolean_values
167
+ @@valid_true_boolean_values ||= [true, 1, '1', 'true', 'on', 'yes']
168
+ end
169
+
165
170
  def self.bit_vector(name, fields, options={})
166
171
  raise "too many fields for bit vecotr #{name}" if fields.size > 32
167
172
 
@@ -178,7 +183,7 @@ module PackedModel
178
183
  end
179
184
 
180
185
  define_method "#{fld}=" do |val|
181
- if val
186
+ if self.class.valid_true_boolean_values.include?(val)
182
187
  self.send(name_equals, self.send(name) | mask)
183
188
  else
184
189
  self.send(name_equals, self.send(name) & neg_mask)
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "packed-model"
8
- s.version = "0.1.4"
8
+ s.version = "0.1.5"
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"]
12
- s.date = "2013-11-05"
12
+ s.date = "2014-01-21"
13
13
  s.description = "Used to minimize storage space required to store list of data"
14
14
  s.email = "doug@sessionm.com"
15
15
  s.extra_rdoc_files = [
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.4
4
+ version: 0.1.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-11-05 00:00:00.000000000 Z
12
+ date: 2014-01-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: jeweler
@@ -83,7 +83,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
83
83
  version: '0'
84
84
  segments:
85
85
  - 0
86
- hash: 4377048112716490985
86
+ hash: 1410085114559783270
87
87
  required_rubygems_version: !ruby/object:Gem::Requirement
88
88
  none: false
89
89
  requirements: